We are currently at beta version of v1, I wanted to perform update to the stable but I found out that there is possible regression regarding RequestContext type.
When I'm trying to pass a typed request context:
new RequestContext<EnvironmentSettingsContext>
new RequestContext<EnvironmentSettingsContext>
into
const run = await mastra.getWorkflow(workflowId).createRun();const stream = run.stream({...other propertiesrequestContext: ...})
const run = await mastra.getWorkflow(workflowId).createRun();const stream = run.stream({...other propertiesrequestContext: ...})
Typescript throws error that:
TS2322: Type RequestContext<EnvironmentSettingsContext> is not assignable to type RequestContext<unknown>Type unknown is not assignable to type EnvironmentSettingsContextworkflow.d.ts(500, 9): The expected type comes from property requestContext which is declared here on type{ inputData?: { analysisType: "overview" | "detailed" | "sentiment"; maxReviews: number; language: string; region: string; locale: string; companyName?: string | undefined; location?: string | undefined; businessQuery?: string | undefined; } | undefined; } & ... 5 more ... & { ...; }
TS2322: Type RequestContext<EnvironmentSettingsContext> is not assignable to type RequestContext<unknown>Type unknown is not assignable to type EnvironmentSettingsContextworkflow.d.ts(500, 9): The expected type comes from property requestContext which is declared here on type{ inputData?: { analysisType: "overview" | "detailed" | "sentiment"; maxReviews: number; language: string; region: string; locale: string; companyName?: string | undefined; location?: string | undefined; businessQuery?: string | undefined; } | undefined; } & ... 5 more ... & { ...; }
Is that on purpose? If so, how it should be properly handled?