taut-tui 0.8.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ .DS_Store
2
+ .ruff_cache/
3
+ .mypy_cache/
4
+ .pytest_cache/
5
+ .hypothesis/
6
+ .coverage
7
+ .coverage.*
8
+ coverage.xml
9
+ htmlcov/
10
+ dist/
11
+ build/
12
+ *.egg-info/
13
+ __pycache__/
14
+ *.py[cod]
15
+ .venv/
16
+ .taut.db
17
+ .taut.db.lock
18
+ .taut.lock
19
+ .taut.db-wal
20
+ .taut.db-shm
21
+ .envrc
22
+ .taut.toml
23
+ .weft
24
+ .broker*
25
+ extensions/taut_pg/uv.lock
taut_tui-0.8.9/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Van Lindberg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,67 @@
1
+ Metadata-Version: 2.5
2
+ Name: taut-tui
3
+ Version: 0.8.9
4
+ Summary: Human-first terminal interface extension for Taut
5
+ Author-email: Van Lindberg <van.lindberg@gmail.com>
6
+ License: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: taut-chat>=0.9.0
10
+ Requires-Dist: textual>=8.2.8
11
+ Provides-Extra: dev
12
+ Requires-Dist: build>=1.5.0; extra == 'dev'
13
+ Requires-Dist: mypy>=2.3.0; extra == 'dev'
14
+ Requires-Dist: pytest-cov>=7.1.0; extra == 'dev'
15
+ Requires-Dist: pytest-timeout>=2.4.0; extra == 'dev'
16
+ Requires-Dist: pytest-xdist>=3.8.0; extra == 'dev'
17
+ Requires-Dist: pytest>=9.1.1; extra == 'dev'
18
+ Requires-Dist: ruff>=0.16.3; extra == 'dev'
19
+ Requires-Dist: taut-summon>=0.9.0; extra == 'dev'
20
+ Description-Content-Type: text/markdown
21
+
22
+ # taut-tui
23
+
24
+ `taut-tui` is Taut's human-first terminal interface extension. It reflects
25
+ the public capabilities of `taut-chat` and loaded first-party extensions in a
26
+ full-screen Textual application. It does not define a second chat model or
27
+ derive forms from CLI arguments.
28
+
29
+ Install it beside core, or use core's convenience extra:
30
+
31
+ ```bash
32
+ python -m pip install taut-chat taut-tui
33
+ # equivalent convenience install
34
+ python -m pip install 'taut-chat[tui]'
35
+ taut tui
36
+ ```
37
+
38
+ The extension publishes `tui` through the `taut.commands` entry-point group.
39
+ There is intentionally no separate `taut-tui` console script. Without this
40
+ distribution installed, core does not claim the `tui` command.
41
+
42
+ The interface provides transcript-first navigation, native typed actions and
43
+ forms, vi-like and conventional keys, mouse controls, state-preserving terminal
44
+ reflow, actor-free system reports, and supervised terminal handoff to
45
+ `taut-summon` when that extension is available. Workspace load remains a
46
+ CLI-only maintenance action.
47
+
48
+ The governing behavior is in
49
+ [`docs/specs/10-taut-tui.md`](../../docs/specs/10-taut-tui.md). Architecture
50
+ and ownership rationale are in
51
+ [`docs/implementation/12-taut-tui.md`](../../docs/implementation/12-taut-tui.md).
52
+
53
+ ## Development
54
+
55
+ From the repository root:
56
+
57
+ ```bash
58
+ uv run --project extensions/taut_tui --extra dev \
59
+ pytest extensions/taut_tui/tests -n 0
60
+ uv run --project extensions/taut_tui --extra dev \
61
+ ruff check extensions/taut_tui/taut_tui extensions/taut_tui/tests
62
+ uv run --project extensions/taut_tui --extra dev \
63
+ mypy extensions/taut_tui/taut_tui extensions/taut_tui/tests
64
+ ```
65
+
66
+ The retained lock runs the complete suite with Textual 8.2.8. There is no
67
+ separate older-Textual compatibility lane.
@@ -0,0 +1,46 @@
1
+ # taut-tui
2
+
3
+ `taut-tui` is Taut's human-first terminal interface extension. It reflects
4
+ the public capabilities of `taut-chat` and loaded first-party extensions in a
5
+ full-screen Textual application. It does not define a second chat model or
6
+ derive forms from CLI arguments.
7
+
8
+ Install it beside core, or use core's convenience extra:
9
+
10
+ ```bash
11
+ python -m pip install taut-chat taut-tui
12
+ # equivalent convenience install
13
+ python -m pip install 'taut-chat[tui]'
14
+ taut tui
15
+ ```
16
+
17
+ The extension publishes `tui` through the `taut.commands` entry-point group.
18
+ There is intentionally no separate `taut-tui` console script. Without this
19
+ distribution installed, core does not claim the `tui` command.
20
+
21
+ The interface provides transcript-first navigation, native typed actions and
22
+ forms, vi-like and conventional keys, mouse controls, state-preserving terminal
23
+ reflow, actor-free system reports, and supervised terminal handoff to
24
+ `taut-summon` when that extension is available. Workspace load remains a
25
+ CLI-only maintenance action.
26
+
27
+ The governing behavior is in
28
+ [`docs/specs/10-taut-tui.md`](../../docs/specs/10-taut-tui.md). Architecture
29
+ and ownership rationale are in
30
+ [`docs/implementation/12-taut-tui.md`](../../docs/implementation/12-taut-tui.md).
31
+
32
+ ## Development
33
+
34
+ From the repository root:
35
+
36
+ ```bash
37
+ uv run --project extensions/taut_tui --extra dev \
38
+ pytest extensions/taut_tui/tests -n 0
39
+ uv run --project extensions/taut_tui --extra dev \
40
+ ruff check extensions/taut_tui/taut_tui extensions/taut_tui/tests
41
+ uv run --project extensions/taut_tui --extra dev \
42
+ mypy extensions/taut_tui/taut_tui extensions/taut_tui/tests
43
+ ```
44
+
45
+ The retained lock runs the complete suite with Textual 8.2.8. There is no
46
+ separate older-Textual compatibility lane.
@@ -0,0 +1,81 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "taut-tui"
7
+ version = "0.8.9"
8
+ description = "Human-first terminal interface extension for Taut"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = {text = "MIT"}
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ {name = "Van Lindberg", email = "van.lindberg@gmail.com"},
15
+ ]
16
+ dependencies = [
17
+ "taut-chat>=0.9.0",
18
+ "textual>=8.2.8",
19
+ ]
20
+
21
+ [project.entry-points."taut.commands"]
22
+ tui = "taut_tui.command_manifest:tui"
23
+
24
+ [project.optional-dependencies]
25
+ dev = [
26
+ "build>=1.5.0",
27
+ "mypy>=2.3.0",
28
+ "pytest>=9.1.1",
29
+ "pytest-cov>=7.1.0",
30
+ "pytest-timeout>=2.4.0",
31
+ "pytest-xdist>=3.8.0",
32
+ "ruff>=0.16.3",
33
+ "taut-summon>=0.9.0",
34
+ ]
35
+
36
+ [tool.uv.sources]
37
+ taut-chat = { path = "../..", editable = true }
38
+ taut-summon = { path = "../taut_summon", editable = true }
39
+
40
+ [tool.hatch.build]
41
+ include = [
42
+ "/taut_tui/**/*.py",
43
+ "/taut_tui/py.typed",
44
+ "/README.md",
45
+ "/LICENSE",
46
+ ]
47
+
48
+ [tool.pytest.ini_options]
49
+ minversion = "7.0"
50
+ testpaths = ["tests"]
51
+ addopts = "-ra -q --strict-markers"
52
+ markers = [
53
+ "sqlite_only: tests that validate built-in SQLite/path behavior",
54
+ "tui_only: tests that validate the TUI",
55
+ ]
56
+
57
+ [tool.mypy]
58
+ python_version = "3.11"
59
+ no_namespace_packages = true
60
+ warn_return_any = true
61
+ warn_unused_configs = true
62
+ disallow_untyped_defs = true
63
+ disallow_incomplete_defs = true
64
+ check_untyped_defs = true
65
+ no_implicit_optional = true
66
+ warn_redundant_casts = true
67
+ warn_unused_ignores = true
68
+
69
+ [tool.ruff]
70
+ target-version = "py311"
71
+ line-length = 88
72
+
73
+ [tool.ruff.lint]
74
+ extend-select = ["E", "W", "F", "I", "B", "C901", "C4", "UP"]
75
+ ignore = ["E501", "B008"]
76
+
77
+ [tool.ruff.lint.isort]
78
+ known-first-party = ["taut", "taut_tui"]
79
+
80
+ [tool.ruff.lint.mccabe]
81
+ max-complexity = 10
@@ -0,0 +1,31 @@
1
+ """Lazy public launch facade for Taut's optional terminal interface."""
2
+
3
+ from __future__ import annotations
4
+
5
+
6
+ class TuiLaunchError(Exception):
7
+ """A user-facing failure before or during TUI startup."""
8
+
9
+
10
+ class MissingTuiDependencyError(TuiLaunchError):
11
+ """The extension's required Textual dependency is not installed."""
12
+
13
+
14
+ def launch(
15
+ *,
16
+ db_path: str | None,
17
+ as_name: str | None,
18
+ auth_token: str | None,
19
+ ) -> int:
20
+ """Validate and launch the optional TUI without eager framework imports."""
21
+
22
+ from taut_tui._launch import run_tui
23
+
24
+ return run_tui(
25
+ db_path=db_path,
26
+ as_name=as_name,
27
+ auth_token=auth_token,
28
+ )
29
+
30
+
31
+ __all__ = ["MissingTuiDependencyError", "TuiLaunchError", "launch"]
@@ -0,0 +1,56 @@
1
+ """Terminal and optional-dependency preflight for the real TUI app."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import importlib
6
+ import sys
7
+ from typing import Any, TextIO
8
+
9
+ from taut_tui import MissingTuiDependencyError, TuiLaunchError
10
+
11
+ _INSTALL_HINT = (
12
+ "The taut-tui installation is missing its Textual dependency; "
13
+ "reinstall it with: pip install 'taut-tui'"
14
+ )
15
+
16
+
17
+ def run_tui(
18
+ *,
19
+ db_path: str | None,
20
+ as_name: str | None,
21
+ auth_token: str | None,
22
+ ) -> int:
23
+ """Launch the TUI after proving terminal and dependency availability."""
24
+
25
+ if not _is_tty(sys.stdin) or not _is_tty(sys.stdout):
26
+ raise TuiLaunchError("taut tui requires interactive input and output terminals")
27
+
28
+ _import_textual()
29
+ app_module = importlib.import_module("taut_tui.app")
30
+ app_type: Any = app_module.TautApp
31
+ app = app_type(
32
+ db_path=db_path,
33
+ as_name=as_name,
34
+ auth_token=auth_token,
35
+ )
36
+ app.run()
37
+ return 0
38
+
39
+
40
+ def _is_tty(stream: TextIO) -> bool:
41
+ try:
42
+ return stream.isatty()
43
+ except (AttributeError, OSError, ValueError):
44
+ return False
45
+
46
+
47
+ def _import_textual() -> None:
48
+ try:
49
+ importlib.import_module("textual")
50
+ except ModuleNotFoundError as exc:
51
+ if exc.name != "textual":
52
+ raise
53
+ raise MissingTuiDependencyError(_INSTALL_HINT) from None
54
+
55
+
56
+ __all__ = ["run_tui"]