@@ -17,6 +17,7 @@ import (
17 "github.com/charmbracelet/crush/internal/filetracker"
17 "github.com/charmbracelet/crush/internal/filetracker"
18 "github.com/charmbracelet/crush/internal/lsp"
18 "github.com/charmbracelet/crush/internal/lsp"
19 "github.com/charmbracelet/crush/internal/permission"
19 "github.com/charmbracelet/crush/internal/permission"
20+ "github.com/charmbracelet/crush/internal/skills"
22//go:embed view.md
23//go:embed view.md
@@ -34,9 +35,19 @@ type ViewPermissionsParams struct {
34 Limit int `json:"limit"`
35 Limit int `json:"limit"`
38+type ViewResourceType string
41+ ViewResourceUnset ViewResourceType = ""
42+ ViewResourceSkill ViewResourceType = "skill"
37type ViewResponseMetadata struct {
45type ViewResponseMetadata struct {
38− FilePath string `json:"file_path"`
46+ FilePath string `json:"file_path"`
39− Content string `json:"content"`
47+ Content string `json:"content"`
48+ ResourceType ViewResourceType `json:"resource_type,omitempty"`
49+ ResourceName string `json:"resource_name,omitempty"`
50+ ResourceDescription string `json:"resource_description,omitempty"`
@@ -196,12 +207,22 @@ func NewViewTool(
196 output += "\n</file>\n"
207 output += "\n</file>\n"
197 output += getDiagnostics(filePath, lspManager)
208 output += getDiagnostics(filePath, lspManager)
198 filetracker.RecordRead(ctx, sessionID, filePath)
209 filetracker.RecordRead(ctx, sessionID, filePath)
211+ meta := ViewResponseMetadata{
216+ if skill, err := skills.Parse(filePath); err == nil {
217+ meta.ResourceType = ViewResourceSkill
218+ meta.ResourceName = skill.Name
219+ meta.ResourceDescription = skill.Description
199 return fantasy.WithResponseMetadata(
223 return fantasy.WithResponseMetadata(
200 fantasy.NewTextResponse(output),
224 fantasy.NewTextResponse(output),
201− ViewResponseMetadata{
225+ meta,