prismal-tui 0.2.0__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.
Files changed (65) hide show
  1. prismal_tui-0.2.0/.gitignore +219 -0
  2. prismal_tui-0.2.0/CHANGELOG.md +87 -0
  3. prismal_tui-0.2.0/LICENSE +21 -0
  4. prismal_tui-0.2.0/PKG-INFO +173 -0
  5. prismal_tui-0.2.0/README.md +120 -0
  6. prismal_tui-0.2.0/docs/configuration.md +175 -0
  7. prismal_tui-0.2.0/docs/manual-verification.md +47 -0
  8. prismal_tui-0.2.0/prismal_tui/__init__.py +1 -0
  9. prismal_tui-0.2.0/prismal_tui/__main__.py +60 -0
  10. prismal_tui-0.2.0/prismal_tui/app.py +533 -0
  11. prismal_tui-0.2.0/prismal_tui/client.py +51 -0
  12. prismal_tui-0.2.0/prismal_tui/commands.py +118 -0
  13. prismal_tui-0.2.0/prismal_tui/errors.py +117 -0
  14. prismal_tui-0.2.0/prismal_tui/session/__init__.py +27 -0
  15. prismal_tui-0.2.0/prismal_tui/session/conversation_session.py +388 -0
  16. prismal_tui-0.2.0/prismal_tui/session/models.py +41 -0
  17. prismal_tui-0.2.0/prismal_tui/session/usage_tally.py +116 -0
  18. prismal_tui-0.2.0/prismal_tui/settings.py +145 -0
  19. prismal_tui-0.2.0/prismal_tui/store/__init__.py +0 -0
  20. prismal_tui-0.2.0/prismal_tui/store/conversation_store.py +238 -0
  21. prismal_tui-0.2.0/prismal_tui/widgets/__init__.py +1 -0
  22. prismal_tui-0.2.0/prismal_tui/widgets/composer.py +63 -0
  23. prismal_tui-0.2.0/prismal_tui/widgets/help.py +55 -0
  24. prismal_tui-0.2.0/prismal_tui/widgets/sidebar.py +60 -0
  25. prismal_tui-0.2.0/prismal_tui/widgets/statusbar.py +78 -0
  26. prismal_tui-0.2.0/prismal_tui/widgets/transcript.py +151 -0
  27. prismal_tui-0.2.0/prismal_tui/widgets/usage_modal.py +85 -0
  28. prismal_tui-0.2.0/pyproject.toml +117 -0
  29. prismal_tui-0.2.0/scripts/smoke_test.py +67 -0
  30. prismal_tui-0.2.0/tests/__init__.py +0 -0
  31. prismal_tui-0.2.0/tests/conftest.py +26 -0
  32. prismal_tui-0.2.0/tests/contract/__init__.py +0 -0
  33. prismal_tui-0.2.0/tests/contract/conftest.py +66 -0
  34. prismal_tui-0.2.0/tests/contract/test_live_resume.py +105 -0
  35. prismal_tui-0.2.0/tests/contract/test_live_server.py +127 -0
  36. prismal_tui-0.2.0/tests/contract/test_live_usage.py +75 -0
  37. prismal_tui-0.2.0/tests/fakes.py +263 -0
  38. prismal_tui-0.2.0/tests/ui/__init__.py +0 -0
  39. prismal_tui-0.2.0/tests/ui/conftest.py +86 -0
  40. prismal_tui-0.2.0/tests/ui/test_app.py +491 -0
  41. prismal_tui-0.2.0/tests/ui/test_error_paths.py +165 -0
  42. prismal_tui-0.2.0/tests/ui/test_help_screen.py +68 -0
  43. prismal_tui-0.2.0/tests/ui/test_responsiveness.py +74 -0
  44. prismal_tui-0.2.0/tests/ui/test_resume.py +241 -0
  45. prismal_tui-0.2.0/tests/ui/test_secret_leak.py +161 -0
  46. prismal_tui-0.2.0/tests/ui/test_statusbar.py +117 -0
  47. prismal_tui-0.2.0/tests/ui/test_transcript.py +79 -0
  48. prismal_tui-0.2.0/tests/ui/test_usage.py +337 -0
  49. prismal_tui-0.2.0/tests/unit/__init__.py +0 -0
  50. prismal_tui-0.2.0/tests/unit/test_boundary_guard.py +140 -0
  51. prismal_tui-0.2.0/tests/unit/test_client.py +97 -0
  52. prismal_tui-0.2.0/tests/unit/test_commands.py +167 -0
  53. prismal_tui-0.2.0/tests/unit/test_conversation_session.py +507 -0
  54. prismal_tui-0.2.0/tests/unit/test_conversation_store.py +228 -0
  55. prismal_tui-0.2.0/tests/unit/test_dependencies.py +66 -0
  56. prismal_tui-0.2.0/tests/unit/test_errors.py +180 -0
  57. prismal_tui-0.2.0/tests/unit/test_fake_client.py +248 -0
  58. prismal_tui-0.2.0/tests/unit/test_main.py +79 -0
  59. prismal_tui-0.2.0/tests/unit/test_release.py +104 -0
  60. prismal_tui-0.2.0/tests/unit/test_session_agui.py +334 -0
  61. prismal_tui-0.2.0/tests/unit/test_settings.py +185 -0
  62. prismal_tui-0.2.0/tests/unit/test_usage_contract_fixtures.py +151 -0
  63. prismal_tui-0.2.0/tests/unit/test_usage_modal_text.py +71 -0
  64. prismal_tui-0.2.0/tests/unit/test_usage_tally.py +191 -0
  65. prismal_tui-0.2.0/tests/usage_payloads.py +110 -0
@@ -0,0 +1,219 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+ .idea/
@@ -0,0 +1,87 @@
1
+ # Changelog
2
+
3
+ All notable changes to `prismal-tui`. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.2.0] — 2026-11-03
8
+
9
+ Targets `prismal-server` 0.3 and `prismal-sdk` 0.3
10
+ (`DELTA-2026-11-host-0.3`).
11
+
12
+ ### Changed
13
+
14
+ - **The SDK now comes from PyPI.** The dependency is `prismal-ai-sdk>=0.3,<1`
15
+ (the SDK's PyPI distribution name; the import module is still
16
+ `prismal_sdk`). A `../prismal-sdk` checkout is no longer needed. This
17
+ also fixes `uv sync`, which failed once the SDK renamed its project.
18
+ - **Published on PyPI** as `prismal-tui`: `uvx prismal-tui` or
19
+ `pipx install prismal-tui` (`TUI-FUTURE-01`). Releases publish from `main`
20
+ through PyPI trusted publishing, then tag `v<version>` and create the
21
+ GitHub release. They no longer run on tag pushes.
22
+ - CI's contract job installs `prismal-server` 0.3.x from PyPI into its own
23
+ virtualenv, starts it in fake-LLM mode with AG-UI on, and runs on every
24
+ pull request.
25
+
26
+ ### Added
27
+
28
+ - **Agent questions and `/resume`.** With `PRISMAL_TUI_PROTOCOL=ag-ui`
29
+ (default `prismal`, unchanged), turns stream over AG-UI. When the agent
30
+ pauses at an approval gate, the transcript shows its question and
31
+ `/resume <answer>` answers it. Valid JSON is sent as the decoded value
32
+ (e.g. `/resume {"action": "approve"}`); anything else is sent as the
33
+ text. Answers are never mapped to actions or re-sent automatically. Open
34
+ questions stay in memory only.
35
+ - Friendly copy for the new refusals: AG-UI disabled on the host, an answer
36
+ that was already consumed or is still running, and an answer the server
37
+ rejected.
38
+
39
+ ## [0.1.1] — 2026-11-02
40
+
41
+ ### Added
42
+
43
+ - **Slash escape.** `//text` sends the message `/text`, so a message can
44
+ start with `/` (for example `//etc/hosts doesn't resolve`). Exactly one
45
+ slash is removed and the rest is sent unmodified. A single leading `/`
46
+ is still a command. Listed in `/help` (`DELTA-2026-11-slash-escape`).
47
+
48
+ ## [0.1.0] — 2026-11-02
49
+
50
+ First release. A Textual terminal front-end for `prismal-server`, built only
51
+ on `prismal-sdk` (`>=0.2,<1`). It installs from source: `prismal-sdk` 0.2 is
52
+ not on PyPI yet, so check out `../prismal-sdk` next to this repo. PyPI is
53
+ `TUI-FUTURE-01`.
54
+
55
+ ### Added
56
+
57
+ - **Chat.** Streamed answers rendered with frame-based coalescing and
58
+ re-rendered as Markdown when the turn ends. Tool calls show as `⚙` lines.
59
+ User text reaches the engine unmodified.
60
+ - **Conversations.** A sidebar plus `/new`, `/switch`, `/rename` and
61
+ `/delete` for named local conversations. Each maps to one durable engine
62
+ thread in a local SQLite store, which holds no messages and no secrets.
63
+ The mapping is persisted before the first message is sent.
64
+ - **Cancel.** `Esc` (or `PRISMAL_TUI_CANCEL_KEY`) and `/cancel` close the
65
+ stream, and the host cancels the run. Partial text is always kept.
66
+ - **Errors.** Friendly copy in the transcript, the status bar and a toast.
67
+ No error codes, server messages or tracebacks are shown, and nothing is
68
+ retried automatically.
69
+ - **Usage (DELTA-2026-10).** A status-bar readout of the last turn and the
70
+ session (tokens, cache %, cost labels `~`, `(plan)`, `$?` and `*`).
71
+ `/usage` and `/usage all` open a modal fed by the server's
72
+ `GET /v1/usage`. A budget stop reads "Budget limit reached on the server —
73
+ run /usage for details".
74
+ - **Polish.** Status bar with connection state and key hints, help on `F1`
75
+ and `/help`, and a background health check that never blocks startup.
76
+ - **Configuration.** `PRISMAL_TUI_*` environment variables only, validated
77
+ at startup without echoing values (see `docs/configuration.md`). The token
78
+ is a `SecretStr` that never reaches the screen, the store or the log. The
79
+ log file is mode `0600` and holds no message text.
80
+ - **Quality.** Offline unit and Pilot UI suites with a coverage floor of
81
+ 97%, an AST boundary guard, an end-to-end secret-leak test and a
82
+ responsiveness probe. An opt-in `contract` suite runs against a live
83
+ `prismal-server` 0.2, which CI can start in fake-LLM mode.
84
+
85
+ [0.2.0]: https://github.com/prismal-ai/prismal-tui/releases/tag/v0.2.0
86
+ [0.1.1]: https://github.com/prismal-ai/prismal-tui/releases/tag/v0.1.1
87
+ [0.1.0]: https://github.com/prismal-ai/prismal-tui/releases/tag/v0.1.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 prismal-ai
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,173 @@
1
+ Metadata-Version: 2.5
2
+ Name: prismal-tui
3
+ Version: 0.2.0
4
+ Summary: Terminal UI (Textual) for prismal-server, built exclusively on prismal-sdk (PyPI: prismal-ai-sdk).
5
+ Project-URL: Repository, https://github.com/prismal-ai/prismal-tui
6
+ Project-URL: Changelog, https://github.com/prismal-ai/prismal-tui/blob/main/CHANGELOG.md
7
+ Project-URL: Documentation, https://github.com/prismal-ai/prismal-tui/blob/main/docs/configuration.md
8
+ Project-URL: SDK, https://github.com/prismal-ai/prismal-sdk
9
+ Project-URL: Server, https://github.com/prismal-ai/prismal-server
10
+ Author-email: Ernesto Crespo <ecrespo@gmail.com>
11
+ License: MIT License
12
+
13
+ Copyright (c) 2026 prismal-ai
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+ License-File: LICENSE
33
+ Keywords: chat,prismal,terminal,textual,tui
34
+ Classifier: Development Status :: 3 - Alpha
35
+ Classifier: Environment :: Console
36
+ Classifier: Intended Audience :: Developers
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.13
39
+ Classifier: Typing :: Typed
40
+ Requires-Python: >=3.13
41
+ Requires-Dist: platformdirs<4.15,>=4.14
42
+ Requires-Dist: prismal-ai-sdk<1,>=0.3
43
+ Requires-Dist: pydantic-settings<3,>=2.5
44
+ Requires-Dist: textual<8.3,>=8.2
45
+ Provides-Extra: dev
46
+ Requires-Dist: mypy>=1.11; extra == 'dev'
47
+ Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
48
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
49
+ Requires-Dist: pytest-timeout>=2.3; extra == 'dev'
50
+ Requires-Dist: pytest>=8.0; extra == 'dev'
51
+ Requires-Dist: ruff>=0.6; extra == 'dev'
52
+ Description-Content-Type: text/markdown
53
+
54
+ # prismal-tui
55
+
56
+ Terminal UI for the [prismal](https://github.com/prismal-ai/prismal)
57
+ ecosystem — an interactive [Textual](https://textual.textualize.io/)
58
+ application you run locally to talk to a running
59
+ [`prismal-server`](https://github.com/prismal-ai/prismal-server),
60
+ exclusively through [`prismal-sdk`](https://github.com/prismal-ai/prismal-sdk)
61
+ (`AsyncPrismalClient`).
62
+
63
+ There is no browser and no chat platform here: keystrokes go straight into
64
+ a `ConversationSession` that resolves or creates one engine `thread_id` per
65
+ locally-named conversation, persists that mapping in a local SQLite
66
+ `ConversationStore` (so restarting the app never forks an ongoing
67
+ conversation), streams the reply through `prismal-sdk`, and renders it as
68
+ Markdown in a scrollable transcript — with a single key press (`Esc` by
69
+ default) to cancel mid-turn.
70
+
71
+ > **Status: `0.1.1`** — all of `tui-bootstrap` (phases TUI-00…04 and the
72
+ > usage readout, `DELTA-2026-10`) is implemented; see
73
+ > [`CHANGELOG.md`](./CHANGELOG.md) and
74
+ > [`specs/tui-bootstrap/TASKS.md`](./specs/tui-bootstrap/TASKS.md). Installs
75
+ > from source (not on PyPI yet).
76
+
77
+ ## Ecosystem position
78
+
79
+ ```
80
+ developer's terminal ── keyboard/ANSI ──▶ prismal-tui (this repo)
81
+ │ prismal_sdk (HTTP + SSE)
82
+ ▼
83
+ prismal-server ──▶ prismal (engine)
84
+ ```
85
+
86
+ | Repo | Role | Status |
87
+ |---|---|---|
88
+ | [`prismal`](https://github.com/prismal-ai/prismal) | Engine (LangGraph supervisor, 29 routes, RAG, security) | v3.22.1 (PyPI `prismal-ai`) |
89
+ | [`prismal-server`](https://github.com/prismal-ai/prismal-server) | FastAPI host (REST + SSE + AG-UI + A2A) | v0.3.0 (PyPI) |
90
+ | [`prismal-sdk`](https://github.com/prismal-ai/prismal-sdk) | Typed Python client (sync + async) | v0.3.0 (PyPI `prismal-ai-sdk`) |
91
+ | [`prismal-webchat`](https://github.com/prismal-ai/prismal-webchat) | Embeddable browser chat widget | SDD seed |
92
+ | [`prismal-chatbot`](https://github.com/prismal-ai/prismal-chatbot) | External bots — Slack, Discord | SDD seed |
93
+ | `prismal-tui` | Terminal UI (this repo) | **pre-release** |
94
+
95
+ ## What v0.1 delivers
96
+
97
+ A single-process Textual app: a scrollable, Markdown-rendered transcript
98
+ that streams tokens as the engine produces them, visible tool-call
99
+ activity, a sidebar to create/switch/rename/delete named local
100
+ conversations (each backed by its own durable engine thread), a small
101
+ slash-command set (`/new`, `/switch`, `/rename`, `/delete`, `/usage`,
102
+ `/cancel`, `/quit`, `/help`), immediate keyboard cancellation of an
103
+ in-flight turn, a status-bar token/cost readout per turn and per session
104
+ (from `prismal-server` ≥ 0.2's own usage numbers), and friendly error
105
+ messages on failure. See `specs/tui-bootstrap/PLAN.md`
106
+ §5 for the full in/out-of-scope list.
107
+
108
+ ## Install
109
+
110
+ ```bash
111
+ uvx prismal-tui # run without installing
112
+ # or: pipx install prismal-tui / uv tool install prismal-tui
113
+ ```
114
+
115
+ Point it at your server with `PRISMAL_TUI_SERVER_URL` (and `PRISMAL_TUI_TOKEN`
116
+ if it needs one); every setting is in
117
+ [`docs/configuration.md`](./docs/configuration.md).
118
+
119
+ ## Quickstart (dev)
120
+
121
+ Requires Python 3.13, [`uv`](https://docs.astral.sh/uv/) and a running
122
+ `prismal-server` (defaults to `http://localhost:8000`). The SDK comes from
123
+ PyPI as [`prismal-ai-sdk`](https://pypi.org/project/prismal-ai-sdk/)
124
+ (import module `prismal_sdk`); no sibling checkout is needed.
125
+
126
+ ```bash
127
+ uv sync --extra dev
128
+
129
+ export PRISMAL_TUI_SERVER_URL="http://localhost:8000"
130
+ export PRISMAL_TUI_TOKEN="…" # service credential, optional locally
131
+
132
+ prismal-tui
133
+ # or: python -m prismal_tui
134
+ ```
135
+
136
+ Inside the app: type a message and press Enter to send, `Esc` to cancel a
137
+ streaming reply, `/new <name>` to start a new conversation, `/help` for the
138
+ full key-binding and command list. With `PRISMAL_TUI_PROTOCOL=ag-ui` (host
139
+ with AG-UI enabled) the agent's approval questions show up in the transcript
140
+ and `/resume <answer>` answers them — see
141
+ [`docs/configuration.md`](./docs/configuration.md).
142
+
143
+ ## Configuration
144
+
145
+ | Env var | Default | Meaning |
146
+ |---|---|---|
147
+ | `PRISMAL_TUI_SERVER_URL` | `http://localhost:8000` | Target `prismal-server` |
148
+ | `PRISMAL_TUI_TOKEN` | — | Bearer credential (never rendered or persisted) |
149
+ | `PRISMAL_TUI_ORG_ID` | — | Tenant for all TUI traffic (`X-Org-Id`) |
150
+ | `PRISMAL_TUI_STORE_PATH` | `platformdirs` user-data dir | Local `ConversationStore` SQLite file |
151
+ | `PRISMAL_TUI_CANCEL_KEY` | `escape` | Key binding that cancels an in-flight turn |
152
+ | `PRISMAL_TUI_LOG_LEVEL` | `INFO` | Local log file verbosity |
153
+
154
+ Full reference: [`docs/configuration.md`](./docs/configuration.md).
155
+
156
+ ## Development
157
+
158
+ ```bash
159
+ uv run pytest # unit + ui suite — offline, fake SDK client + Textual Pilot
160
+ uv run pytest -m contract # opt-in — against a running prismal-server
161
+ # (PRISMAL_TUI_SERVER_URL; fake-LLM mode recommended)
162
+ uv run ruff check . && uv run mypy prismal_tui
163
+ ```
164
+
165
+ Boundary rules (no `prismal`/`prismal_server` imports, no direct HTTP to
166
+ the host, no secret ever rendered, logged, or persisted) are enforced by
167
+ tests — see [`CLAUDE.md`](./CLAUDE.md) for the review checklist. Before a
168
+ release, run [`docs/manual-verification.md`](./docs/manual-verification.md)
169
+ against a real host.
170
+
171
+ ## License
172
+
173
+ [MIT](./LICENSE)
@@ -0,0 +1,120 @@
1
+ # prismal-tui
2
+
3
+ Terminal UI for the [prismal](https://github.com/prismal-ai/prismal)
4
+ ecosystem — an interactive [Textual](https://textual.textualize.io/)
5
+ application you run locally to talk to a running
6
+ [`prismal-server`](https://github.com/prismal-ai/prismal-server),
7
+ exclusively through [`prismal-sdk`](https://github.com/prismal-ai/prismal-sdk)
8
+ (`AsyncPrismalClient`).
9
+
10
+ There is no browser and no chat platform here: keystrokes go straight into
11
+ a `ConversationSession` that resolves or creates one engine `thread_id` per
12
+ locally-named conversation, persists that mapping in a local SQLite
13
+ `ConversationStore` (so restarting the app never forks an ongoing
14
+ conversation), streams the reply through `prismal-sdk`, and renders it as
15
+ Markdown in a scrollable transcript — with a single key press (`Esc` by
16
+ default) to cancel mid-turn.
17
+
18
+ > **Status: `0.1.1`** — all of `tui-bootstrap` (phases TUI-00…04 and the
19
+ > usage readout, `DELTA-2026-10`) is implemented; see
20
+ > [`CHANGELOG.md`](./CHANGELOG.md) and
21
+ > [`specs/tui-bootstrap/TASKS.md`](./specs/tui-bootstrap/TASKS.md). Installs
22
+ > from source (not on PyPI yet).
23
+
24
+ ## Ecosystem position
25
+
26
+ ```
27
+ developer's terminal ── keyboard/ANSI ──▶ prismal-tui (this repo)
28
+ │ prismal_sdk (HTTP + SSE)
29
+ ▼
30
+ prismal-server ──▶ prismal (engine)
31
+ ```
32
+
33
+ | Repo | Role | Status |
34
+ |---|---|---|
35
+ | [`prismal`](https://github.com/prismal-ai/prismal) | Engine (LangGraph supervisor, 29 routes, RAG, security) | v3.22.1 (PyPI `prismal-ai`) |
36
+ | [`prismal-server`](https://github.com/prismal-ai/prismal-server) | FastAPI host (REST + SSE + AG-UI + A2A) | v0.3.0 (PyPI) |
37
+ | [`prismal-sdk`](https://github.com/prismal-ai/prismal-sdk) | Typed Python client (sync + async) | v0.3.0 (PyPI `prismal-ai-sdk`) |
38
+ | [`prismal-webchat`](https://github.com/prismal-ai/prismal-webchat) | Embeddable browser chat widget | SDD seed |
39
+ | [`prismal-chatbot`](https://github.com/prismal-ai/prismal-chatbot) | External bots — Slack, Discord | SDD seed |
40
+ | `prismal-tui` | Terminal UI (this repo) | **pre-release** |
41
+
42
+ ## What v0.1 delivers
43
+
44
+ A single-process Textual app: a scrollable, Markdown-rendered transcript
45
+ that streams tokens as the engine produces them, visible tool-call
46
+ activity, a sidebar to create/switch/rename/delete named local
47
+ conversations (each backed by its own durable engine thread), a small
48
+ slash-command set (`/new`, `/switch`, `/rename`, `/delete`, `/usage`,
49
+ `/cancel`, `/quit`, `/help`), immediate keyboard cancellation of an
50
+ in-flight turn, a status-bar token/cost readout per turn and per session
51
+ (from `prismal-server` ≥ 0.2's own usage numbers), and friendly error
52
+ messages on failure. See `specs/tui-bootstrap/PLAN.md`
53
+ §5 for the full in/out-of-scope list.
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ uvx prismal-tui # run without installing
59
+ # or: pipx install prismal-tui / uv tool install prismal-tui
60
+ ```
61
+
62
+ Point it at your server with `PRISMAL_TUI_SERVER_URL` (and `PRISMAL_TUI_TOKEN`
63
+ if it needs one); every setting is in
64
+ [`docs/configuration.md`](./docs/configuration.md).
65
+
66
+ ## Quickstart (dev)
67
+
68
+ Requires Python 3.13, [`uv`](https://docs.astral.sh/uv/) and a running
69
+ `prismal-server` (defaults to `http://localhost:8000`). The SDK comes from
70
+ PyPI as [`prismal-ai-sdk`](https://pypi.org/project/prismal-ai-sdk/)
71
+ (import module `prismal_sdk`); no sibling checkout is needed.
72
+
73
+ ```bash
74
+ uv sync --extra dev
75
+
76
+ export PRISMAL_TUI_SERVER_URL="http://localhost:8000"
77
+ export PRISMAL_TUI_TOKEN="…" # service credential, optional locally
78
+
79
+ prismal-tui
80
+ # or: python -m prismal_tui
81
+ ```
82
+
83
+ Inside the app: type a message and press Enter to send, `Esc` to cancel a
84
+ streaming reply, `/new <name>` to start a new conversation, `/help` for the
85
+ full key-binding and command list. With `PRISMAL_TUI_PROTOCOL=ag-ui` (host
86
+ with AG-UI enabled) the agent's approval questions show up in the transcript
87
+ and `/resume <answer>` answers them — see
88
+ [`docs/configuration.md`](./docs/configuration.md).
89
+
90
+ ## Configuration
91
+
92
+ | Env var | Default | Meaning |
93
+ |---|---|---|
94
+ | `PRISMAL_TUI_SERVER_URL` | `http://localhost:8000` | Target `prismal-server` |
95
+ | `PRISMAL_TUI_TOKEN` | — | Bearer credential (never rendered or persisted) |
96
+ | `PRISMAL_TUI_ORG_ID` | — | Tenant for all TUI traffic (`X-Org-Id`) |
97
+ | `PRISMAL_TUI_STORE_PATH` | `platformdirs` user-data dir | Local `ConversationStore` SQLite file |
98
+ | `PRISMAL_TUI_CANCEL_KEY` | `escape` | Key binding that cancels an in-flight turn |
99
+ | `PRISMAL_TUI_LOG_LEVEL` | `INFO` | Local log file verbosity |
100
+
101
+ Full reference: [`docs/configuration.md`](./docs/configuration.md).
102
+
103
+ ## Development
104
+
105
+ ```bash
106
+ uv run pytest # unit + ui suite — offline, fake SDK client + Textual Pilot
107
+ uv run pytest -m contract # opt-in — against a running prismal-server
108
+ # (PRISMAL_TUI_SERVER_URL; fake-LLM mode recommended)
109
+ uv run ruff check . && uv run mypy prismal_tui
110
+ ```
111
+
112
+ Boundary rules (no `prismal`/`prismal_server` imports, no direct HTTP to
113
+ the host, no secret ever rendered, logged, or persisted) are enforced by
114
+ tests — see [`CLAUDE.md`](./CLAUDE.md) for the review checklist. Before a
115
+ release, run [`docs/manual-verification.md`](./docs/manual-verification.md)
116
+ against a real host.
117
+
118
+ ## License
119
+
120
+ [MIT](./LICENSE)