tech-debt-visualizer 0.2.11 → 0.2.13

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.
@@ -316,15 +316,87 @@ body.dashboard-page {
316
316
 
317
317
  .overlay-body {
318
318
  padding: 1rem;
319
- overflow: auto;
319
+ overflow: hidden;
320
320
  flex: 1;
321
321
  min-height: 0;
322
+ display: flex;
323
+ flex-direction: column;
324
+ gap: 1rem;
322
325
  }
323
326
 
324
- .overlay-placeholder {
327
+ .overlay-plan-mode {
325
328
  margin: 0;
326
329
  font-size: 13px;
327
- color: var(--text-muted);
330
+ color: var(--text);
331
+ padding: 0.6rem 0.75rem;
332
+ background: rgba(87, 148, 242, 0.1);
333
+ border: 1px solid var(--link);
334
+ border-radius: var(--radius);
335
+ flex-shrink: 0;
336
+ }
337
+
338
+ .overlay-plan-mode strong {
339
+ color: var(--link);
340
+ }
341
+
342
+ .overlay-prompt-wrap {
343
+ flex: 1;
344
+ min-height: 0;
345
+ overflow: auto;
346
+ -webkit-overflow-scrolling: touch;
347
+ background: var(--bg);
348
+ border: 1px solid var(--border);
349
+ border-radius: var(--radius);
350
+ padding: 0.75rem 1rem;
351
+ }
352
+
353
+ .overlay-prompt-text {
354
+ margin: 0;
355
+ font-size: 12px;
356
+ line-height: 1.5;
357
+ color: var(--text);
358
+ white-space: pre-wrap;
359
+ word-break: break-word;
360
+ font-family: ui-monospace, "SF Mono", Consolas, monospace;
361
+ }
362
+
363
+ .btn-copy-prompt {
364
+ display: inline-flex;
365
+ align-items: center;
366
+ justify-content: center;
367
+ gap: 0.5rem;
368
+ font: inherit;
369
+ font-size: 15px;
370
+ font-weight: 600;
371
+ padding: 0.75rem 1.25rem;
372
+ background: var(--link);
373
+ color: #fff;
374
+ border: none;
375
+ border-radius: var(--radius);
376
+ cursor: pointer;
377
+ flex-shrink: 0;
378
+ transition: background 0.15s ease, transform 0.1s ease;
379
+ }
380
+
381
+ .btn-copy-prompt:hover {
382
+ background: #6ba3f7;
383
+ }
384
+
385
+ .btn-copy-prompt:active {
386
+ transform: scale(0.98);
387
+ }
388
+
389
+ .btn-copy-prompt.copied {
390
+ background: var(--tier-5);
391
+ }
392
+
393
+ .btn-copy-icon {
394
+ display: inline-flex;
395
+ line-height: 0;
396
+ }
397
+
398
+ .btn-copy-icon svg {
399
+ display: block;
328
400
  }
329
401
 
330
402
  /* ——— Panels: borders, colored accents ——— */
@@ -321,7 +321,67 @@ function showDetail(file, items) {
321
321
  };
322
322
  }
323
323
 
324
+ function buildAiCleanupPrompt() {
325
+ var overall = "";
326
+ if (DATA.llmOverallAssessment) {
327
+ overall = stripTrailingSeverityAndScore(DATA.llmOverallAssessment);
328
+ } else if (DATA.llmOverallRaw) {
329
+ overall = stripTrailingSeverityAndScore(DATA.llmOverallRaw);
330
+ }
331
+ var files = DATA.fileMetrics.filter(function (m) {
332
+ return m.llmSeverity && m.llmSeverity !== "none";
333
+ });
334
+ var parts = [];
335
+ parts.push("We are trying to reduce the technical debt of this repository.");
336
+ if (overall && overall.trim()) {
337
+ parts.push("");
338
+ parts.push("Overall assessment:");
339
+ parts.push(overall.trim());
340
+ parts.push("");
341
+ }
342
+ parts.push("The following files have been identified with fixes that are necessary:");
343
+ parts.push("");
344
+ files.forEach(function (m) {
345
+ parts.push(m.file);
346
+ var explanation = (m.llmRawAssessment || m.llmAssessment || "").trim();
347
+ if (explanation) explanation = stripTrailingSeverityAndScore(explanation);
348
+ parts.push(explanation || "(No explanation provided.)");
349
+ parts.push("");
350
+ });
351
+ parts.push("With those files and explanations of them in mind, lets change them to be better structured. Look at the whole codebase and those specific files for reference. Clean up anything you see might need to also be cleaned up outside of those descriptions, but mainly focus on the identified files. Keep the functionality EXACTLY THE SAME, and ensure it is the same.");
352
+ return parts.join("\n");
353
+ }
354
+
324
355
  (function () {
356
+ var promptEl = document.getElementById("aiPromptsText");
357
+ if (promptEl) promptEl.textContent = buildAiCleanupPrompt();
358
+
359
+ var copyBtn = document.getElementById("copyAiPrompts");
360
+ if (copyBtn && promptEl) {
361
+ copyBtn.addEventListener("click", function () {
362
+ var text = promptEl.textContent || "";
363
+ if (!text) return;
364
+ navigator.clipboard.writeText(text).then(
365
+ function () {
366
+ var label = copyBtn.querySelector(".btn-copy-label");
367
+ if (label) {
368
+ var orig = label.textContent;
369
+ label.textContent = "Copied!";
370
+ copyBtn.classList.add("copied");
371
+ setTimeout(function () {
372
+ label.textContent = orig;
373
+ copyBtn.classList.remove("copied");
374
+ }, 2000);
375
+ }
376
+ },
377
+ function () {
378
+ var label = copyBtn.querySelector(".btn-copy-label");
379
+ if (label) label.textContent = "Copy failed";
380
+ }
381
+ );
382
+ });
383
+ }
384
+
325
385
  var btn = document.getElementById("btnAiPrompts");
326
386
  var overlay = document.getElementById("aiPromptsOverlay");
327
387
  var closeBtn = document.getElementById("closeAiPrompts");
@@ -193,7 +193,14 @@ function buildHtml(run, title, darkMode, css, script) {
193
193
  <button type="button" class="overlay-close" id="closeAiPrompts" aria-label="Close">&times;</button>
194
194
  </div>
195
195
  <div class="overlay-body">
196
- <p class="overlay-placeholder">Prompts to pass into AI for cleaning up the codebase will appear here.</p>
196
+ <p class="overlay-plan-mode">Give this prompt to a <strong>PLAN MODE</strong> AI or coding agent (e.g. plan mode in your IDE).</p>
197
+ <div class="overlay-prompt-wrap">
198
+ <pre id="aiPromptsText" class="overlay-prompt-text"></pre>
199
+ </div>
200
+ <button type="button" class="btn-copy-prompt" id="copyAiPrompts" aria-label="Copy prompt">
201
+ <span class="btn-copy-icon" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg></span>
202
+ <span class="btn-copy-label">Copy prompt</span>
203
+ </button>
197
204
  </div>
198
205
  </div>
199
206
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tech-debt-visualizer",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "description": "Language-agnostic CLI that analyzes repos and generates interactive technical debt visualizations with AI-powered insights",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",