MCPcopy Create free account
hub / github.com/garrytan/gstack / handleMemoryCommand

Function handleMemoryCommand

browse/src/memory-command.ts:103–109  ·  view source on GitHub ↗
(args: string[], bm: BrowserManager)

Source from the content-addressed store, hash-verified

101}
102
103export async function handleMemoryCommand(args: string[], bm: BrowserManager): Promise<string> {
104 const jsonMode = args.includes('--json');
105 const structures = collectStructureStats();
106 const snapshot = await bm.getMemorySnapshot(structures);
107 if (jsonMode) return JSON.stringify(snapshot);
108 return formatSnapshotText(snapshot);
109}
110
111/** Entry point used by the /memory HTTP endpoint — same data, always JSON. */
112export async function buildMemorySnapshotJson(bm: BrowserManager): Promise<MemorySnapshot> {

Callers 2

handleMetaCommandFunction · 0.85

Calls 3

collectStructureStatsFunction · 0.85
formatSnapshotTextFunction · 0.85
getMemorySnapshotMethod · 0.80

Tested by

no test coverage detected