( ctx context.Context, scope toolspkg.Scope, req toolspkg.CallRequest, )
| 1250 | } |
| 1251 | |
| 1252 | func (n *daemonNativeTools) skillView( |
| 1253 | ctx context.Context, |
| 1254 | scope toolspkg.Scope, |
| 1255 | req toolspkg.CallRequest, |
| 1256 | ) (toolspkg.ToolResult, error) { |
| 1257 | var input skillViewInput |
| 1258 | if err := decodeNativeInput(req, &input); err != nil { |
| 1259 | return toolspkg.ToolResult{}, err |
| 1260 | } |
| 1261 | skill, err := n.resolveSkill(ctx, scope, req.ToolID, input.WorkspaceID, input.Name) |
| 1262 | if err != nil { |
| 1263 | return toolspkg.ToolResult{}, err |
| 1264 | } |
| 1265 | file := strings.TrimSpace(input.File) |
| 1266 | var content string |
| 1267 | if file != "" { |
| 1268 | content, err = n.deps.Skills.LoadResource(ctx, skill, file) |
| 1269 | } else { |
| 1270 | content, err = n.deps.Skills.LoadContent(ctx, skill) |
| 1271 | } |
| 1272 | if err != nil { |
| 1273 | return toolspkg.ToolResult{}, err |
| 1274 | } |
| 1275 | payload := map[string]any{ |
| 1276 | "skill": core.SkillPayloadFromSkill(skill), |
| 1277 | "content": content, |
| 1278 | } |
| 1279 | if file != "" { |
| 1280 | payload["file"] = file |
| 1281 | } |
| 1282 | result, err := structuredResult(payload, content) |
| 1283 | if err != nil { |
| 1284 | return toolspkg.ToolResult{}, err |
| 1285 | } |
| 1286 | result.Content = []toolspkg.ToolContent{{Type: nativeToolsTextKey, Text: content}} |
| 1287 | return result, nil |
| 1288 | } |
| 1289 | |
| 1290 | func (n *daemonNativeTools) networkPeers( |
| 1291 | ctx context.Context, |
nothing calls this directly
no test coverage detected