Skip to content

Commit 3ba97f0

Browse files
authored
Merge branch 'main' into test/improve-network-test-assertions
2 parents 1d368fa + 663b7e4 commit 3ba97f0

File tree

4 files changed

+736
-56
lines changed

4 files changed

+736
-56
lines changed

stackone_ai/toolset.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -253,34 +253,6 @@ def __init__(
253253
self.base_url = base_url or DEFAULT_BASE_URL
254254
self._account_ids: list[str] = []
255255

256-
def _matches_filter(self, tool_name: str, filter_pattern: str | list[str]) -> bool:
257-
"""Check if a tool name matches the filter pattern
258-
259-
Args:
260-
tool_name: Name of the tool to check
261-
filter_pattern: String or list of glob patterns to match against.
262-
Patterns starting with ! are treated as negative matches.
263-
264-
Returns:
265-
True if the tool name matches any positive pattern and no negative patterns,
266-
False otherwise
267-
"""
268-
patterns = [filter_pattern] if isinstance(filter_pattern, str) else filter_pattern
269-
270-
# Split into positive and negative patterns
271-
positive_patterns = [p for p in patterns if not p.startswith("!")]
272-
negative_patterns = [p[1:] for p in patterns if p.startswith("!")]
273-
274-
# If no positive patterns, treat as match all
275-
matches_positive = (
276-
any(fnmatch.fnmatch(tool_name, p) for p in positive_patterns) if positive_patterns else True
277-
)
278-
279-
# If any negative pattern matches, exclude the tool
280-
matches_negative = any(fnmatch.fnmatch(tool_name, p) for p in negative_patterns)
281-
282-
return matches_positive and not matches_negative
283-
284256
def set_accounts(self, account_ids: list[str]) -> StackOneToolSet:
285257
"""Set account IDs for filtering tools
286258

0 commit comments

Comments
 (0)