Skip to content

The agent that grows with you

fix(desktop): type the onboarding params so tsc accepts them

alt-glitch016511ec7eae
diff --git a/apps/desktop/src/store/onboarding-run.ts b/apps/desktop/src/store/onboarding-run.ts
index 6ad02ad8682..585adc04eed 100644
--- a/apps/desktop/src/store/onboarding-run.ts
+++ b/apps/desktop/src/store/onboarding-run.ts
@@ -37,6 +37,9 @@ export type OnboardingRequest = <T = unknown>(
signal?: AbortSignal
) => Promise<T>
+// The generated param interfaces carry no index signature; the requester's own param type supplies it.
+type RequestParams = NonNullable<Parameters<OnboardingRequest>[1]>
+
// A cold first boot answers onboarding.start late; the intro's way-out offer bounds the wait instead.
// A start with no intro (Settings' Run again) has no way out on screen, so it keeps the request's default deadline.
const NO_DEADLINE = 0
@@ -141,7 +144,7 @@ export async function startOnboarding(
await ensureProfile(ONBOARDING_PROFILE)
const connectionId = activeGatewayConnectionId()
- const params: OnboardingStartParams = {
+ const params: OnboardingStartParams & RequestParams = {
facts_source: factsSource(),
fresh_launch: freshLaunch,
locale: getRuntimeI18nLocale(),
@@ -228,7 +231,7 @@ export function decideOnboarding(
async function readAndStart(request: OnboardingRequest, resume: OnboardingResume, options?: StartOptions): Promise<void> {
try {
- const params: OnboardingStateParams = {}
+ const params: OnboardingStateParams & RequestParams = {}
if (assumeFreshInstall()) {
params.assume_fresh = true