mirror of
https://github.com/GH05TCREW/pentestagent.git
synced 2026-03-07 06:14:08 +00:00
feat(notes): Allow listing all the notes (not truncated)
This commit is contained in:
@@ -148,12 +148,12 @@ def _validate_note_schema(category: str, metadata: Dict[str, Any]) -> str | None
|
||||
|
||||
@register_tool(
|
||||
name="notes",
|
||||
description="Manage persistent notes for key findings. Actions: create, read, update, delete, list.",
|
||||
description="Manage persistent notes for key findings. Actions: create, read, update, delete, list (2 options, all or the truncated text to 60 characters).",
|
||||
schema=ToolSchema(
|
||||
properties={
|
||||
"action": {
|
||||
"type": "string",
|
||||
"enum": ["create", "read", "update", "delete", "list"],
|
||||
"enum": ["create", "read", "update", "delete", "list_all", "list_truncated"],
|
||||
"description": "The action to perform",
|
||||
},
|
||||
"key": {
|
||||
@@ -399,7 +399,7 @@ async def notes(arguments: dict, runtime) -> str:
|
||||
_save_notes_unlocked()
|
||||
return f"Deleted note '{key}'"
|
||||
|
||||
elif action == "list":
|
||||
elif action == "list_all" or action == "list_truncated":
|
||||
if not _notes:
|
||||
return "No notes saved"
|
||||
|
||||
@@ -417,9 +417,13 @@ async def notes(arguments: dict, runtime) -> str:
|
||||
lines.append(f"\n## {cat.title()}")
|
||||
for k, v in by_category[cat]:
|
||||
content = v["content"]
|
||||
display_val = (
|
||||
content if len(content) <= 60 else content[:57] + "..."
|
||||
)
|
||||
|
||||
display_val = content
|
||||
if action == "list_truncated":
|
||||
display_val = (
|
||||
content if len(content) <= 60 else content[:57] + "..."
|
||||
)
|
||||
|
||||
conf = v.get("confidence", "medium")
|
||||
lines.append(f" [{k}] ({conf}) {display_val}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user