refactor: align status with plugin memory slot

This commit is contained in:
Peter Steinberger
2026-01-18 04:29:34 +00:00
parent 154d4a43db
commit b7575a889e
4 changed files with 124 additions and 16 deletions

View File

@@ -65,6 +65,7 @@ export async function statusCommand(
channels,
summary,
memory,
memoryPlugin,
} = scan;
const securityAudit = await withProgress(
@@ -116,6 +117,7 @@ export async function statusCommand(
os: osSummary,
update,
memory,
memoryPlugin,
gateway: {
mode: gatewayMode,
url: gatewayConnection.url,
@@ -235,11 +237,19 @@ export async function statusCommand(
: (summary.sessions.paths[0] ?? "unknown");
const memoryValue = (() => {
if (!memory) return muted("disabled");
if (!memoryPlugin.enabled) {
const suffix = memoryPlugin.reason ? ` (${memoryPlugin.reason})` : "";
return muted(`disabled${suffix}`);
}
if (!memory) {
const slot = memoryPlugin.slot ? `plugin ${memoryPlugin.slot}` : "plugin";
return muted(`enabled (${slot}) · unavailable`);
}
const parts: string[] = [];
const dirtySuffix = memory.dirty ? ` · ${warn("dirty")}` : "";
parts.push(`${memory.files} files · ${memory.chunks} chunks${dirtySuffix}`);
if (memory.sources?.length) parts.push(`sources ${memory.sources.join(", ")}`);
if (memoryPlugin.slot) parts.push(`plugin ${memoryPlugin.slot}`);
const vector = memory.vector;
parts.push(
vector?.enabled === false