mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-09-13 04:04:09 +00:00
* feat(explorer): add Markdown editing write path * fix(explorer): address markdown editor review findings * feat(explorer): add Markdown editor write path --------- Co-authored-by: Sameer Kadam <sskadam6305@gmail.com>
25 lines
511 B
TypeScript
25 lines
511 B
TypeScript
type Fetcher = (
|
|
input: RequestInfo | URL,
|
|
init?: RequestInit,
|
|
) => Promise<Response>;
|
|
|
|
type ExplorerInfo = {
|
|
capabilities?: {
|
|
agent_memory?: boolean;
|
|
};
|
|
};
|
|
|
|
export async function fetchAgentMemoryAvailability(
|
|
fetcher: Fetcher = fetch,
|
|
): Promise<boolean> {
|
|
try {
|
|
const response = await fetcher('/api/info');
|
|
if (!response.ok) return false;
|
|
|
|
const info = await response.json() as ExplorerInfo;
|
|
return info.capabilities?.agent_memory === true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|