omnius 1.0.35 → 1.0.36
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/index.js +74 -4
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -529408,7 +529408,7 @@ var init_codebaseMap = __esm({
|
|
|
529408
529408
|
topFiles(limit = 15) {
|
|
529409
529409
|
const lim = Math.max(1, Math.min(100, limit));
|
|
529410
529410
|
try {
|
|
529411
|
-
const rows = this.db.prepare(`SELECT path, last_touched_ts, metadata FROM codebase_map_node
|
|
529411
|
+
const rows = this.db.prepare(`SELECT path, last_touched_ts, last_result, metadata FROM codebase_map_node
|
|
529412
529412
|
WHERE repo_fp = ? AND kind = 'file'
|
|
529413
529413
|
ORDER BY last_touched_ts DESC
|
|
529414
529414
|
LIMIT ?`).all(this.repoFp, lim);
|
|
@@ -529421,7 +529421,7 @@ var init_codebaseMap = __esm({
|
|
|
529421
529421
|
count = m2.count;
|
|
529422
529422
|
} catch {
|
|
529423
529423
|
}
|
|
529424
|
-
out.push({ path: r2.path, touchCount: count, lastTs: r2.last_touched_ts });
|
|
529424
|
+
out.push({ path: r2.path, touchCount: count, lastTs: r2.last_touched_ts, lastResult: r2.last_result ?? null });
|
|
529425
529425
|
}
|
|
529426
529426
|
return out;
|
|
529427
529427
|
} catch {
|
|
@@ -529440,7 +529440,7 @@ var init_codebaseMap = __esm({
|
|
|
529440
529440
|
return [];
|
|
529441
529441
|
}
|
|
529442
529442
|
}
|
|
529443
|
-
/** Compact one-line summary
|
|
529443
|
+
/** Compact one-line summary for logs and tests that don't need the full restore block. */
|
|
529444
529444
|
summarize() {
|
|
529445
529445
|
const files = this.topFiles(8);
|
|
529446
529446
|
const tests = this.topTests(5);
|
|
@@ -529448,6 +529448,52 @@ var init_codebaseMap = __esm({
|
|
|
529448
529448
|
const testLine = tests.length > 0 ? tests.map((t2) => `${t2.name.split("/").slice(-1)[0]}=${t2.result}`).join(", ") : "<none>";
|
|
529449
529449
|
return `repo=${this.repoFp} files-touched=${files.length} (top: ${fileLine}); tests-tracked=${tests.length} (recent: ${testLine})`;
|
|
529450
529450
|
}
|
|
529451
|
+
snapshot(restored = { nodes: 0, edges: 0 }, limits = {}) {
|
|
529452
|
+
const topFiles = this.topFiles(limits.files ?? 12);
|
|
529453
|
+
const recentTests = this.topTests(limits.tests ?? 8);
|
|
529454
|
+
return {
|
|
529455
|
+
repoFp: this.repoFp,
|
|
529456
|
+
restoredFiles: restored.nodes,
|
|
529457
|
+
restoredEdges: restored.edges,
|
|
529458
|
+
filesTouched: topFiles.length,
|
|
529459
|
+
testsTracked: recentTests.length,
|
|
529460
|
+
topFiles,
|
|
529461
|
+
recentTests
|
|
529462
|
+
};
|
|
529463
|
+
}
|
|
529464
|
+
/** Human-readable restore block for TUI/Telegram startup memory displays. */
|
|
529465
|
+
formatRestoreSummary(restored) {
|
|
529466
|
+
const snapshot = this.snapshot(restored, { files: 20, tests: 10 });
|
|
529467
|
+
const lines = [
|
|
529468
|
+
"[CODEBASE MEMORY]",
|
|
529469
|
+
"Restored prior codebase map",
|
|
529470
|
+
`repo: ${snapshot.repoFp}`,
|
|
529471
|
+
`files restored: ${snapshot.restoredFiles}`,
|
|
529472
|
+
`edges restored: ${snapshot.restoredEdges}`,
|
|
529473
|
+
`files shown: ${snapshot.filesTouched}`,
|
|
529474
|
+
`tests shown: ${snapshot.testsTracked}`,
|
|
529475
|
+
"",
|
|
529476
|
+
"Top files:"
|
|
529477
|
+
];
|
|
529478
|
+
if (snapshot.topFiles.length === 0) {
|
|
529479
|
+
lines.push(" none");
|
|
529480
|
+
} else {
|
|
529481
|
+
snapshot.topFiles.forEach((file, idx) => {
|
|
529482
|
+
const op = file.lastResult ? `, last ${file.lastResult}` : "";
|
|
529483
|
+
lines.push(` ${idx + 1}. ${file.path} (${file.touchCount} touch${file.touchCount === 1 ? "" : "es"}${op})`);
|
|
529484
|
+
});
|
|
529485
|
+
}
|
|
529486
|
+
lines.push("");
|
|
529487
|
+
lines.push("Recent tests:");
|
|
529488
|
+
if (snapshot.recentTests.length === 0) {
|
|
529489
|
+
lines.push(" none");
|
|
529490
|
+
} else {
|
|
529491
|
+
snapshot.recentTests.forEach((test, idx) => {
|
|
529492
|
+
lines.push(` ${idx + 1}. ${test.name} = ${test.result}`);
|
|
529493
|
+
});
|
|
529494
|
+
}
|
|
529495
|
+
return lines.join("\n");
|
|
529496
|
+
}
|
|
529451
529497
|
/** Stable composite id: `<kind>:<sha16(path)>` so insert ON CONFLICT works. */
|
|
529452
529498
|
idFor(kind, path11) {
|
|
529453
529499
|
const h = createHash14("sha256").update(`${this.repoFp}:${kind}:${path11}`).digest("hex").slice(0, 24);
|
|
@@ -536632,7 +536678,7 @@ Respond with your assessment, then take action.`;
|
|
|
536632
536678
|
if (restored.nodes > 0) {
|
|
536633
536679
|
this.emit({
|
|
536634
536680
|
type: "status",
|
|
536635
|
-
content:
|
|
536681
|
+
content: cm.formatRestoreSummary(restored),
|
|
536636
536682
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
536637
536683
|
});
|
|
536638
536684
|
}
|
|
@@ -600103,6 +600149,27 @@ function sanitizeTelegramProgressText(text, maxLength) {
|
|
|
600103
600149
|
const compact = stripTelegramHiddenThinking(text).replace(/\s+/g, " ").trim();
|
|
600104
600150
|
return compact.length > maxLength ? compact.slice(0, Math.max(0, maxLength - 3)) + "..." : compact;
|
|
600105
600151
|
}
|
|
600152
|
+
function isCodebaseMemoryStatus(text) {
|
|
600153
|
+
return /^\s*\[CODEBASE MEMORY\]/i.test(stripTelegramHiddenThinking(text));
|
|
600154
|
+
}
|
|
600155
|
+
function formatTelegramCodebaseMemoryStatusHTML(text) {
|
|
600156
|
+
const lines = stripTelegramHiddenThinking(text).split(/\r?\n/).map((line) => line.trimEnd()).filter((line) => line.trim().length > 0);
|
|
600157
|
+
const body = lines.filter((line) => !/^\[CODEBASE MEMORY\]/i.test(line));
|
|
600158
|
+
const metricLines = body.filter((line) => /^(repo|files restored|edges restored|files shown|tests shown):/i.test(line));
|
|
600159
|
+
const detailLines = body.filter((line) => !metricLines.includes(line) && !/^Restored prior codebase map$/i.test(line));
|
|
600160
|
+
const details = detailLines.length > 0 ? detailLines.join("\n") : "No file or test details restored.";
|
|
600161
|
+
const metrics2 = metricLines.map((line) => {
|
|
600162
|
+
const idx = line.indexOf(":");
|
|
600163
|
+
const key = idx >= 0 ? line.slice(0, idx) : line;
|
|
600164
|
+
const value2 = idx >= 0 ? line.slice(idx + 1).trim() : "";
|
|
600165
|
+
return `${escapeTelegramHTML(key)}: <code>${escapeTelegramHTML(value2)}</code>`;
|
|
600166
|
+
});
|
|
600167
|
+
return [
|
|
600168
|
+
"<b>Codebase memory restored</b>",
|
|
600169
|
+
metrics2.join("\n"),
|
|
600170
|
+
`<blockquote expandable>${escapeTelegramHTML(details)}</blockquote>`
|
|
600171
|
+
].filter(Boolean).join("\n");
|
|
600172
|
+
}
|
|
600106
600173
|
function compactTelegramVisibleText(text) {
|
|
600107
600174
|
return stripTelegramHiddenThinking(text).replace(/\s+/g, " ").trim();
|
|
600108
600175
|
}
|
|
@@ -600368,6 +600435,9 @@ function formatTelegramProgressEvent(event) {
|
|
|
600368
600435
|
return event.success ? `${toolName} completed` : `${toolName} failed`;
|
|
600369
600436
|
}
|
|
600370
600437
|
if (event.type === "status") {
|
|
600438
|
+
if (isCodebaseMemoryStatus(event.content || "")) {
|
|
600439
|
+
return formatTelegramCodebaseMemoryStatusHTML(event.content || "");
|
|
600440
|
+
}
|
|
600371
600441
|
const content = sanitizeTelegramProgressText(event.content || "", 120);
|
|
600372
600442
|
if (isTelegramInternalStatusText(content)) return null;
|
|
600373
600443
|
return content ? escapeTelegramHTML(content) : null;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.36",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.36",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED