| 24 | } |
| 25 | |
| 26 | function 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? |
| 40 | export interface UseExtensionHostOptions extends ExtensionHostOptions { |