@mastra/core
Version:
36 lines • 1.6 kB
TypeScript
import type { MastraLanguageModel } from '../../llm/model/shared.types.js';
import type { RunProcessInputStepResult } from '../../processors/index.js';
/**
* Shape of the per-step LLM input fields that an input-processor (or
* `prepareStep`) is allowed to override.
*
* Note: this interface lists the canonical fields, but the helper preserves
* any additional properties on the current step (e.g. `workspace` from
* `PrepareStepResult`) by spreading `current` first.
*/
export interface StepInputFields {
messageId: string;
model: MastraLanguageModel;
tools?: any;
toolChoice?: any;
activeTools?: string[] | undefined;
providerOptions?: any;
modelSettings?: any;
structuredOutput?: any;
[key: string]: any;
}
/**
* Merge an input-step processor result back into the current step. Mirrors
* the regular agentic-execution step's `Object.assign(currentStep, ...)`
* semantics so the durable and non-durable paths apply `prepareStep` and
* other input processors identically.
*
* Fields that the runner did not touch are preserved verbatim; fields the
* runner did touch fully replace the current value. `modelSettings` is
* intentionally replaced rather than shallow-merged — that matches the
* non-durable path and matches the contract documented on processor
* results, where the returned `modelSettings` is the final shape for this
* step.
*/
export declare function composeStepInput(current: StepInputFields, processInputStepResult: RunProcessInputStepResult | undefined): StepInputFields;
//# sourceMappingURL=compose-step-input.d.ts.map