simbiot-harness/venv/lib/python3.12/site-packages/strands/vended_tools/_bash.py
Simbiot Harness b60439152b Simbiot Harness v0.1: тактовая лестница на Strands + CQRS/ES-спина
- harness/es.py: append-only event store + проекции (образец — кооп-портал)
- harness/levels.py: уровни 1с/1м/1ч/1д, контекст ∝ масштабу
- harness/scheduler.py: уровневые потоки, идемпотентные тики, absorbed-стабы
- harness/isolated_runner.py + _llm_worker.py: LLM-тик в сабпроцессе
  (глобальный asyncio-рантайм Strands не переживает 2+ create_harness)
- cli.py: init/task/tasks/status/events + requeue (написан самим минутным агентом)
- 9router: отдельный ключ sk-simbiot, модель auto (glm-5.3 первым)
2026-09-29 15:28:50 +00:00

49 lines
2 KiB
Python

"""The deprecated ``bash`` tool: the pre-rename shape of :mod:`.shell`.
``shell`` superseded ``bash`` because the tool routes commands through the
sandbox, which runs ``sh`` or the remote login shell rather than bash
specifically. The old tool keeps working under its old name until v2.0.0:
``strands.vended_tools.bash`` resolves to the instance defined here (emitting a
``DeprecationWarning`` on access), and :func:`make_bash` builds instances that
default to the pre-rename tool name.
This module is named ``_bash`` rather than ``bash`` because importing a public
``bash`` submodule would bind it onto the package, silently shadowing the
``__getattr__`` that emits the warning and handing callers a module where they
expect a tool.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from typing_extensions import deprecated
from .shell import make_shell
if TYPE_CHECKING:
from ..tools.decorator import DecoratedFunctionTool
_RENAME_RATIONALE = (
"The tool routes commands through the sandbox, which runs sh or the remote login shell "
"rather than bash specifically."
)
# The message is a string literal rather than an f-string over _RENAME_RATIONALE
# because PEP 702 checkers only honor @deprecated when the argument is a literal.
@deprecated(
"make_bash is deprecated and will be removed in v2.0.0. Use make_shell instead. "
"The tool routes commands through the sandbox, which runs sh or the remote login shell "
"rather than bash specifically."
)
def make_bash(*, name: str = "bash", **kwargs: Any) -> DecoratedFunctionTool:
"""Deprecated alias for :func:`~strands.vended_tools.shell.make_shell` keeping the pre-rename default name."""
return make_shell(name=name, **kwargs)
bash = make_shell(name="bash")
"""Deprecated pre-rename tool, kept so callers matching on the tool name ``"bash"``
keep working until removal in v2.0.0. Reach it through ``strands.vended_tools.bash``,
which emits the ``DeprecationWarning``; it is deliberately absent from ``__all__``
and the docs."""