| @@ -61,7 +61,7 @@ type SourceProgressState = { · 60 unmodified lines |
| 61 | 61 | function progressStepStates(sourceType: ToolSourceRecord["type"], progress?: SourceProgressState) { |
| 62 | 62 | const isOpenApi = sourceType === "openapi"; |
| 63 | 63 | const labels = isOpenApi |
| 64 | | − ? ["Download spec", "Extract operations", "Index tools"] |
| 64 | + ? ["Downloading & Extracting Operations", "Index tools"] |
| 65 | 65 | : ["Connect", "Discover tools", "Index tools"]; |
| 66 | 66 | |
| 67 | 67 | const defaultSteps = labels.map((label, index) => ({ |
| @@ -80,24 +80,23 @@ function progressStepStates(sourceType: ToolSourceRecord["type"], progress?: Sou · 12 unmodified lines |
| 80 | 80 | |
| 81 | 81 | if (progress.state === "indexing") { |
| 82 | 82 | return defaultSteps.map((step) => { |
| 83 | | − if (step.id < 3) return { ...step, status: "done" as const }; |
| 84 | | − return { ...step, status: "active" as const }; |
| 83 | + if (step.id === 1) return { ...step, status: "done" as const }; |
| 84 | + if (step.id === 2) return { ...step, status: "active" as const }; |
| 85 | + return step; |
| 85 | 86 | }); |
| 86 | 87 | } |
| 87 | 88 | |
| 88 | 89 | if (progress.state === "loading") { |
| 89 | | − const message = progress.message?.toLowerCase() ?? ""; |
| 90 | | − const activeStep = message.includes("download") ? 1 : 2; |
| 91 | 90 | return defaultSteps.map((step) => { |
| 92 | | − if (step.id < activeStep) return { ...step, status: "done" as const }; |
| 93 | | − if (step.id === activeStep) return { ...step, status: "active" as const }; |
| 91 | + if (step.id === 1) return { ...step, status: "active" as const }; |
| 94 | 92 | return step; |
| 95 | 93 | }); |
| 96 | 94 | } |
| 97 | 95 | |
| 98 | 96 | if (progress.state === "failed") { |
| 99 | | − const message = progress.message?.toLowerCase() ?? ""; |
| 100 | | − const failedStep = message.includes("index") ? 3 : message.includes("download") ? 1 : 2; |
| 97 | + const failedStep = sourceType === "openapi" |
| 98 | + ? (typeof progress.processedTools === "number" && progress.toolCount > 0 ? 2 : 1) |
| 99 | + : (progress.message?.toLowerCase().includes("index") ? 3 : 2); |
| 101 | 100 | return defaultSteps.map((step) => { |
| 102 | 101 | if (step.id < failedStep) return { ...step, status: "done" as const }; |
| 103 | 102 | if (step.id === failedStep) return { ...step, status: "failed" as const }; |