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

Function updateWorksetsState

src/core/worksets.ts:243–255  ·  view source on GitHub ↗
(
  updater: (state: WorksetsState) => WorksetsState | Promise<WorksetsState>,
  options: WorksetPathOptions = {}
)

Source from the content-addressed store, hash-verified

241});
242
243export async function updateWorksetsState(
244 updater: (state: WorksetsState) => WorksetsState | Promise<WorksetsState>,
245 options: WorksetPathOptions = {}
246): Promise<WorksetsState> {
247 return withWorksetsLock(async (state) => {
248 const next = await updater(state);
249 await writeFileAtomically(
250 getWorksetsFilePath(options),
251 serializeWorksetsState(next, options)
252 );
253 return next;
254 }, options);
255}
256
257/**
258 * Lock-scoped read without a write-back of the saved-views file.

Callers 2

worksets.test.tsFile · 0.85
createMethod · 0.85

Calls 4

withWorksetsLockFunction · 0.85
writeFileAtomicallyFunction · 0.85
getWorksetsFilePathFunction · 0.85
serializeWorksetsStateFunction · 0.85

Tested by

no test coverage detected