| 88 | } |
| 89 | |
| 90 | func (e *SkillExecutor) BuildInlineSkillMessage(skill SkillSpec, prompt string, disableSkillTool bool) map[string]any { |
| 91 | sourceLabel := "skill" |
| 92 | switch skill.Source { |
| 93 | case SkillSourceUser: |
| 94 | sourceLabel = "user skill" |
| 95 | case SkillSourceProject: |
| 96 | sourceLabel = "project skill" |
| 97 | case SkillSourceBundled: |
| 98 | sourceLabel = "bundled skill" |
| 99 | } |
| 100 | sanitized := regexp.MustCompile(`(?i)</?system[-_]reminder[^>]*>`).ReplaceAllString(prompt, "") |
| 101 | sanitized = strings.TrimSpace(sanitized) |
| 102 | text := "<system-reminder>\n" + |
| 103 | "Skill '" + skill.CanonicalName + "' (" + sourceLabel + ") is active for this turn. Treat this as transient task context; follow it only where it helps the current user request and do not carry it into unrelated future turns.\n\n" + |
| 104 | sanitized + "\n</system-reminder>" |
| 105 | return map[string]any{ |
| 106 | "role": "user", |
| 107 | "content": []map[string]any{{"type": "text", "text": text}}, |
| 108 | "isMeta": true, |
| 109 | "metadata": map[string]any{ |
| 110 | SkillInlineMetaKey: true, |
| 111 | "source": SkillInlineSource, |
| 112 | "skill_name": skill.CanonicalName, |
| 113 | SkillInlineAllowedToolsKey: skill.Frontmatter.AllowedTools, |
| 114 | "lumina_skill_model": optionalValue(skill.Frontmatter.Model), |
| 115 | "lumina_skill_effort": skill.Frontmatter.Effort, |
| 116 | SkillInlineDisableSkillToolKey: disableSkillTool, |
| 117 | }, |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func buildForkRegistry(base *coretools.ToolRegistry, allowedTools []string) *coretools.ToolRegistry { |
| 122 | if base == nil { |