fix: type non-interactive onboard prompter · openclaw/openclaw@755fa16
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,11 +11,12 @@ import { runNonInteractiveRemoteSetup } from "./onboard-non-interactive/remote.j
|
11 | 11 | import type { OnboardOptions } from "./onboard-types.js"; |
12 | 12 | |
13 | 13 | function createNonInteractiveMigrationPrompter(runtime: RuntimeEnv): WizardPrompter { |
14 | | -const unavailable = (message: string): never => { |
15 | | -throw new Error( |
16 | | -`Non-interactive migration import needs explicit flags before prompting: ${message}`, |
| 14 | +const unavailable = <T>(message: string): Promise<T> => |
| 15 | +Promise.reject( |
| 16 | +new Error( |
| 17 | +`Non-interactive migration import needs explicit flags before prompting: ${message}`, |
| 18 | +), |
17 | 19 | ); |
18 | | -}; |
19 | 20 | return { |
20 | 21 | async intro(title) { |
21 | 22 | runtime.log(title); |
@@ -26,17 +27,17 @@ function createNonInteractiveMigrationPrompter(runtime: RuntimeEnv): WizardPromp
|
26 | 27 | async note(message, title) { |
27 | 28 | runtime.log(title ? `${title}\n${message}` : message); |
28 | 29 | }, |
29 | | -async select(params) { |
30 | | -unavailable(params.message); |
| 30 | +select(params) { |
| 31 | +return unavailable(params.message); |
31 | 32 | }, |
32 | | -async multiselect(params) { |
33 | | -unavailable(params.message); |
| 33 | +multiselect(params) { |
| 34 | +return unavailable(params.message); |
34 | 35 | }, |
35 | | -async text(params) { |
36 | | -unavailable(params.message); |
| 36 | +text(params) { |
| 37 | +return unavailable(params.message); |
37 | 38 | }, |
38 | | -async confirm(params) { |
39 | | -unavailable(params.message); |
| 39 | +confirm(params) { |
| 40 | +return unavailable(params.message); |
40 | 41 | }, |
41 | 42 | progress(label) { |
42 | 43 | runtime.log(label); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。