Spaces:
Sleeping
Sleeping
Download lib/work-package-ui.ts from TigerHatKth/CoDEVX: direct link, hf CLI and curl.
- Browser
- Download file 768 Bytes
-
https://huggingface.co/spaces/TigerHatKth/CoDEVX/resolve/main/lib/work-package-ui.ts
- Command line
-
hf download hf://spaces/TigerHatKth/CoDEVX/lib/work-package-ui.ts
-
curl -L -o work-package-ui.ts https://huggingface.co/spaces/TigerHatKth/CoDEVX/resolve/main/lib/work-package-ui.ts
768 Bytes
| import type { WorkPackage } from "./work-package-types"; | |
| export type WorkPackageVisualState = "idle" | "running" | "done"; | |
| export function getWorkPackageVersion(workPackage: WorkPackage) { | |
| if (!workPackage.outputs.length) return undefined; | |
| return `v${workPackage.outputs.length}`; | |
| } | |
| export function getWorkPackageVisualState(args: { | |
| workPackage: WorkPackage; | |
| activeWorkPackageId?: string; | |
| }) { | |
| const { workPackage, activeWorkPackageId } = args; | |
| if (activeWorkPackageId && workPackage.id === activeWorkPackageId) { | |
| return "running" satisfies WorkPackageVisualState; | |
| } | |
| if (workPackage.status === "done" && workPackage.outputs.length) { | |
| return "done" satisfies WorkPackageVisualState; | |
| } | |
| return "idle" satisfies WorkPackageVisualState; | |
| } | |