MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / fetchTemplateReadme

Function fetchTemplateReadme

ui/src/components/workspace/api.ts:146–152  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

144 * Returns null when the template has no README.
145 */
146export async function fetchTemplateReadme(name: string): Promise<string | null> {
147 const res = await fetch(`/api/workspaces/templates/${encodeURIComponent(name)}/readme`);
148 if (res.status === 404) return null;
149 if (!res.ok) throw new Error(`fetch readme failed: ${res.status}`);
150 const raw = await res.text();
151 return stripFrontmatter(raw);
152}
153
154/**
155 * Strip a leading YAML frontmatter block (`---` ... `---`) so the rendered

Callers 1

TemplateDetailPageFunction · 0.90

Calls 2

stripFrontmatterFunction · 0.85
fetchFunction · 0.50

Tested by

no test coverage detected