MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ask

Function ask

graph-ui/tools/handtest-fixes-chat.mjs:200–210  ·  view source on GitHub ↗
(page, question, timeout = 240000)

Source from the content-addressed store, hash-verified

198 return (await page.locator('.cbm-chat-explanation').innerText().catch(() => '')).replace(/\n?Explain again\s*$/, '').trim();
199}
200async function ask(page, question, timeout = 240000) {
201 const before = await page.locator('.cbm-chat-turn').count();
202 const prompt = page.locator('#cbm-chat-prompt');
203 await prompt.click();
204 await prompt.fill(question);
205 await prompt.press('Enter');
206 await page.waitForFunction((count) => document.querySelectorAll('.cbm-chat-turn').length > count, before, { timeout: 30000 }).catch(() => {});
207 await page.waitForFunction(() => !document.querySelector('.cbm-chat-send[aria-label="Stop"]') && !/Thinking…/.test(document.querySelector('.cbm-chat-turn:last-of-type')?.textContent ?? ''), null, { timeout }).catch(() => {});
208 await wait(600);
209 return page.locator('.cbm-chat-turn').last().innerText().catch(() => '');
210}
211const workerMessages = (page) => page.evaluate(() => window.__probeWorker.slice());
212const markWorker = (page) => page.evaluate(() => window.__probeWorker.length);
213const sentSince = async (page, mark, kind = 'chat') => (await workerMessages(page)).slice(mark).filter((entry) => entry.kind === kind);

Callers 9

k15Function · 0.70
k16Function · 0.70
k11Function · 0.70
k17Function · 0.70
k14Function · 0.70
k1Function · 0.70
k12Function · 0.70
k24SituationsFunction · 0.70
k24Function · 0.70

Calls 3

countMethod · 0.80
lastMethod · 0.80
waitFunction · 0.70

Tested by

no test coverage detected