@chappibunny/repolens 1.9.3 → 1.9.4

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 CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  RepoLens scans your repository, generates living architecture documentation, and publishes it to Notion, Confluence, GitHub Wiki, or Markdown — automatically on every push. Engineers get technical docs. Stakeholders get readable system overviews. Nobody writes a word.
19
19
 
20
- > Stable as of v1.0 — [API guarantees](docs/STABILITY.md) · [Security hardened](SECURITY.md) · v1.9.2
20
+ > Stable as of v1.0 — [API guarantees](docs/STABILITY.md) · [Security hardened](SECURITY.md) · v1.9.4
21
21
 
22
22
  ---
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chappibunny/repolens",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "AI-assisted documentation intelligence system for technical and non-technical audiences",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,9 +9,6 @@ import {
9
9
  createArchitectureOverviewPrompt,
10
10
  createDataFlowsPrompt,
11
11
  createDeveloperOnboardingPrompt,
12
- createModuleSummaryPrompt,
13
- createRouteSummaryPrompt,
14
- createAPIDocumentationPrompt,
15
12
  AI_SCHEMAS,
16
13
  renderStructuredToMarkdown,
17
14
  } from "./prompts.js";
@@ -83,7 +80,14 @@ async function generateWithStructuredFallback(key, promptText, maxTokens, fallba
83
80
  return fallbackFn();
84
81
  }
85
82
 
86
- return sanitizeAIOutput(result.text);
83
+ // Guard against empty AI responses — fall back to deterministic
84
+ const text = sanitizeAIOutput(result.text);
85
+ if (!text || text.trim().length === 0) {
86
+ warn("AI returned empty response, using fallback");
87
+ return fallbackFn();
88
+ }
89
+
90
+ return text;
87
91
  }
88
92
 
89
93
  export async function generateExecutiveSummary(context, enrichment = {}, config) {
@@ -98,6 +98,11 @@ export async function generateText({ system, user, temperature, maxTokens, confi
98
98
  return { success: true, text: result, parsed, fallback: false };
99
99
  }
100
100
 
101
+ // Guard against empty responses
102
+ if (!result || (typeof result === "string" && result.trim().length === 0)) {
103
+ return { success: false, error: "AI returned empty response", fallback: true };
104
+ }
105
+
101
106
  return {
102
107
  success: true,
103
108
  text: result,
package/src/migrate.js CHANGED
@@ -136,7 +136,7 @@ async function migrateConfigFile(targetDir, options = {}) {
136
136
  }
137
137
 
138
138
  const filename = path.basename(configPath);
139
- console.log(`\n📄 Checking config: ${filename}`);
139
+ info(`\n📄 Checking config: ${filename}`);
140
140
 
141
141
  const raw = await fs.readFile(configPath, "utf8");
142
142
  let parsed;
@@ -204,8 +204,8 @@ function showDiff(oldContent, newContent) {
204
204
  const newLines = newContent.split("\n");
205
205
  const maxLines = Math.max(oldLines.length, newLines.length);
206
206
 
207
- console.log("\n📋 Changes Preview:");
208
- console.log("─".repeat(60));
207
+ info("\n📋 Changes Preview:");
208
+ info("─".repeat(60));
209
209
 
210
210
  let changesShown = 0;
211
211
  for (let i = 0; i < maxLines; i++) {
@@ -214,20 +214,20 @@ function showDiff(oldContent, newContent) {
214
214
 
215
215
  if (oldLine !== newLine) {
216
216
  if (oldLine) {
217
- console.log(` - ${oldLine}`);
217
+ info(` - ${oldLine}`);
218
218
  }
219
219
  if (newLine) {
220
- console.log(` + ${newLine}`);
220
+ info(` + ${newLine}`);
221
221
  }
222
222
  changesShown++;
223
223
  if (changesShown > 20) {
224
- console.log(` ... (${maxLines - i} more lines)`);
224
+ info(` ... (${maxLines - i} more lines)`);
225
225
  break;
226
226
  }
227
227
  }
228
228
  }
229
229
 
230
- console.log("─".repeat(60));
230
+ info("─".repeat(60));
231
231
  }
232
232
 
233
233
  /**