Applies auto-alignment rules to includeResponseTypeDefinition based on documentation
and capability flags on params.
OptionalexplicitResponseType: Record<string, unknown>Assembles the outgoing message array for a single LLM request under 'trailingMessage'
runtime-state placement: escapes literal <mj-runtime-state> tags in non-system history
messages and appends the fresh volatile-state fragment last.
Builds the current application context markdown section from extraData.appContext.
OptionalextraData: Record<string, unknown>Builds the client tool prompt section for system prompt injection across static,
session, app, and override tiers (override > session > app > static).
OptionalextraData: Record<string, unknown>Builds the serialized <mj-runtime-state> XML block from resolved date/time, scratchpad,
payload, and optional relocated specialization.
Returns true when the driver serving model on vendor binds replayed reasoning
to the unchanged history prefix before it.
Extracts default values from an agent type's JSON Schema PromptParamsSchema.
Formats action details as compact markdown for inclusion in prompt context. Produces ~75% fewer tokens than the previous JSON format while preserving all information the LLM needs to invoke actions correctly.
A parameter the run binds (ExecuteAgentParams.boundActionParams) is left out, so the model is
never told it exists. With no bindings the output is the cached catalog's, unchanged.
OptionalboundActionParams: BoundActionParamsFormats a single action parameter as a compact inline markdown string.
Uses \* suffix for required, (array) when IsArray, and only shows
ValueType when it is not Scalar/Other.
Formats the skill CATALOG as compact markdown — name + description ONLY. This is
progressive disclosure by design: the LLM sees just enough to decide whether to activate a
skill (via a 'Skill' next step), but never sees Instructions until it does.
Formats sub-agent details as compact markdown for inclusion in prompt context.
Reads scratchpad notes, tasks, and task summary from prepared prompt template data (so the fragment shows exactly what the template would have). Null when the scratchpad is disabled or absent.
Resolves the client tools in force for a run: the agent's static metadata tools under the session, app, and override tiers, merged by ResolveClientTools with its fixed precedence. Both the prompt section and the client-tool execution step resolve through here so the tools offered to the model and the metadata its results are classified against come from one list.
OptionalextraData: Record<string, unknown>Resolves the three temporal placeholders (_CURRENT_DATE, _CURRENT_DAY_OF_WEEK, _CURRENT_TIME)
for the trailing runtime-state fragment. Resolves only the three temporal placeholders (by name,
through the same registry the template uses, so a registered override applies here too) rather
than every system placeholder — this runs on every loop iteration.
OptionalonError: (error: string | Error, placeholderName: string) => voidDetermines whether model (as served by vendor) sits behind a byte-prefix prompt cache
(LLM.PrefixPromptCache), read from the model catalog's ModelConfiguration cascade —
AIModelType < AIModel < AIVendor.Configuration.ModelDefaults < AIModelVendor — via
AIEngine.GetEffectiveModelConfiguration. The most specific layer is the INFERENCE-PROVIDER
model-vendor row for vendor, whose vendor row supplies the host-wide default that beats the
model's own bag; when the vendor is unknown, or has no inference row for this model, the model
and type layers still answer. False when no layer declares it, which callers
treat as a block cache (replace-in-place).
Returns true when unrendered template text contains any volatile state marker (indicating the template still embeds volatile state directly).
Coordinates prompt context assembly, catalog markdown generation, and cache-preserving
<mj-runtime-state>trailing message construction forBaseAgent.