MCPcopy
hub / github.com/Fission-AI/OpenSpec / serializeStoreMetadataState

Function serializeStoreMetadataState

src/core/store/foundation.ts:270–287  ·  view source on GitHub ↗
(state: StoreMetadataState)

Source from the content-addressed store, hash-verified

268}
269
270export function serializeStoreMetadataState(state: StoreMetadataState): string {
271 const result = MetadataStateSchema.safeParse(state);
272
273 if (!result.success) {
274 throw invalidStoreStateError(
275 'store metadata state',
276 formatZodIssues(result.error)
277 );
278 }
279
280 validateStoreId(result.data.id);
281
282 return stringifyYaml({
283 version: 1,
284 id: result.data.id,
285 ...(result.data.remote !== undefined ? { remote: result.data.remote } : {}),
286 });
287}
288
289export function listStoreRegistryEntries(
290 registry: StoreRegistryState

Callers 3

foundation.test.tsFile · 0.85
writeStoreMetadataStateFunction · 0.85

Calls 3

invalidStoreStateErrorFunction · 0.85
formatZodIssuesFunction · 0.85
validateStoreIdFunction · 0.85

Tested by

no test coverage detected