claude-flow-novice 2.18.15 → 2.18.16

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.
@@ -1,3 +1,47 @@
1
+ //! # RuVector Index Command
2
+ //!
3
+ //! ## IMPORTANT: Run from PROJECT ROOT
4
+ //!
5
+ //! This indexer MUST be run from the project root directory to index all files correctly.
6
+ //! Running from a subdirectory will only index that subdirectory.
7
+ //!
8
+ //! ## Recommended Usage:
9
+ //! ```bash
10
+ //! cd /path/to/project-root
11
+ //! local-ruvector index --path . --types rs,ts,js,json,md,sh --force
12
+ //! ```
13
+ //!
14
+ //! ## Supported File Types (default):
15
+ //! - rs, ts, js, json, md, sh, yaml, yml, txt, config
16
+ //! - Use --types to specify custom extensions
17
+ //!
18
+ //! ## Excluded Directories (see EXCLUDED_DIRS constant - 52 patterns):
19
+ //! - Dependencies: node_modules, vendor, .pnpm, .yarn
20
+ //! - Build artifacts: target, dist, build, out, .next, .nuxt, .output, .turbo, .parcel-cache
21
+ //! - VCS: .git, .svn, .hg
22
+ //! - IDE: .idea, .vscode, .vs
23
+ //! - Cache: .cache, __pycache__, .pytest_cache, .mypy_cache, .ruff_cache, coverage, .nyc_output
24
+ //! - Virtual envs: .venv, venv, env
25
+ //! - IaC: .terraform, .serverless, .aws-sam
26
+ //! - Project-specific: .artifacts, .ruvector, .archive, archive
27
+ //! - Backups/temp: backups, .backups, backup, tmp, .tmp, temp, logs
28
+ //! - Test artifacts: __snapshots__, __mocks__, playwright-report, test-results
29
+ //! - Doc builds: _site, .docusaurus, site
30
+ //! - NOTE: .claude directory IS included (contains important config)
31
+ //!
32
+ //! ## Excluded Files (see EXCLUDED_FILES constant - 41 patterns):
33
+ //! - Secrets: .env*, credentials.json, secrets.json, .npmrc, .pypirc, .netrc, id_rsa, *.pem, *.key
34
+ //! - Lock files: package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, go.sum, etc.
35
+ //! - Backups: *.bak, *.backup, *.orig, *.swp, *~
36
+ //! - Minified/generated: *.min.js, *.min.css, *.bundle.js, *.chunk.js, *.js.map, *.d.ts
37
+ //! - Binary/data: *.wasm, *.db, *.sqlite
38
+ //! - Build info: *.snap, *.eslintcache, *.tsbuildinfo
39
+ //!
40
+ //! ## Multi-Project Isolation:
41
+ //! - Each project root is isolated via project_root column in v2 schema
42
+ //! - Centralized database at ~/.local/share/ruvector/index_v2.db
43
+ //! - Queries are scoped to the project root passed during indexing
44
+
1
45
  use anyhow::{Result, Context, anyhow};
2
46
  use std::fs;
3
47
  use std::path::{Path, PathBuf};
@@ -21,6 +65,152 @@ use crate::schema_v2::{EntityKind, RefKind, Visibility};
21
65
  use crate::path_validator;
22
66
  use local_ruvector::paths::{get_ruvector_dir, get_database_path, get_v1_index_dir};
23
67
 
68
+ /// Directories to exclude from indexing.
69
+ /// These are typically build artifacts, dependencies, VCS, or sensitive directories.
70
+ const EXCLUDED_DIRS: &[&str] = &[
71
+ // Package managers & dependencies
72
+ "node_modules", // npm/yarn/pnpm dependencies
73
+ "vendor", // Go/PHP vendor dependencies
74
+ ".pnpm", // pnpm store
75
+ ".yarn", // Yarn 2+ PnP cache
76
+
77
+ // Build artifacts
78
+ "target", // Rust/Maven build artifacts
79
+ "dist", // JS/TS build output
80
+ "build", // Generic build output
81
+ "out", // Common output directory
82
+ ".next", // Next.js build
83
+ ".nuxt", // Nuxt.js build
84
+ ".output", // Nitro/Nuxt output
85
+ ".turbo", // Turborepo cache
86
+ ".parcel-cache", // Parcel bundler cache
87
+ ".webpack", // Webpack cache
88
+
89
+ // Version control
90
+ ".git", // Git repository data
91
+ ".svn", // Subversion
92
+ ".hg", // Mercurial
93
+
94
+ // IDE & editor
95
+ ".idea", // JetBrains IDEs
96
+ ".vscode", // VS Code (may contain sensitive settings)
97
+ ".vs", // Visual Studio
98
+
99
+ // Cache & temp
100
+ ".cache", // Generic cache directories
101
+ "__pycache__", // Python bytecode cache
102
+ ".pytest_cache", // Pytest cache
103
+ ".mypy_cache", // Mypy cache
104
+ ".ruff_cache", // Ruff linter cache
105
+ "coverage", // Test coverage reports
106
+ ".nyc_output", // NYC coverage output
107
+ ".eslintcache", // ESLint cache (dir form)
108
+
109
+ // Virtual environments
110
+ ".venv", // Python virtual environments
111
+ "venv", // Python venv (alternate)
112
+ ".env", // dotenv directories (not files)
113
+ "env", // Generic env directory
114
+
115
+ // Infrastructure as Code
116
+ ".terraform", // Terraform state/cache
117
+ ".serverless", // Serverless framework
118
+ ".aws-sam", // AWS SAM
119
+
120
+ // Project-specific
121
+ ".artifacts", // CFN Loop artifacts
122
+ ".ruvector", // RuVector local index (avoid self-indexing)
123
+ ".archive", // Archived/deprecated code
124
+ "archive", // Archive directories
125
+
126
+ // Backups & generated
127
+ "backups", // Backup directories
128
+ ".backups", // Hidden backup directories
129
+ "backup", // Singular backup directory
130
+ ".backup", // Hidden singular backup
131
+ "tmp", // Temporary files
132
+ ".tmp", // Hidden temp files
133
+ "temp", // Temp directory
134
+ "logs", // Log directories
135
+ ".logs", // Hidden logs
136
+
137
+ // Test artifacts (not source code)
138
+ "__snapshots__", // Jest snapshots
139
+ "__mocks__", // Jest mocks (usually generated)
140
+ ".storybook", // Storybook config (not source)
141
+ "storybook-static", // Storybook build output
142
+ "playwright-report", // Playwright test reports
143
+ "test-results", // Generic test results
144
+
145
+ // Documentation builds
146
+ "_site", // Jekyll output
147
+ ".docusaurus", // Docusaurus cache
148
+ "site", // MkDocs output
149
+ ];
150
+
151
+ /// File patterns to exclude from indexing.
152
+ /// These are sensitive files or files that shouldn't be semantically indexed.
153
+ const EXCLUDED_FILES: &[&str] = &[
154
+ // Sensitive/secrets
155
+ ".env", // Environment variables (secrets!)
156
+ ".env.local", // Local env overrides
157
+ ".env.development", // Dev env
158
+ ".env.production", // Prod env
159
+ ".env.test", // Test env
160
+ ".env.example", // Example env (may contain structure hints)
161
+ "credentials.json", // GCP/generic credentials
162
+ "secrets.json", // Generic secrets
163
+ "secrets.yaml", // Kubernetes secrets
164
+ "service-account.json", // GCP service account
165
+ ".npmrc", // npm auth tokens
166
+ ".pypirc", // PyPI auth
167
+ ".netrc", // Network credentials
168
+ "id_rsa", // SSH private key
169
+ "id_ed25519", // SSH private key
170
+ ".pem", // Certificate/key files
171
+ ".key", // Key files
172
+
173
+ // Lock files (large, not useful for semantic search)
174
+ "package-lock.json", // npm lock
175
+ "yarn.lock", // Yarn lock
176
+ "pnpm-lock.yaml", // pnpm lock
177
+ "Cargo.lock", // Rust lock
178
+ "poetry.lock", // Python poetry lock
179
+ "Gemfile.lock", // Ruby bundler lock
180
+ "composer.lock", // PHP composer lock
181
+ "go.sum", // Go module checksums
182
+ "flake.lock", // Nix flake lock
183
+
184
+ // Backups
185
+ ".bak", // Generic backup extension
186
+ ".backup", // Backup files
187
+ ".orig", // Original files (merge conflicts)
188
+ ".swp", // Vim swap files
189
+ ".swo", // Vim swap files
190
+ "~", // Emacs backup files
191
+
192
+ // Generated/minified (not useful for semantic search)
193
+ ".min.js", // Minified JS
194
+ ".min.css", // Minified CSS
195
+ ".bundle.js", // Bundled JS
196
+ ".chunk.js", // Webpack chunks
197
+ ".js.map", // JavaScript source maps
198
+ ".css.map", // CSS source maps
199
+ ".d.ts", // TypeScript declarations (generated, verbose)
200
+ ".d.ts.map", // TypeScript declaration maps
201
+
202
+ // Binary/data files (can't extract meaningful entities)
203
+ ".wasm", // WebAssembly binary
204
+ ".db", // SQLite/database files
205
+ ".sqlite", // SQLite files
206
+ ".sqlite3", // SQLite3 files
207
+
208
+ // Large generated files
209
+ ".snap", // Jest snapshots
210
+ ".eslintcache", // ESLint cache file
211
+ ".tsbuildinfo", // TypeScript incremental build info
212
+ ];
213
+
24
214
  #[derive(Debug)]
25
215
  pub struct IndexStats {
26
216
  pub files_processed: usize,
@@ -148,21 +338,19 @@ impl IndexCommand {
148
338
 
149
339
  fn collect_files(&self) -> Result<Vec<PathBuf>> {
150
340
  info!("Collecting files to index from: {}", self.source_path.display());
341
+ info!("Excluded directories: {} patterns", EXCLUDED_DIRS.len());
342
+ info!("Excluded files: {} patterns", EXCLUDED_FILES.len());
151
343
 
152
344
  let mut files = Vec::new();
153
345
 
154
346
  let walker = WalkDir::new(&self.source_path)
155
347
  .into_iter()
156
348
  .filter_entry(|e| {
157
- let path = e.path();
158
349
  let name = e.file_name().to_string_lossy();
159
350
 
160
- // Exclude build artifacts, dependencies, and temporary files
161
- // Allow .claude and other important hidden folders
162
- match name.as_ref() {
163
- "node_modules" | "target" | "dist" | "build" | ".git" | ".artifacts" => false,
164
- _ => true
165
- }
351
+ // Exclude build artifacts, dependencies, and sensitive directories
352
+ // Allow .claude and other important folders (not in EXCLUDED_DIRS)
353
+ !EXCLUDED_DIRS.contains(&name.as_ref())
166
354
  })
167
355
  .filter_map(|e| e.ok())
168
356
  .filter(|e| {
@@ -174,8 +362,25 @@ impl IndexCommand {
174
362
  return false;
175
363
  }
176
364
 
177
- // Index ALL files regardless of extension
178
- // File type metadata is captured during processing
365
+ let file_name = e.file_name().to_string_lossy();
366
+
367
+ // Exclude sensitive files by exact name match
368
+ if EXCLUDED_FILES.contains(&file_name.as_ref()) {
369
+ return false;
370
+ }
371
+
372
+ // Exclude files by suffix pattern (e.g., ".min.js", ".bak")
373
+ for pattern in EXCLUDED_FILES {
374
+ if pattern.starts_with('.') && file_name.ends_with(pattern) {
375
+ return false;
376
+ }
377
+ }
378
+
379
+ // Exclude emacs backup files ending with ~
380
+ if file_name.ends_with('~') {
381
+ return false;
382
+ }
383
+
179
384
  true
180
385
  });
181
386
 
@@ -187,17 +392,6 @@ impl IndexCommand {
187
392
  Ok(files)
188
393
  }
189
394
 
190
- fn is_hidden(entry: &DirEntry) -> bool {
191
- entry.file_name()
192
- .to_str()
193
- .map(|s| {
194
- if s == ".claude" {
195
- return false;
196
- }
197
- s.starts_with('.')
198
- })
199
- .unwrap_or(false)
200
- }
201
395
 
202
396
  fn process_files(&mut self, files: Vec<PathBuf>) -> Result<IndexStats> {
203
397
  let stats = Arc::new(RwLock::new(IndexStats::default()));
@@ -4,8 +4,8 @@ use std::collections::HashMap;
4
4
  use tracing::info;
5
5
  use serde::{Serialize, Deserialize};
6
6
 
7
- use crate::search_engine::SearchEngine;
8
- use crate::sqlite_store::SqliteStore;
7
+ use crate::store_v2::StoreV2;
8
+ use crate::paths::get_database_path;
9
9
 
10
10
  #[derive(Debug, Clone)]
11
11
  pub enum OutputFormat {
@@ -42,26 +42,26 @@ impl StatsCommand {
42
42
  pub fn execute(&self) -> Result<()> {
43
43
  info!("Gathering statistics");
44
44
 
45
- let search_engine = SearchEngine::new(Path::new(&self.project_dir))?;
46
- let store = SqliteStore::new(&Path::new(&self.project_dir).join(".ruvector/index.db"))?;
45
+ // Use centralized v2 database
46
+ let db_path = get_database_path()?;
47
+ let store = StoreV2::new(&db_path)
48
+ .context("Failed to open centralized database")?;
47
49
 
48
- // Load search engine
49
- let mut engine = search_engine;
50
- engine.load_or_create()?;
51
-
52
- // Get stats from search engine
53
- let index_stats = engine.get_stats();
54
-
55
- // Get stats from database
50
+ // Get stats from v2 database
56
51
  let db_stats = store.get_stats()?;
57
52
 
58
- // Create report
53
+ // Get database file size
54
+ let database_size_bytes = std::fs::metadata(&db_path)
55
+ .map(|m| m.len())
56
+ .unwrap_or(0);
57
+
58
+ // Create report using v2 stats
59
59
  let report = StatsReport {
60
- total_files: db_stats.num_files,
61
- total_embeddings: db_stats.num_embeddings,
62
- total_patterns: index_stats.metadata_count,
63
- index_size_bytes: index_stats.index_size_bytes,
64
- database_size_bytes: db_stats.database_size_bytes,
60
+ total_files: db_stats.files_count,
61
+ total_embeddings: db_stats.embeddings_count,
62
+ total_patterns: db_stats.entities_count, // entities are our "patterns" in v2
63
+ index_size_bytes: 0, // v2 doesn't have separate index file
64
+ database_size_bytes,
65
65
  file_types: HashMap::new(), // TODO: Calculate actual file types
66
66
  };
67
67
 
@@ -1,3 +1,17 @@
1
- import type { TriggerConfig } from "@trigger.dev/sdk/v3";
1
+ export interface TriggerConfig {
2
+ project: string;
3
+ maxDuration: number;
4
+ retries?: {
5
+ enabledInDev?: boolean;
6
+ default?: {
7
+ maxAttempts: number;
8
+ factor: number;
9
+ minTimeoutInMs: number;
10
+ maxTimeoutInMs: number;
11
+ randomize: boolean;
12
+ };
13
+ };
14
+ dirs?: string[];
15
+ }
2
16
  export declare const config: TriggerConfig;
3
17
  //# sourceMappingURL=trigger.config.d.ts.map
@@ -1,6 +1,13 @@
1
+ // ============================================================================
2
+ // DEPRECATION NOTICE
3
+ // ============================================================================
4
+ // Trigger.dev has been removed from the CFN Loop architecture
5
+ // This file is kept for backward compatibility with the SEO platform
6
+ // The SEO functionality will be refactored to use local execution
7
+ // The configuration is no longer used for trigger.dev deployment
8
+ // ============================================================================
1
9
  export const config = {
2
10
  project: process.env.TRIGGER_PROJECT_ID || "proj_uuvpcrkpfruhlpbpzlov",
3
- triggerUrl: process.env.TRIGGER_ENDPOINT || "http://localhost:8030",
4
11
  maxDuration: 600, // 10 minutes in seconds (required)
5
12
  retries: {
6
13
  enabledInDev: true,
@@ -14,4 +21,7 @@ export const config = {
14
21
  },
15
22
  dirs: ["./src/trigger"],
16
23
  };
24
+ // Note: When @trigger.dev/sdk/v3 is installed, update the import to:
25
+ // import type { TriggerConfig } from "@trigger.dev/sdk/v3";
26
+ // Also remove the local interface definition above
17
27
  //# sourceMappingURL=trigger.config.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-flow-novice",
3
- "version": "2.18.15",
3
+ "version": "2.18.16",
4
4
  "description": "Claude Flow Novice - Advanced orchestration platform for multi-agent AI workflows with CFN Loop architecture\n\nIncludes Local RuVector Accelerator and all CFN skills for complete functionality.",
5
5
  "main": "index.js",
6
6
  "type": "module",