raggrep 0.1.5 → 0.1.6

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.
@@ -11,9 +11,27 @@ export declare const DEFAULT_CONFIG: Config;
11
11
  /** Available embedding models (for validation) */
12
12
  export declare const EMBEDDING_MODELS: Record<EmbeddingModelName, string>;
13
13
  /**
14
- * Get the root .raggrep directory path
14
+ * Get the index storage directory path.
15
+ *
16
+ * Index data is stored in a system temp directory to avoid cluttering
17
+ * the user's project with index files. The temp path is derived from
18
+ * a hash of the project's absolute path to ensure uniqueness.
19
+ *
20
+ * Structure: {tmpdir}/raggrep-indexes/{hash}/
21
+ *
22
+ * @param rootDir - Absolute path to the project root
23
+ * @returns Absolute path to the index storage directory
24
+ */
25
+ export declare function getRaggrepDir(rootDir: string, _config?: Config): string;
26
+ /**
27
+ * Get the index storage path and also return useful metadata.
28
+ * Helpful for debugging and user feedback.
15
29
  */
16
- export declare function getRaggrepDir(rootDir: string, config?: Config): string;
30
+ export declare function getIndexLocation(rootDir: string): {
31
+ indexDir: string;
32
+ projectRoot: string;
33
+ projectHash: string;
34
+ };
17
35
  /**
18
36
  * Get the index data directory for a specific module
19
37
  */
@@ -27,7 +45,8 @@ export declare function getModuleManifestPath(rootDir: string, moduleId: string,
27
45
  */
28
46
  export declare function getGlobalManifestPath(rootDir: string, config?: Config): string;
29
47
  /**
30
- * Get the config file path
48
+ * Get the config file path.
49
+ * Note: Config is still stored in the temp index directory, not the project.
31
50
  */
32
51
  export declare function getConfigPath(rootDir: string, config?: Config): string;
33
52
  /**
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * Handles loading and saving RAGgrep configuration from the filesystem.
5
5
  */
6
- export { DEFAULT_CONFIG, EMBEDDING_MODELS, getRaggrepDir, getModuleIndexPath, getModuleManifestPath, getGlobalManifestPath, getConfigPath, loadConfig, saveConfig, getModuleConfig, getEmbeddingConfigFromModule, } from "./configLoader";
6
+ export { DEFAULT_CONFIG, EMBEDDING_MODELS, getRaggrepDir, getIndexLocation, getModuleIndexPath, getModuleManifestPath, getGlobalManifestPath, getConfigPath, loadConfig, saveConfig, getModuleConfig, getEmbeddingConfigFromModule, } from "./configLoader";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Configuration File Conventions
3
+ *
4
+ * Patterns for recognizing common configuration files.
5
+ */
6
+ import type { FileConvention } from "./types";
7
+ /**
8
+ * Configuration file conventions.
9
+ */
10
+ export declare const configFileConventions: FileConvention[];
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Tests for File Conventions Module
3
+ */
4
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Entry Point Conventions
3
+ *
4
+ * Patterns for recognizing module entry points and barrel files.
5
+ */
6
+ import type { FileConvention } from "./types";
7
+ /**
8
+ * Entry point conventions for JavaScript/TypeScript projects.
9
+ */
10
+ export declare const entryPointConventions: FileConvention[];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Convex Framework Conventions
3
+ *
4
+ * Patterns for recognizing Convex backend files and structures.
5
+ * Convex is a backend platform with real-time sync.
6
+ */
7
+ import type { FrameworkConventions } from "../types";
8
+ /**
9
+ * Convex framework conventions provider.
10
+ */
11
+ export declare const convexFramework: FrameworkConventions;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Framework Conventions Registry
3
+ *
4
+ * Central registry for framework-specific conventions.
5
+ * Add new frameworks here to extend convention support.
6
+ */
7
+ import type { FrameworkConventions } from "../types";
8
+ /**
9
+ * All registered framework convention providers.
10
+ * Add new frameworks to this array.
11
+ */
12
+ export declare const frameworkProviders: FrameworkConventions[];
13
+ /**
14
+ * Get all framework conventions.
15
+ */
16
+ export declare function getAllFrameworkConventions(): import("..").FileConvention[];
17
+ /**
18
+ * Get frameworks by ID.
19
+ */
20
+ export declare function getFramework(id: string): FrameworkConventions | undefined;
21
+ export { nextjsFramework } from "./nextjs";
22
+ export { convexFramework } from "./convex";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Next.js Framework Conventions
3
+ *
4
+ * Patterns for recognizing Next.js specific files and structures.
5
+ */
6
+ import type { FrameworkConventions } from "../types";
7
+ /**
8
+ * Next.js framework conventions provider.
9
+ */
10
+ export declare const nextjsFramework: FrameworkConventions;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * File Conventions Module
3
+ *
4
+ * Provides semantic keywords for files based on common conventions.
5
+ * This helps improve search relevance by recognizing special file patterns.
6
+ *
7
+ * Categories:
8
+ * - Entry Points: index.ts, main.ts, App.tsx, etc.
9
+ * - Configuration: tsconfig.json, .prettierrc, package.json, etc.
10
+ * - Frameworks: Next.js, Convex, and other framework-specific patterns
11
+ * - Type Definitions: *.d.ts, *.types.ts
12
+ *
13
+ * Extensibility:
14
+ * - Add new conventions to entryPoints.ts or configFiles.ts
15
+ * - Add new frameworks in the frameworks/ directory
16
+ */
17
+ import type { FileConvention, ConventionMatch } from "./types";
18
+ export type { FileConvention, ConventionCategory, ConventionMatch, FrameworkConventions, } from "./types";
19
+ /**
20
+ * Get all conventions including built-in ones.
21
+ */
22
+ export declare function getConventions(): FileConvention[];
23
+ /**
24
+ * Match a filepath against all conventions and return keywords.
25
+ *
26
+ * @param filepath - The file path (relative to project root)
27
+ * @returns Array of keywords from all matching conventions
28
+ */
29
+ export declare function getConventionKeywords(filepath: string): string[];
30
+ /**
31
+ * Match a filepath against all conventions and return detailed matches.
32
+ *
33
+ * @param filepath - The file path (relative to project root)
34
+ * @returns Array of convention matches with details
35
+ */
36
+ export declare function matchConventions(filepath: string): ConventionMatch[];
37
+ export { entryPointConventions } from "./entryPoints";
38
+ export { configFileConventions } from "./configFiles";
39
+ export { frameworkProviders, getAllFrameworkConventions } from "./frameworks";
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Types for File Conventions
3
+ *
4
+ * Defines patterns for recognizing special files and their semantic meaning.
5
+ */
6
+ /**
7
+ * A file convention pattern that matches files and provides keywords.
8
+ */
9
+ export interface FileConvention {
10
+ /** Unique identifier for this convention */
11
+ id: string;
12
+ /** Human-readable name */
13
+ name: string;
14
+ /** Description of what this convention represents */
15
+ description: string;
16
+ /** Category for grouping conventions */
17
+ category: ConventionCategory;
18
+ /**
19
+ * Match function - returns true if the filepath matches this convention.
20
+ * @param filepath - The file path (relative to project root)
21
+ * @param filename - Just the filename
22
+ * @param extension - File extension including dot (e.g., ".ts")
23
+ */
24
+ match: (filepath: string, filename: string, extension: string) => boolean;
25
+ /**
26
+ * Keywords to add when this convention matches.
27
+ * These will be added to the search index.
28
+ */
29
+ keywords: string[];
30
+ /**
31
+ * Optional: Additional keywords based on the filepath.
32
+ * Useful for extracting context from the path.
33
+ */
34
+ dynamicKeywords?: (filepath: string) => string[];
35
+ }
36
+ /**
37
+ * Categories for organizing conventions.
38
+ */
39
+ export type ConventionCategory = "entry-point" | "configuration" | "framework" | "types" | "test" | "documentation" | "build" | "deployment";
40
+ /**
41
+ * A framework convention provider.
42
+ * Frameworks can register their own conventions.
43
+ */
44
+ export interface FrameworkConventions {
45
+ /** Framework identifier */
46
+ id: string;
47
+ /** Framework name */
48
+ name: string;
49
+ /** Check if this framework is detected in the project */
50
+ detect: (filepath: string, allFiles?: string[]) => boolean;
51
+ /** Conventions specific to this framework */
52
+ conventions: FileConvention[];
53
+ }
54
+ /**
55
+ * Result of matching conventions against a file.
56
+ */
57
+ export interface ConventionMatch {
58
+ /** The convention that matched */
59
+ convention: FileConvention;
60
+ /** Keywords from this match */
61
+ keywords: string[];
62
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Integration Tests for RAGgrep
3
+ *
4
+ * These tests run against the .simulation folder and validate
5
+ * end-to-end functionality of indexing and search.
6
+ *
7
+ * Tests are run sequentially to ensure proper state management.
8
+ */
9
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "raggrep",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",