| 702 | |
| 703 | impl<'a> ToolExecutor for RepoToolExecutor<'a> { |
| 704 | fn tool_definitions(&self) -> Vec<ToolDefinition> { |
| 705 | #[allow(unused_mut)] |
| 706 | let mut defs = vec![ |
| 707 | ToolDefinition { |
| 708 | name: "kg_search".into(), |
| 709 | description: "Search the repository knowledge graph for nodes matching a \ |
| 710 | query. Returns files, functions, changes, views, goals, intents." |
| 711 | .into(), |
| 712 | parameters: json!({ |
| 713 | "type": "object", |
| 714 | "properties": { |
| 715 | "query": { |
| 716 | "type": "string", |
| 717 | "description": "Free-text search query" |
| 718 | }, |
| 719 | "limit": { |
| 720 | "type": "integer", |
| 721 | "description": "Maximum results to return (default 10)" |
| 722 | } |
| 723 | }, |
| 724 | "required": ["query"] |
| 725 | }), |
| 726 | }, |
| 727 | ToolDefinition { |
| 728 | name: "kg_neighbors".into(), |
| 729 | description: "Explore the knowledge-graph neighborhood around a node. \ |
| 730 | Returns connected nodes and edges." |
| 731 | .into(), |
| 732 | parameters: json!({ |
| 733 | "type": "object", |
| 734 | "properties": { |
| 735 | "node_id": { |
| 736 | "type": "string", |
| 737 | "description": "Node ID (e.g. \"file:src/main.rs\", \"change:abc123\")" |
| 738 | }, |
| 739 | "depth": { |
| 740 | "type": "integer", |
| 741 | "description": "Traversal depth (default 1, max 2)" |
| 742 | } |
| 743 | }, |
| 744 | "required": ["node_id"] |
| 745 | }), |
| 746 | }, |
| 747 | ToolDefinition { |
| 748 | name: "read_file".into(), |
| 749 | description: "Read a file from the working copy. For files over 8KB, \ |
| 750 | returns a 50-line preview unless you specify start_line/end_line. \ |
| 751 | Always use list_entities or code_search first to find the \ |
| 752 | right line range instead of reading entire large files." |
| 753 | .into(), |
| 754 | parameters: json!({ |
| 755 | "type": "object", |
| 756 | "properties": { |
| 757 | "path": { |
| 758 | "type": "string", |
| 759 | "description": "Relative path from repository root" |
| 760 | }, |
| 761 | "start_line": { |