Remove list_files tool
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"model": null,
|
"model": null,
|
||||||
"max_iters": 50,
|
"max_iters": 50,
|
||||||
"lm": "openrouter/openai/gpt-5.2-codex",
|
"lm": "openrouter/anthropic/claude-opus-4.5",
|
||||||
"sub_lm": "openrouter/openai/gpt-5-mini",
|
"sub_lm": "openrouter/qwen/qwen-coder",
|
||||||
"api_base": "https://openrouter.ai/api/v1",
|
"api_base": "https://openrouter.ai/api/v1",
|
||||||
"max_tokens": 50000,
|
"max_tokens": 50000,
|
||||||
"max_output_chars": 100000,
|
"max_output_chars": 100000,
|
||||||
|
|||||||
13
nanocode.py
13
nanocode.py
@@ -40,7 +40,7 @@ def read_file(path: str, offset: int = 0, limit: int = None) -> str:
|
|||||||
selected = lines[offset : offset + limit]
|
selected = lines[offset : offset + limit]
|
||||||
content = "".join(f"{offset + idx + 1:4}| {line}" for idx, line in enumerate(selected))
|
content = "".join(f"{offset + idx + 1:4}| {line}" for idx, line in enumerate(selected))
|
||||||
tokens = len(content) // 4 # ~4 chars per token estimate
|
tokens = len(content) // 4 # ~4 chars per token estimate
|
||||||
print(f"{MAGENTA}⏺ Reading file: {path} (~{tokens:,} tokens){RESET}")
|
print(f"{MAGENTA}⏺ Reading file({path}) (~{tokens:,} tokens){RESET}")
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ def write_file(path: str, content: str) -> str:
|
|||||||
|
|
||||||
lines = content.count("\n") + (1 if content and not content.endswith("\n") else 0)
|
lines = content.count("\n") + (1 if content and not content.endswith("\n") else 0)
|
||||||
tokens = len(content) // 4
|
tokens = len(content) // 4
|
||||||
print(f"{MAGENTA}⏺ {action} file: {path} ({lines} lines, ~{tokens:,} tokens){RESET}")
|
print(f"{MAGENTA}⏺ {action} file({path}) ({lines} lines, ~{tokens:,} tokens){RESET}")
|
||||||
return f"ok: wrote {lines} lines ({tokens:,} tokens) to {path}"
|
return f"ok: wrote {lines} lines ({tokens:,} tokens) to {path}"
|
||||||
|
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ def edit_file(path: str, old: str, new: str, replace_all: bool = False) -> str:
|
|||||||
Returns:
|
Returns:
|
||||||
'ok' on success, error message on failure
|
'ok' on success, error message on failure
|
||||||
"""
|
"""
|
||||||
print(f"{MAGENTA}⏺ Editing file: {path}{RESET}")
|
print(f"{MAGENTA}⏺ Edit({path}){RESET}")
|
||||||
|
|
||||||
text = open(path).read()
|
text = open(path).read()
|
||||||
if old not in text:
|
if old not in text:
|
||||||
@@ -109,7 +109,7 @@ def glob_files(pattern: str, path: str = ".") -> str:
|
|||||||
Returns:
|
Returns:
|
||||||
Newline-separated list of matching files
|
Newline-separated list of matching files
|
||||||
"""
|
"""
|
||||||
print(f"{MAGENTA}⏺ Glob: {pattern}{RESET}")
|
print(f"{MAGENTA}⏺ Glob({pattern}): {path}{RESET}")
|
||||||
|
|
||||||
cmd = ["rg", "--files", "-g", pattern, path]
|
cmd = ["rg", "--files", "-g", pattern, path]
|
||||||
try:
|
try:
|
||||||
@@ -228,8 +228,8 @@ Do NOT confuse REPL variables with external files. Reading a file into a variabl
|
|||||||
|
|
||||||
class RLMCodingConfig(PrecompiledConfig):
|
class RLMCodingConfig(PrecompiledConfig):
|
||||||
max_iters: int = 50
|
max_iters: int = 50
|
||||||
lm: str = "openrouter/openai/gpt-5.2-codex"
|
lm: str = "openrouter/anthropic/claude-opus-4.5"
|
||||||
sub_lm: str = "openrouter/openai/gpt-5-mini"
|
sub_lm: str = "openrouter/qwen/qwen-coder"
|
||||||
api_base: str = "https://openrouter.ai/api/v1"
|
api_base: str = "https://openrouter.ai/api/v1"
|
||||||
max_tokens: int = 50000
|
max_tokens: int = 50000
|
||||||
max_output_chars: int = 100000
|
max_output_chars: int = 100000
|
||||||
@@ -420,4 +420,3 @@ if __name__ == "__main__":
|
|||||||
branch=branch,
|
branch=branch,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lm": {
|
"lm": {
|
||||||
"model": "openrouter/openai/gpt-5.2-codex",
|
"model": "openrouter/anthropic/claude-opus-4.5",
|
||||||
"model_type": "chat",
|
"model_type": "chat",
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"num_retries": 3,
|
"num_retries": 3,
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"lm": {
|
"lm": {
|
||||||
"model": "openrouter/openai/gpt-5.2-codex",
|
"model": "openrouter/anthropic/claude-opus-4.5",
|
||||||
"model_type": "chat",
|
"model_type": "chat",
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"num_retries": 3,
|
"num_retries": 3,
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ version = "0.1.0"
|
|||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
dependencies = ["dspy>=3.1.2", "fastmcp>=2.14.3", "mcp2py>=0.6.0", "modaic>=0.10.4"]
|
dependencies = ["dspy>=3.1.2", "fastmcp>=2.14.3", "mcp2py>=0.6.0", "modaic>=0.10.4", "weave>=0.52.25"]
|
||||||
|
|||||||
Reference in New Issue
Block a user