Compare commits

...

2 Commits

Author SHA1 Message Date
Ed_
fcd60c908b idk 2026-02-27 21:25:39 -05:00
Ed_
5608d8d6cd checkpoint 2026-02-27 21:15:56 -05:00
17 changed files with 310 additions and 18 deletions

View File

@@ -15,7 +15,6 @@ tools:
- discovered_tool_fetch_url
- activate_skill
- discovered_tool_run_powershell
- tier3-worker
---
STRICT SYSTEM DIRECTIVE: You are a Tier 1 Orchestrator.
Focused on product alignment, high-level planning, and track initialization.

View File

@@ -17,8 +17,6 @@ tools:
- discovered_tool_fetch_url
- activate_skill
- discovered_tool_run_powershell
- tier3-worker
- tier4-qa
---
STRICT SYSTEM DIRECTIVE: You are a Tier 2 Tech Lead.
Focused on architectural design and track execution.

View File

@@ -3,11 +3,11 @@
"enableAgents": true
},
"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": [
"*"
]
],
"discoveryCommand": "powershell.exe -NoProfile -Command \"Get-Content .gemini/tools.json -Raw\"",
"callCommand": "python scripts/tool_call.py"
},
"hooks": {
"BeforeTool": [

143
.gemini/tools.json Normal file
View 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"
]
}
}
]

View 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"
}

View 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"
}

View 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"
}

View 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"
}

View 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"
}

View 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"
}

View 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"
}

View 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"
}

View File

@@ -1,7 +1,7 @@
# Implementation Plan: Tiered Context Scoping & HITL Approval
## 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: Update the project state to track which files are assigned to which tier.

View File

@@ -98,7 +98,7 @@ def default_project(name: str = "unnamed") -> dict:
return {
"project": {"name": name, "git_dir": "", "system_prompt": "", "main_context": ""},
"output": {"output_dir": "./md_gen"},
"files": {"base_dir": ".", "paths": []},
"files": {"base_dir": ".", "paths": [], "tier_assignments": {}},
"screenshots": {"base_dir": ".", "paths": []},
"gemini_cli": {"binary_path": "gemini"},
"deepseek": {"reasoning_effort": "medium"},

View File

@@ -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.
# 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.
# 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"
ps_command = (
f"if (Test-Path 'C:\\projects\\misc\\setup_gemini.ps1') {{ . 'C:\\projects\\misc\\setup_gemini.ps1' }}; "

View File

@@ -7,8 +7,9 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
try:
import mcp_client
import shell_runner
except ImportError:
print(json.dumps({"error": "Failed to import mcp_client"}))
print(json.dumps({"error": "Failed to import required modules"}))
sys.exit(1)
def main():
@@ -30,14 +31,15 @@ def main():
sys.exit(1)
try:
# Note: mcp_client.configure() is usually called by the GUI before each session,
# but for direct CLI calls, we might need a basic configuration.
# However, mcp_client tools generally resolve paths relative to CWD if not configured.
result = mcp_client.dispatch(tool_name, tool_input)
if tool_name == "run_powershell":
script = tool_input.get("script", "")
# 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)
# We wrap the result in a JSON object for consistency if needed,
# 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.
# We print the raw result string as that's what gemini-cli expects.
print(result)
except Exception as e:
print(f"ERROR executing tool {tool_name}: {e}")

View File

@@ -7,7 +7,9 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
try:
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("[]")
sys.exit(0)