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

Function readOneIssue

src/workspaces/issues/declaration.ts:177–191  ·  view source on GitHub ↗
(
  path: string,
  id: string,
)

Source from the content-addressed store, hash-verified

175}
176
177async function readOneIssue(
178 path: string,
179 id: string,
180): Promise<{ ok: true; issue: IssueRecord } | { ok: false; error: string }> {
181 let raw: string
182 try {
183 const info = await stat(path)
184 if (info.size > MAX_BYTES) return { ok: false, error: `issue file too large (${info.size} bytes)` }
185 raw = await readFile(path, 'utf8')
186 } catch (err) {
187 return { ok: false, error: err instanceof Error ? err.message : String(err) }
188 }
189
190 return parseIssueContent(id, raw)
191}
192
193/**
194 * Pure parse of one issue's file content (frontmatter + body) into a validated

Callers 1

readWorkspaceIssuesFunction · 0.85

Calls 1

parseIssueContentFunction · 0.85

Tested by

no test coverage detected