Skip to content

Commit bce48b3

Browse files
authored
Add files via upload
1 parent 1f294f6 commit bce48b3

3 files changed

Lines changed: 20 additions & 7 deletions

File tree

agent/skills/core/_journal_store.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ def get_archive(days: int = 30) -> str:
194194
return f"❌ Error reading archive: {e}"
195195

196196

197-
def end_day(summary: str, next_steps: str = "", user_insights: str = "") -> str:
197+
def end_day(summary: str = "", next_steps: str = "", user_insights: str = "") -> str:
198198
"""Wrap up the day: writes today's journal entry with a full activity summary.
199-
Automatically pulls today's activity log AND extracts user insights so nothing important is missed."""
199+
Automatically pulls today's activity log AND extracts user insights so nothing important is missed.
200+
If summary is not provided, it is auto-generated from the activity log."""
200201
try:
201202
today = date.today().isoformat()
202203

agent/skills/core/browser_session.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ def _page_state(page) -> str:
843843
# PUBLIC FUNCTIONS
844844
# ─────────────────────────────────────────────
845845

846-
def list_tabs() -> str:
846+
def list_tabs(tab_index: int = 0) -> str:
847847
"""List all open browser tabs with their index, title, and URL."""
848848
try:
849849
pw, browser = _get_connection()
@@ -895,6 +895,10 @@ def goto(url: str, tab_index: int = 0, **kwargs) -> str:
895895
# Accept 'tab' as alias for 'tab_index' (LLM sometimes uses the wrong name)
896896
if "tab" in kwargs:
897897
tab_index = kwargs.pop("tab")
898+
# Silently ignore non-functional kwargs the agent may pass
899+
kwargs.pop("stealth", None)
900+
kwargs.pop("wait_until", None)
901+
kwargs.pop("timeout", None)
898902
if kwargs:
899903
return f"❌ Unknown arguments: {list(kwargs.keys())}. Use tab_index (not tab)."
900904
try:
@@ -909,14 +913,18 @@ def goto(url: str, tab_index: int = 0, **kwargs) -> str:
909913
return f"❌ {e}"
910914

911915

912-
def get_text(tab_index: int = 0) -> str:
916+
def get_text(tab_index: int = 0, selector: str = "") -> str:
913917
"""Get the visible text content of the current page.
914918
Strips empty lines and collapses whitespace. Returns up to 5000 chars.
919+
If selector is provided, extracts text only from that element.
915920
"""
916921
try:
917922
pw, browser = _get_connection()
918923
page = _get_page(browser, tab_index)
919-
raw = page.locator("body").inner_text()
924+
if selector:
925+
raw = page.locator(selector).inner_text()
926+
else:
927+
raw = page.locator("body").inner_text()
920928
lines = [ln.strip() for ln in raw.splitlines() if ln.strip()]
921929
result = "\n".join(lines)
922930
total = len(result)

agent/skills/core/knowledge_base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,18 @@ def _ingest_one(path: Path, col, index: dict, chunk_size: int = _CHUNK_SIZE) ->
297297
# PUBLIC SKILL FUNCTIONS
298298
# ══════════════════════════════════════════════════════════════════════════════
299299

300-
def ingest_folder(*args) -> str:
300+
def ingest_folder(*args, **kwargs) -> str:
301301
"""
302302
Scan /app/memory/knowledge/ (or a custom path) and ingest any new or
303303
changed documents into the business_knowledge ChromaDB collection.
304304
Already-current files are skipped automatically.
305305
Usage: ingest_folder() or ingest_folder('/app/memory/knowledge/')
306+
ingest_folder(path='/app/memory/knowledge/') or ingest_folder(folder=...)
306307
"""
307-
folder = Path(str(args[0]).strip()) if args else _KNOWLEDGE_DIR
308+
folder = Path(str(args[0]).strip()) if args else None
309+
if folder is None:
310+
folder_val = kwargs.get("path") or kwargs.get("folder") or kwargs.get("source")
311+
folder = Path(str(folder_val).strip()) if folder_val else _KNOWLEDGE_DIR
308312

309313
if not folder.exists():
310314
folder.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)