Multiplexer and Decorator¶
tether.multiplexer¶
A command that is not enabled returns a self-healing error (unknown_cmd, no exception) listing the enabled tools and how to enable more (--tools, SDK tools=[...], skill tools:). A known built-in that is merely disabled (bash, web, edit, mem, skill, agent) is reported as disabled, not unknown. The text lives in the error response (history), never in the system prompt prefix.
Virtual CLI Multiplexer (act(cmd, stdin)) with 9B quirk normalization and JIT --help.
Multiplexer
¶
register_normalizer(fn)
¶
Append a command-quirk normalizer (str -> str) that runs after the built-in ones.
Use it to teach Tether a model's habit once for every model, e.g. stripping a vendor prefix. It must be deterministic and return its input unchanged when it does not apply.
normalize_cmd(raw_cmd)
¶
Normalize common small-model CLI syntax quirks deterministically.
split_heredoc(cmd)
¶
Split a trailing shell heredoc off cmd into stdin (models write edit ... <<'EOF').
unescape_literal_newlines(stdin)
¶
Unescape literal \n/\t when a small model sent a whole payload on one line.
split_cli(cmd)
¶
Split a CLI command string using POSIX shlex with graceful fallback on unclosed quotes.
tether.decorator¶
@tool decorator introspection and ultra-compact JIT --help synthesis.
ToolSpec
dataclass
¶
build_tool_spec(fn, *, name=None, description=None, custom_help=None, raw_dispatch=False)
¶
Introspect a Python function into a ToolSpec.
tool(fn=None, *, name=None, namespace=None, description=None)
¶
Decorator to register a sync or async Python function as a Tether virtual CLI tool.