mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-10 22:32:16 +02:00
chore: bumped version to 0.0.31
This commit is contained in:
parent
8df8565e0a
commit
1c9ab207ef
56 changed files with 520 additions and 190 deletions
|
|
@ -50,9 +50,7 @@ def _augment_allowlist_for_collision_prefixes(
|
|||
continue
|
||||
original = meta.get("mcp_original_tool_name")
|
||||
if original in trusted_names and tool.name not in trusted_names:
|
||||
alias_rules.append(
|
||||
Rule(permission=tool.name, pattern="*", action="allow")
|
||||
)
|
||||
alias_rules.append(Rule(permission=tool.name, pattern="*", action="allow"))
|
||||
|
||||
if not alias_rules:
|
||||
return dependencies
|
||||
|
|
|
|||
|
|
@ -85,8 +85,7 @@ def create_get_connected_accounts_tool(*, workspace_id: int) -> BaseTool:
|
|||
# ``server_config`` presence == the connector produces agent
|
||||
# tools. Native rows without it are connected for indexing
|
||||
# only and need a reconnect via MCP.
|
||||
"usable_in_chat": isinstance(cfg, dict)
|
||||
and "server_config" in cfg,
|
||||
"usable_in_chat": isinstance(cfg, dict) and "server_config" in cfg,
|
||||
"account": account_meta,
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,9 @@ def resolve_tool_name_collisions(
|
|||
or original_name,
|
||||
"mcp_collision_prefixed": True,
|
||||
}
|
||||
resolved.append(tool.model_copy(update={"name": new_name, "metadata": new_meta}))
|
||||
resolved.append(
|
||||
tool.model_copy(update={"name": new_name, "metadata": new_meta})
|
||||
)
|
||||
return resolved
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ def _cell(value: Any) -> str:
|
|||
"""Render one CSV cell: scalars as-is, nested structures as compact JSON."""
|
||||
if value is None:
|
||||
return ""
|
||||
if isinstance(value, (dict, list)):
|
||||
if isinstance(value, dict | list):
|
||||
return json.dumps(value, ensure_ascii=False, default=str)
|
||||
return str(value)
|
||||
|
||||
|
|
@ -230,9 +230,7 @@ def build_run_reader_tools(*, workspace_id: int) -> list[BaseTool]:
|
|||
count = min(max(1, limit), _MAX_LIMIT)
|
||||
window = lines[start : start + count]
|
||||
if not window:
|
||||
return (
|
||||
f"No lines at offset {start} (total {len(lines)} lines in {ref})."
|
||||
)
|
||||
return f"No lines at offset {start} (total {len(lines)} lines in {ref})."
|
||||
window_body = "\n".join(window)
|
||||
start_char = max(0, char_offset)
|
||||
if start_char >= len(window_body) > 0:
|
||||
|
|
@ -328,10 +326,14 @@ def build_run_reader_tools(*, workspace_id: int) -> list[BaseTool]:
|
|||
records = _rows_from_body(body, rows)
|
||||
if include_pattern:
|
||||
inc = _build_matcher(include_pattern.strip())
|
||||
records = [r for r in records if inc(" ".join(map(_cell, r.values()))) is not None]
|
||||
records = [
|
||||
r for r in records if inc(" ".join(map(_cell, r.values()))) is not None
|
||||
]
|
||||
if exclude_pattern:
|
||||
exc = _build_matcher(exclude_pattern.strip())
|
||||
records = [r for r in records if exc(" ".join(map(_cell, r.values()))) is None]
|
||||
records = [
|
||||
r for r in records if exc(" ".join(map(_cell, r.values()))) is None
|
||||
]
|
||||
if not records:
|
||||
return (
|
||||
f"Error: no rows to export from {ref} "
|
||||
|
|
@ -353,7 +355,9 @@ def build_run_reader_tools(*, workspace_id: int) -> list[BaseTool]:
|
|||
|
||||
preview_lines = csv_text.split("\n")[:4]
|
||||
truncated_note = (
|
||||
f" (capped at {_EXPORT_MAX_ROWS} rows)" if row_count >= _EXPORT_MAX_ROWS else ""
|
||||
f" (capped at {_EXPORT_MAX_ROWS} rows)"
|
||||
if row_count >= _EXPORT_MAX_ROWS
|
||||
else ""
|
||||
)
|
||||
return (
|
||||
f"Exported {row_count} rows{truncated_note} to {final_path} "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue