41659b2412
The skill half of the persona/skill pair, as a clean redesign (not a faithful lift of mort's 60-method skills.Storage kitchen sink): - skill.go/skill_version.go/validate.go/inputs.go/schedule.go moved clean; the only host couplings severed: llms.IsTierName -> model.IsTierName, and the chatbot DefaultChatbotInputName const localized. - store.go: a DELIBERATELY LEAN SkillStore — skill lifecycle (CRUD + visibility) + versioning + scheduling ONLY. The KV/file/quota sub-stores that were fused into mort's interface are the tools/ store seams; email/channel grants stay host concerns. - runnable.go: Skill.ToRunnable() lowers a skill into run.RunnableAgent (flat tool list, no palette — composition is a host concern); DueAt() helper. - memory.go: NewMemory() — zero-dep in-process SkillStore (visibility filters, newest-first versions). Tests: ToRunnable mapping, visibility (public/shared/private) listing, version ordering + lookup. No mort dependency (go.mod tidy clean); core imports ZERO from skill. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.2 KiB
Go
36 lines
1.2 KiB
Go
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)
|
|
}
|