next_functions, defer and decomp_progress: an easy-first queue per band, deferrals with reasons, tiered progress
This commit is contained in:
1 parent
ec210c019f
commit
2d2f5fe7c5
5 files changed
+325
-3
No files matched your search
@@ -518,6 +518,44 @@ def re_match(targets: str, decomp: str | None = None) -> dict:
|
||||
raise ToolError(str(error)) from None
|
||||
|
||||
|
||||
def _queue():
|
||||
from .queue import FunctionQueue
|
||||
return FunctionQueue(harbor())
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def next_functions(n: int = 10) -> list:
|
||||
"""The functions in your bands to decompile next, easiest first: not readable yet, not deferred, not claimed
|
||||
by someone else, rejected fewer than the attempt cap. Each row says why it ranks where it does (size, how
|
||||
many callees already have names, the convention from the bytes, earlier rejections)."""
|
||||
try:
|
||||
return _queue().next_functions(me(), max(1, min(int(n), 50)))
|
||||
except (HarborError, projects.ProjectError) as error:
|
||||
raise ToolError(str(error)) from None
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def defer(address: str, reason: str, evidence: str) -> dict:
|
||||
"""Set a function aside instead of trying it again: reason is one of register-args, needs-type,
|
||||
callee-unnamed, inline, x87, layout, too-large, engine-template, data-not-code, other; evidence says what you
|
||||
found so the next person starts from it. It becomes a DEFERRED note on the function; next_functions skips it
|
||||
until the note is replaced. Defer after two failed attempts rather than looping."""
|
||||
try:
|
||||
return _queue().defer(me(), address, reason, evidence)
|
||||
except (HarborError, projects.ProjectError) as error:
|
||||
raise ToolError(str(error)) from None
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def decomp_progress() -> dict:
|
||||
"""Every function in a tier: exact (byte match with the game's compiler), verified (same behaviour in the
|
||||
emulator), readable, deferred, raw; library and engine counted apart. Functions and bytes per tier."""
|
||||
try:
|
||||
return _queue().progress()
|
||||
except (HarborError, projects.ProjectError) as error:
|
||||
raise ToolError(str(error)) from None
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def ghidra_tools() -> list:
|
||||
"""The tools of the team's shared Ghidra session (GhidrAssistMCP, read-only, the curated project with every
|
||||
|
||||
Reference in new issue
Block a user