package skill import ( "time" "gitea.stevedudenhoeffer.com/steve/executus/run" ) // ToRunnable lowers a saved Skill into the kernel's run.RunnableAgent DTO, so // run.Executor can run a skill WITHOUT importing this battery (the inversion of // mort's skillexec running a skills.Skill). Maps the static shape only; the // skill's input schema → prompt rendering, palette resolution, audit, etc. are // supplied separately (the host renders inputs into the input string and wires // run.Ports). A skill exposes a flat tool list (no SkillPalette/SubAgentPalette // — composition is a host concern), so those stay empty. func (s *Skill) ToRunnable() run.RunnableAgent { return run.RunnableAgent{ ID: s.ID, Name: s.Name, SystemPrompt: s.SystemPrompt, ModelTier: s.ModelTier, MaxIterations: s.MaxIterations, MaxRuntime: s.MaxRuntime, LowLevelTools: s.Tools, } } // DueAt reports whether a scheduled skill is due at now (cron empty => never). // Convenience for a host scheduler that doesn't want to re-parse the cron. func (s *Skill) DueAt(now time.Time) bool { if s.Schedule == "" || s.NextRunAt.IsZero() { return false } return !s.NextRunAt.After(now) }