MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / readImportMeta

Function readImportMeta

apps/vis/server/src/lib/import-store.ts:107–118  ·  view source on GitHub ↗
(home: string, importId: string)

Source from the content-addressed store, hash-verified

105}
106
107export async function readImportMeta(home: string, importId: string): Promise<ImportInfo | null> {
108 try {
109 const raw = await readFile(join(importedDirOf(home, importId), META_FILE), 'utf8');
110 const meta = JSON.parse(raw) as ImportInfo;
111 // The sidecar is vis-written, but re-sanitize the manifest in case the
112 // imported directory was hand-edited, so a corrupt type cannot reach the
113 // session list and crash the UI.
114 return { ...meta, manifest: meta.manifest ? sanitizeManifest(meta.manifest) : null };
115 } catch {
116 return null;
117 }
118}
119
120export async function deleteImported(home: string, importId: string): Promise<boolean> {
121 if (!isImportId(importId)) return false;

Callers 3

listSessionsFunction · 0.90
readImportedDetailFunction · 0.90

Calls 3

importedDirOfFunction · 0.85
sanitizeManifestFunction · 0.85
readFileFunction · 0.50

Tested by

no test coverage detected