Compare commits
2 Commits
7adacd06b7
...
fcd60c908b
| Author | SHA1 | Date | |
|---|---|---|---|
| fcd60c908b | |||
| 5608d8d6cd |
@@ -15,7 +15,6 @@ tools:
|
|||||||
- discovered_tool_fetch_url
|
- discovered_tool_fetch_url
|
||||||
- activate_skill
|
- activate_skill
|
||||||
- discovered_tool_run_powershell
|
- discovered_tool_run_powershell
|
||||||
- tier3-worker
|
|
||||||
---
|
---
|
||||||
STRICT SYSTEM DIRECTIVE: You are a Tier 1 Orchestrator.
|
STRICT SYSTEM DIRECTIVE: You are a Tier 1 Orchestrator.
|
||||||
Focused on product alignment, high-level planning, and track initialization.
|
Focused on product alignment, high-level planning, and track initialization.
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ tools:
|
|||||||
- discovered_tool_fetch_url
|
- discovered_tool_fetch_url
|
||||||
- activate_skill
|
- activate_skill
|
||||||
- discovered_tool_run_powershell
|
- discovered_tool_run_powershell
|
||||||
- tier3-worker
|
|
||||||
- tier4-qa
|
|
||||||
---
|
---
|
||||||
STRICT SYSTEM DIRECTIVE: You are a Tier 2 Tech Lead.
|
STRICT SYSTEM DIRECTIVE: You are a Tier 2 Tech Lead.
|
||||||
Focused on architectural design and track execution.
|
Focused on architectural design and track execution.
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
"enableAgents": true
|
"enableAgents": true
|
||||||
},
|
},
|
||||||
"tools": {
|
"tools": {
|
||||||
"discoveryCommand": "uv run python C:/projects/manual_slop/scripts/tool_discovery.py",
|
|
||||||
"callCommand": "uv run python C:/projects/manual_slop/scripts/tool_call.py",
|
|
||||||
"whitelist": [
|
"whitelist": [
|
||||||
"*"
|
"*"
|
||||||
]
|
],
|
||||||
|
"discoveryCommand": "powershell.exe -NoProfile -Command \"Get-Content .gemini/tools.json -Raw\"",
|
||||||
|
"callCommand": "python scripts/tool_call.py"
|
||||||
},
|
},
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"BeforeTool": [
|
"BeforeTool": [
|
||||||
|
|||||||
143
.gemini/tools.json
Normal file
143
.gemini/tools.json
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "fetch_url",
|
||||||
|
"description": "Fetch the full text content of a URL (stripped of HTML tags).",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The full URL to fetch."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"url"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "get_code_outline",
|
||||||
|
"description": "Get a hierarchical outline of a code file. This returns classes, functions, and methods with their line ranges and brief docstrings. Use this to quickly map out a file's structure before reading specific sections.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the code file (currently supports .py)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "get_file_summary",
|
||||||
|
"description": "Get a compact heuristic summary of a file without reading its full content. For Python: imports, classes, methods, functions, constants. For TOML: table keys. For Markdown: headings. Others: line count + preview. Use this before read_file to decide if you need the full content.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Absolute or relative path to the file to summarise."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "get_git_diff",
|
||||||
|
"description": "Returns the git diff for a file or directory. Use this to review changes efficiently without reading entire files.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the file or directory."
|
||||||
|
},
|
||||||
|
"base_rev": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Base revision (e.g. 'HEAD', 'HEAD~1', or a commit hash). Defaults to 'HEAD'."
|
||||||
|
},
|
||||||
|
"head_rev": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Head revision (optional)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "get_python_skeleton",
|
||||||
|
"description": "Get a skeleton view of a Python file. This returns all classes and function signatures with their docstrings, but replaces function bodies with '...'. Use this to understand module interfaces without reading the full implementation.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the .py file."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "run_powershell",
|
||||||
|
"description": "Run a PowerShell script within the project base_dir. Use this to create, edit, rename, or delete files and directories. stdout and stderr are returned to you as the result.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"script": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The PowerShell script to execute."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"script"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "search_files",
|
||||||
|
"description": "Search for files matching a glob pattern within an allowed directory. Supports recursive patterns like '**/*.py'. Use this to find files by extension or name pattern.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Absolute path to the directory to search within."
|
||||||
|
},
|
||||||
|
"pattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Glob pattern, e.g. '*.py', '**/*.toml', 'src/**/*.rs'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path",
|
||||||
|
"pattern"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "web_search",
|
||||||
|
"description": "Search the web using DuckDuckGo. Returns the top 5 search results with titles, URLs, and snippets.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"query": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The search query."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"query"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
17
.gemini/tools/fetch_url.json
Normal file
17
.gemini/tools/fetch_url.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "fetch_url",
|
||||||
|
"description": "Fetch the full text content of a URL (stripped of HTML tags).",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The full URL to fetch."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"url"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py fetch_url"
|
||||||
|
}
|
||||||
17
.gemini/tools/get_code_outline.json
Normal file
17
.gemini/tools/get_code_outline.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "get_code_outline",
|
||||||
|
"description": "Get a hierarchical outline of a code file. This returns classes, functions, and methods with their line ranges and brief docstrings. Use this to quickly map out a file's structure before reading specific sections.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the code file (currently supports .py)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py get_code_outline"
|
||||||
|
}
|
||||||
17
.gemini/tools/get_file_summary.json
Normal file
17
.gemini/tools/get_file_summary.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "get_file_summary",
|
||||||
|
"description": "Get a compact heuristic summary of a file without reading its full content. For Python: imports, classes, methods, functions, constants. For TOML: table keys. For Markdown: headings. Others: line count + preview. Use this before read_file to decide if you need the full content.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Absolute or relative path to the file to summarise."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py get_file_summary"
|
||||||
|
}
|
||||||
25
.gemini/tools/get_git_diff.json
Normal file
25
.gemini/tools/get_git_diff.json
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"name": "get_git_diff",
|
||||||
|
"description": "Returns the git diff for a file or directory. Use this to review changes efficiently without reading entire files.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the file or directory."
|
||||||
|
},
|
||||||
|
"base_rev": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Base revision (e.g. 'HEAD', 'HEAD~1', or a commit hash). Defaults to 'HEAD'."
|
||||||
|
},
|
||||||
|
"head_rev": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Head revision (optional)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py get_git_diff"
|
||||||
|
}
|
||||||
17
.gemini/tools/get_python_skeleton.json
Normal file
17
.gemini/tools/get_python_skeleton.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "get_python_skeleton",
|
||||||
|
"description": "Get a skeleton view of a Python file. This returns all classes and function signatures with their docstrings, but replaces function bodies with '...'. Use this to understand module interfaces without reading the full implementation.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the .py file."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py get_python_skeleton"
|
||||||
|
}
|
||||||
17
.gemini/tools/run_powershell.json
Normal file
17
.gemini/tools/run_powershell.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "run_powershell",
|
||||||
|
"description": "Run a PowerShell script within the project base_dir. Use this to create, edit, rename, or delete files and directories. stdout and stderr are returned to you as the result.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"script": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The PowerShell script to execute."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"script"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py run_powershell"
|
||||||
|
}
|
||||||
22
.gemini/tools/search_files.json
Normal file
22
.gemini/tools/search_files.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "search_files",
|
||||||
|
"description": "Search for files matching a glob pattern within an allowed directory. Supports recursive patterns like '**/*.py'. Use this to find files by extension or name pattern.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Absolute path to the directory to search within."
|
||||||
|
},
|
||||||
|
"pattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Glob pattern, e.g. '*.py', '**/*.toml', 'src/**/*.rs'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path",
|
||||||
|
"pattern"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py search_files"
|
||||||
|
}
|
||||||
17
.gemini/tools/web_search.json
Normal file
17
.gemini/tools/web_search.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "web_search",
|
||||||
|
"description": "Search the web using DuckDuckGo. Returns the top 5 search results with titles, URLs, and snippets.",
|
||||||
|
"parameters": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"query": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The search query."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"query"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"command": "python scripts/tool_call.py web_search"
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Implementation Plan: Tiered Context Scoping & HITL Approval
|
# Implementation Plan: Tiered Context Scoping & HITL Approval
|
||||||
|
|
||||||
## Phase 1: Context Subsetting
|
## Phase 1: Context Subsetting
|
||||||
- [ ] Task: Refactor `aggregate.py` to support targeted context builds (e.g., `build_tier1_context`, `build_tier3_context`).
|
- [~] Task: Refactor `aggregate.py` to support targeted context builds (e.g., `build_tier1_context`, `build_tier3_context`).
|
||||||
- [ ] Task: Integrate AST skeleton extraction into the standard Tier 3 context build.
|
- [ ] Task: Integrate AST skeleton extraction into the standard Tier 3 context build.
|
||||||
- [ ] Task: Update the project state to track which files are assigned to which tier.
|
- [ ] Task: Update the project state to track which files are assigned to which tier.
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ def default_project(name: str = "unnamed") -> dict:
|
|||||||
return {
|
return {
|
||||||
"project": {"name": name, "git_dir": "", "system_prompt": "", "main_context": ""},
|
"project": {"name": name, "git_dir": "", "system_prompt": "", "main_context": ""},
|
||||||
"output": {"output_dir": "./md_gen"},
|
"output": {"output_dir": "./md_gen"},
|
||||||
"files": {"base_dir": ".", "paths": []},
|
"files": {"base_dir": ".", "paths": [], "tier_assignments": {}},
|
||||||
"screenshots": {"base_dir": ".", "paths": []},
|
"screenshots": {"base_dir": ".", "paths": []},
|
||||||
"gemini_cli": {"binary_path": "gemini"},
|
"gemini_cli": {"binary_path": "gemini"},
|
||||||
"deepseek": {"reasoning_effort": "medium"},
|
"deepseek": {"reasoning_effort": "medium"},
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ def execute_agent(role: str, prompt: str, docs: list[str]) -> str:
|
|||||||
# Use subprocess with input to pipe the prompt via stdin, avoiding WinError 206.
|
# Use subprocess with input to pipe the prompt via stdin, avoiding WinError 206.
|
||||||
# We use -p 'mma_task' to ensure non-interactive (headless) mode and valid parsing.
|
# We use -p 'mma_task' to ensure non-interactive (headless) mode and valid parsing.
|
||||||
# Whitelist tools to ensure they are available to the model in headless mode.
|
# Whitelist tools to ensure they are available to the model in headless mode.
|
||||||
# Using 'discovered_tool_*' names as they are provided by tool_discovery.py
|
|
||||||
allowed_tools = "read_file,write_file,replace,list_directory,glob,grep_search,discovered_tool_search_files,discovered_tool_get_file_summary,discovered_tool_get_python_skeleton,discovered_tool_get_code_outline,discovered_tool_get_git_diff,discovered_tool_run_powershell,activate_skill,codebase_investigator,discovered_tool_web_search,discovered_tool_fetch_url"
|
allowed_tools = "read_file,write_file,replace,list_directory,glob,grep_search,discovered_tool_search_files,discovered_tool_get_file_summary,discovered_tool_get_python_skeleton,discovered_tool_get_code_outline,discovered_tool_get_git_diff,discovered_tool_run_powershell,activate_skill,codebase_investigator,discovered_tool_web_search,discovered_tool_fetch_url"
|
||||||
ps_command = (
|
ps_command = (
|
||||||
f"if (Test-Path 'C:\\projects\\misc\\setup_gemini.ps1') {{ . 'C:\\projects\\misc\\setup_gemini.ps1' }}; "
|
f"if (Test-Path 'C:\\projects\\misc\\setup_gemini.ps1') {{ . 'C:\\projects\\misc\\setup_gemini.ps1' }}; "
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import mcp_client
|
import mcp_client
|
||||||
|
import shell_runner
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print(json.dumps({"error": "Failed to import mcp_client"}))
|
print(json.dumps({"error": "Failed to import required modules"}))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@@ -30,14 +31,15 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Note: mcp_client.configure() is usually called by the GUI before each session,
|
if tool_name == "run_powershell":
|
||||||
# but for direct CLI calls, we might need a basic configuration.
|
script = tool_input.get("script", "")
|
||||||
# However, mcp_client tools generally resolve paths relative to CWD if not configured.
|
# We use the current directory as base_dir for CLI calls
|
||||||
|
result = shell_runner.run_powershell(script, os.getcwd())
|
||||||
|
else:
|
||||||
|
# mcp_client tools generally resolve paths relative to CWD if not configured.
|
||||||
result = mcp_client.dispatch(tool_name, tool_input)
|
result = mcp_client.dispatch(tool_name, tool_input)
|
||||||
|
|
||||||
# We wrap the result in a JSON object for consistency if needed,
|
# We print the raw result string as that's what gemini-cli expects.
|
||||||
# but the CLI often expects just the string result from stdout.
|
|
||||||
# Actually, let's just print the raw result string as that's what mcp_client returns.
|
|
||||||
print(result)
|
print(result)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"ERROR executing tool {tool_name}: {e}")
|
print(f"ERROR executing tool {tool_name}: {e}")
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
import mcp_client
|
import mcp_client
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
|
# Print the error to stderr to diagnose
|
||||||
|
print(f"ImportError in discovery: {e}", file=sys.stderr)
|
||||||
print("[]")
|
print("[]")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user