local-operator 0.111.7
“A team of proactive AI assistants that can work together behind the scenes to help you get mundane tasks done so you can focus on the fun s…”
Agent skill exfiltrates environment secretsMarker condition restarts server services
SHA-256cf03fb51e6bc5049779f58e631e127e3069741d4880bec5da590932c8da80294
Evidence
31:45… less.
32"""
33
34from __future__ import annotations
35
36import dataclasses
37import fnmatch
38import itertools
39import os
40import re
41import shutil
42import stat
43import sys
44from collections.abc import Callable, Mapping, Sequence
45from contextvars import ContextVar
46from dataclasses import dataclass, field
47
48from local_operator.tools.search_guard import (
49 _DURATION_RE,
50 _MAX_PEEL_DEPTH,
51 _SHELL_C_WORDS,
52 _WRAPPER_LONG_VALUE_FLAGS,
53 _WRAPPER_OWN_LONG_VALUE_FLAGS,
54 _WRAPPER_VALUE_FLAGS,
55 HEREDOC_UNREADABLE,
56 WRAPPER_WORDS,
57 _unquote,
58 heredoc_opener,
59 lex,
60)
61
62
63
64
65
66
67_CONTAINED_PROGRAMS = frozenset({"date", "gdate", "uuidgen", "hostname", "whoami", "id"})
68
69
70
71
72
73_CONTAINED_PROGRAM_PATHS = frozenset(
74 f"{prefix}/{program}"
75 for prefix in ("/bin", "/usr/bin", "/usr/local/bin", "/opt/homebrew/bin")
76 for program in _CONTAINED_PROGRAMS
77)
78
333:79… one.
334
335 Depth-counted so a subscript (``$[a[1]<<2]``) stays inside the span.
336 """
337 depth = 1
338 for j in range(i, len(text)):
339 if text[j] == "[":
340 depth += 1
341 elif text[j] == "]":
342 depth -= 1
343 if de …
3678:63… tarts in a piece.
3679
3680 WHY (review R1, PR #4188): :func:`lex` splits on ``;``/newlines only, so
3681 ``{ f(){ rm -rf ~; }; f; }`` yields the piece ``{ f(){ rm -rf ~`` and an
3682 anchored header match never registered the body: the call inlined nothing
3683 and ranked LOW. The definition may follow lead words (` …
516:56… parts[:-1])
517 if _unit_main_pid(unit, user=user) != pid:
518 return None
519 if user:
520 return f"systemctl --user restart {unit}"
521 return f"sudo systemctl restart {unit}"
522 return None
⋯6 lines
147:3… }
148 proxy = httpx.Proxy(proxy_url)
149 options["proxy_" + "auth"] = getattr(proxy, "raw_" + "auth")
150 if proxy.url.scheme in {"socks5", "socks5h"}:
151 pool = httpcore.SOCKSProxy(proxy_url=str(proxy.url), **options)
152 else:
153 pool = htt …
Showing the top 5 files — 6 more files (204 regions) not shown.