MCPcopy Create free account
hub / github.com/Noumena-Network/code / findHighestTaskId

Function findHighestTaskId

src/utils/tasks.ts:272–278  ·  view source on GitHub ↗

* Finds the highest task ID ever assigned, considering both existing files * and the high water mark (for deleted/reset tasks).

(taskListId: string)

Source from the content-addressed store, hash-verified

270 * and the high water mark (for deleted/reset tasks).
271 */
272async function findHighestTaskId(taskListId: string): Promise<number> {
273 const [fromFiles, fromMark] = await Promise.all([
274 findHighestTaskIdFromFiles(taskListId),
275 readHighWaterMark(taskListId),
276 ])
277 return Math.max(fromFiles, fromMark)
278}
279
280/**
281 * Creates a new task with a unique ID.

Callers 1

createTaskFunction · 0.85

Calls 3

readHighWaterMarkFunction · 0.85
maxMethod · 0.80

Tested by

no test coverage detected