MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getMostRecentTaskId

Function getMostRecentTaskId

apps/cli/src/ui/hooks/useExtensionHost.ts:26–37  ·  view source on GitHub ↗
(taskHistory: HistoryItem[], workspacePath: string)

Source from the content-addressed store, hash-verified

24}
25
26function getMostRecentTaskId(taskHistory: HistoryItem[], workspacePath: string): string | undefined {
27 const workspaceTasks = taskHistory.filter(
28 (item) => typeof item.workspace === "string" && arePathsEqual(item.workspace, workspacePath),
29 )
30
31 if (workspaceTasks.length === 0) {
32 return undefined
33 }
34
35 const sorted = [...workspaceTasks].sort((a, b) => b.ts - a.ts)
36 return sorted[0]?.id
37}
38
39// TODO: Unify with TUIAppProps?
40export interface UseExtensionHostOptions extends ExtensionHostOptions {

Callers 1

initFunction · 0.85

Calls 1

arePathsEqualFunction · 0.50

Tested by

no test coverage detected