Skip to content

Multiplexer and Decorator

tether.multiplexer

Virtual CLI Multiplexer (act(cmd, stdin)) with 9B quirk normalization and JIT --help.

Multiplexer

Routes act(cmd, stdin) invocations across registered tools.

toolbox_index()

Render the ultra-compact 1-line-per-tool directory for the system prompt.

execute(cmd, stdin=None) async

Execute a virtual CLI command and return a DispatchResult.

normalize_cmd(raw_cmd)

Normalize common small-model CLI syntax quirks deterministically.

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

index_line()

Return a 1-line summary (strictly <= 12 tokens) for the static system prompt.

help_text()

Return ultra-compact --help output (target <= 60 tokens).

invoke(args, stdin=None) async

Parse CLI arguments against ParamSpecs and invoke the underlying function.

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.