Middleware that createDeepAgent mounts only when the corresponding option
is passed, expressed at the type level so the agent's state reflects it.
skills mounts SkillsMiddleware, which contributes skillsMetadata to
state. Callers therefore get skillsMetadata on invoke/updateState
purely from skills: [...], with no need to mount the middleware manually.
Mirrors the runtime condition skills != null && skills.length > 0: an
omitted option or an empty literal (skills: []) mounts nothing and
contributes no state. A non-literal string[] has no statically known
length, so it is treated as mounting the middleware.
InferOptionalMiddleware: [TSkills] extends [undefined] readonly [] : [TSkills] extends [readonly []] readonly [] : readonly [SkillsMiddleware]