scai 0.1.60 → 0.1.61

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/config.js CHANGED
@@ -91,9 +91,7 @@ export const Config = {
91
91
  // Ensure repoKey doesn't contain an absolute path, only the repo name or a relative path
92
92
  const scaiRepoRoot = path.join(SCAI_REPOS, path.basename(repoKey)); // Use repo name as key to avoid double paths
93
93
  // Set the active repo to the provided indexDir
94
- const cfg = readConfig();
95
- cfg.activeRepo = repoKey;
96
- await writeConfig(cfg); // Persist the change in activeRepo
94
+ this.setActiveRepo(scaiRepoRoot);
97
95
  // Call setRepoIndexDir to update the repo's indexDir and other settings
98
96
  await this.setRepoIndexDir(scaiRepoRoot, absPath); // Set the indexDir for the repo
99
97
  // Ensure base folders exist
@@ -103,7 +101,7 @@ export const Config = {
103
101
  // Init DB if not exists
104
102
  const dbPath = path.join(scaiRepoRoot, 'db.sqlite');
105
103
  if (!fs.existsSync(dbPath)) {
106
- console.log(`Database not found. Initializing DB at ${normalizePath(dbPath)}`);
104
+ console.log(`šŸ“¦ Database not found. ${chalk.green('Initializing DB')} at ${normalizePath(dbPath)}`);
107
105
  getDbForRepo(); // Now DB creation works after config update
108
106
  }
109
107
  console.log(`āœ… Index directory set to: ${normalizePath(absPath)}`);
@@ -129,7 +127,7 @@ export const Config = {
129
127
  },
130
128
  setActiveRepo(repoKey) {
131
129
  const cfg = readConfig();
132
- cfg.activeRepo = repoKey;
130
+ cfg.activeRepo = normalizePath(repoKey);
133
131
  writeConfig(cfg);
134
132
  console.log(`āœ… Active repo switched to: ${repoKey}`);
135
133
  },
@@ -207,20 +207,20 @@ randomFunctions.forEach(row => {
207
207
  console.log(` ${row.preview}\n`);
208
208
  });
209
209
  // === Column View of 100 Files ===
210
- console.log('\nšŸ“Š Table View: First 100 Files');
210
+ console.log('\nšŸ“Š Table View: First 500 Files');
211
211
  console.log('-------------------------------------------');
212
212
  const fileRows = db.prepare(`
213
213
  SELECT id, filename, type, processing_status, functions_extracted_at, length(summary) AS summary_len
214
214
  FROM files
215
- LIMIT 1000
215
+ LIMIT 500
216
216
  `).all();
217
217
  console.table(fileRows);
218
218
  // === Column View of 100 Functions ===
219
- console.log('\nšŸ“Š Table View: First 100 Functions');
219
+ console.log('\nšŸ“Š Table View: First 500 Functions');
220
220
  console.log('-------------------------------------------');
221
221
  const functionRows = db.prepare(`
222
222
  SELECT id, file_id, name, start_line, end_line, length(content) AS length
223
223
  FROM functions
224
- LIMIT 1000
224
+ LIMIT 500
225
225
  `).all();
226
226
  console.table(functionRows);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scai",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "scai": "./dist/index.js"