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

Function readWorksetsState

src/core/worksets.ts:224–234  ·  view source on GitHub ↗
(
  options: WorksetPathOptions = {}
)

Source from the content-addressed store, hash-verified

222
223/** Absent file reads as the empty state; a corrupt file throws. */
224export async function readWorksetsState(
225 options: WorksetPathOptions = {}
226): Promise<WorksetsState> {
227 const filePath = getWorksetsFilePath(options);
228
229 if (!(await pathIsFile(filePath))) {
230 return { version: 1, worksets: {} };
231 }
232
233 return parseWorksetsState(await fs.readFile(filePath, 'utf-8'), options);
234}
235
236const worksetsLockError = makeLockErrorFactory({
237 createSubject: 'the worksets lock file',

Callers 4

worksets.test.tsFile · 0.85
listMethod · 0.85
removeMethod · 0.85
withWorksetsLockFunction · 0.85

Calls 4

getWorksetsFilePathFunction · 0.85
pathIsFileFunction · 0.85
parseWorksetsStateFunction · 0.85
readFileMethod · 0.80

Tested by

no test coverage detected