padou 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 (57) hide show
  1. padou-0.2.0/.gitignore +10 -0
  2. padou-0.2.0/CHANGELOG.md +65 -0
  3. padou-0.2.0/CONTRIBUTING.md +69 -0
  4. padou-0.2.0/DISCLAIMER.md +43 -0
  5. padou-0.2.0/LICENSE +21 -0
  6. padou-0.2.0/PKG-INFO +574 -0
  7. padou-0.2.0/README.md +544 -0
  8. padou-0.2.0/SECURITY.md +30 -0
  9. padou-0.2.0/config.example.toml +49 -0
  10. padou-0.2.0/contrib/aur/PKGBUILD +39 -0
  11. padou-0.2.0/contrib/hyprland.conf +11 -0
  12. padou-0.2.0/contrib/llama-server.service +22 -0
  13. padou-0.2.0/docs/install_windows.md +94 -0
  14. padou-0.2.0/docs/install_windows_wsl.md +102 -0
  15. padou-0.2.0/install.ps1 +55 -0
  16. padou-0.2.0/install.sh +50 -0
  17. padou-0.2.0/pyproject.toml +55 -0
  18. padou-0.2.0/src/padou/__init__.py +3 -0
  19. padou-0.2.0/src/padou/__main__.py +3 -0
  20. padou-0.2.0/src/padou/app.py +720 -0
  21. padou-0.2.0/src/padou/bench.py +183 -0
  22. padou-0.2.0/src/padou/brand.py +178 -0
  23. padou-0.2.0/src/padou/cli.py +220 -0
  24. padou-0.2.0/src/padou/client.py +259 -0
  25. padou-0.2.0/src/padou/commands.py +984 -0
  26. padou-0.2.0/src/padou/compat.py +108 -0
  27. padou-0.2.0/src/padou/config.py +304 -0
  28. padou-0.2.0/src/padou/detect.py +368 -0
  29. padou-0.2.0/src/padou/doctor.py +95 -0
  30. padou-0.2.0/src/padou/models.py +282 -0
  31. padou-0.2.0/src/padou/paths.py +46 -0
  32. padou-0.2.0/src/padou/project.py +217 -0
  33. padou-0.2.0/src/padou/server.py +217 -0
  34. padou-0.2.0/src/padou/sessions.py +81 -0
  35. padou-0.2.0/src/padou/setup.py +181 -0
  36. padou-0.2.0/src/padou/theme.py +145 -0
  37. padou-0.2.0/src/padou/tools.py +713 -0
  38. padou-0.2.0/src/padou/ui.py +565 -0
  39. padou-0.2.0/src/padou/updates.py +294 -0
  40. padou-0.2.0/src/padou/web.py +298 -0
  41. padou-0.2.0/src/padou/writes.py +825 -0
  42. padou-0.2.0/tests/test_brand.py +55 -0
  43. padou-0.2.0/tests/test_coding.py +290 -0
  44. padou-0.2.0/tests/test_compat.py +30 -0
  45. padou-0.2.0/tests/test_config_theme.py +68 -0
  46. padou-0.2.0/tests/test_detect.py +69 -0
  47. padou-0.2.0/tests/test_models.py +69 -0
  48. padou-0.2.0/tests/test_models_remove.py +108 -0
  49. padou-0.2.0/tests/test_modes.py +266 -0
  50. padou-0.2.0/tests/test_reliability.py +271 -0
  51. padou-0.2.0/tests/test_server_progress.py +42 -0
  52. padou-0.2.0/tests/test_speed.py +175 -0
  53. padou-0.2.0/tests/test_tools.py +152 -0
  54. padou-0.2.0/tests/test_updates.py +152 -0
  55. padou-0.2.0/tests/test_windows_display.py +40 -0
  56. padou-0.2.0/tests/test_writes.py +305 -0
  57. padou-0.2.0/uv.lock +281 -0
padou-0.2.0/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ .pytest_cache/
5
+ dist/
6
+ build/
7
+ *.egg-info/
8
+ .env
9
+ .env.*
10
+ *.swp
@@ -0,0 +1,65 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0 (2026-11)
4
+
5
+ Faster on laptops, a new admin mode, optional web search, coding mode, and more reliable answers. Now on PyPI (`uv tool install padou`) and the AUR (`yay -S padou`).
6
+
7
+ - Packaging: published to PyPI by GitHub Actions on each release (trusted publishing, no stored tokens); an AUR package; `/update` upgrades PyPI installs from PyPI
8
+ - CONTRIBUTING.md, SECURITY.md (private vulnerability reporting), issue and pull request templates
9
+ - A rewritten README with fresh screenshots
10
+ - `/web on|off`: optional web search for the session, off by default, shown as `web` in the status line. Providers: DuckDuckGo (no account), your own SearXNG, or the Brave Search API. Never reads pages on your computer or local network
11
+ - `man_page` tool: the model reads the real manuals installed on your computer (or just the parts about one option) instead of guessing options
12
+ - More honest answers: the instructions tell the model to check first, never invent paths, options or settings, and say when its knowledge may be out of date. The context now includes your desktop, session type (Wayland/X11) and terminal
13
+ - Recovering from tool mistakes: broken calls get an example of a correct one, calls written as text are run as real calls, and a call that keeps failing is stopped after two tries
14
+ - Long tool output keeps its start and end, with a note about what was skipped
15
+ - Auto-compact: near a full context, older messages are summarised automatically and the last exchange is kept (`auto_compact` under `[chat]`)
16
+ - A quiet speed line under each answer: `3.1s · 140 tokens · 22 tok/s` (`reply_stats` under `[ui]`)
17
+ - `padou bench`: score the current model on 17 fixed questions (two about code) in a practice folder, saved for comparison
18
+ - Coding mode, when padou starts in a project: `@path` attaches a file (Tab completes it); the project's own test, lint and build commands can be run by the model in edit/admin mode after you approve (or allow them for the session); `/review` reviews uncommitted git changes; `d` in the confirmation box opens the change as a diff in VS Code / Code OSS / VSCodium; `/tutor` explains and hints instead of writing the code; `git_diff` and `git_diff_staged` commands
19
+ - Enter on a suggestion (a file after `@`, a folder) takes the suggestion instead of sending the message; on a command name (`/he` → `/help`) it runs the command
20
+ - A misspelled `@file` is reported (`no such file; did you mean …?`) instead of silently ignored, and a failed tool call keeps a readable title (`Read src/main.py`)
21
+ - `/retry` asks the last question again; `/copy code [n]` copies just a code block; `/export [file]` saves the conversation as Markdown
22
+ - While a tool runs, the spinner says what it's doing (`running disk_usage…`, `reading ~/x.conf…`, `searching the web…`)
23
+ - `/exit && stop` (or `/exit stop`) quits and stops the model server
24
+ - `/help` in groups; `/undo list` (also `/changes`); `/tools`, `/system` and `/screenshot` still work but are no longer listed
25
+
26
+ - `/mode read | edit | admin` replaces `/write` (which still works, as the old name of `/mode edit`). `Shift+Tab` switches between read-only and edit, quietly: the status line shows the mode
27
+ - Admin mode: change files anywhere, outside the start folder too. System files go through `sudo` (you type your password into sudo, never into padou), get a copy kept for `/undo` instead of the Trash, and are marked `· sudo`. The first time, admin mode explains itself and asks; after that it just switches. Deletes need the name typed, also for files. Never secrets, `/proc`, `/sys`, `/dev`, `/run`, `/boot`, your home folder or a main system folder as a whole
28
+ - An audit log: every change and undo goes to `changes.log` in padou's state folder
29
+ - The status line shows `read-only`, `✎ edit: <folder>` or `✎ admin: anywhere`
30
+
31
+ - Live progress while padou works: elapsed time, then tokens and speed as the reply streams
32
+ - `Esc` stops a reply and keeps what was written so far (`Ctrl+C` still cancels it completely)
33
+ - `/think [on|off]`: let thinking models (Qwen3.5) reason before answering, per session; `thinking` under `[chat]` sets the default. Off by default, because it's much slower on a laptop
34
+ - Shows "thinking…" or "choosing a tool…" while the model works, instead of a silent spinner
35
+ - llama.cpp keeps the conversation in its prompt cache between questions (`cache_prompt`, and `--cache-reuse 256` in new setups), so replies start sooner
36
+ - `padou setup` gives a 16K context on machines with 16 GB of RAM (was 8K), and restarts an already-running model server so new settings take effect; `padou doctor` suggests re-running setup when an older config misses these
37
+ - `/clear` also clears the screen (and scrollback), then redraws the banner
38
+ - `/models remove <n>`: free the space of a downloaded model (to the Trash; Ollama models are deleted), never the one in use
39
+
40
+ ## 0.1.0 (2026-10)
41
+
42
+ First release.
43
+
44
+ - Runs on Linux, macOS and Windows (native, PowerShell installer `install.ps1`), tested on all three by GitHub Actions
45
+ - Write mode can also rewrite whole files, create folders, move/rename, and delete to the system Trash; every change in a confirmation box, folders need their name typed, `/undo` for all of them
46
+ - A progress bar while the model downloads on the first start (and up to an hour to finish, instead of 5 minutes)
47
+ - Update check once a day in the background, and `/update` to install (`[updates] check = false` turns the check off)
48
+ - The compass star: a launch animation (dots gather from everywhere, παντού decodes to padou), rays that keep pulsing, and a pulsing star in the status line
49
+ - Terminal chat with streaming Markdown and a status line
50
+ - Read-only tools: `read_file`, `list_dir`, `search`, and 20 approved system commands
51
+ - Safety rules: no shell, no sudo, validated arguments, secrets blocked (symlinks included), capped output
52
+ - Slash commands: `/help`, `/clear`, `/models`, `/status`, `/copy`, `/tools`, `/resume`, `/compact`, `/doctor`, `/system`, `/exit`
53
+ - Saved sessions with `/resume` and `padou -c`
54
+ - `/screenshot` saves the screen as an SVG image
55
+ - Folder access: tools read only the start folder by default; `/folder add|remove|anywhere|restrict`, `[tools] scope` and `folders`
56
+ - Disclaimer (DISCLAIMER.md) and a one-time notice on first run
57
+ - Windows (WSL) install guide; `/copy` uses `clip.exe` under WSL
58
+ - Write mode: `/write <folder>`, `edit_file`/`write_file` with a diff and approval for every change, backups, `/undo`, `/changes`
59
+ - `/server` status, stop, restart and log; `[server] stop_on_exit`
60
+ - `/models` switches models in one step: restarts llama-server with the new one (downloading it once if needed) or pulls it with Ollama, and saves it as your default
61
+ - Eight models to choose from, by Alibaba (Qwen3.5 2B/4B/9B), IBM (Granite 4.0 Micro), Mistral AI (Ministral 3 3B/8B), Microsoft (Phi-4-mini) and Google (Gemma 4 E4B)
62
+ - `padou setup`: first-run wizard that detects OS, GPU, RAM and model servers, recommends a model and writes the config
63
+ - Starts llama-server (or `ollama serve`) automatically when nothing is running on localhost
64
+ - Works with llama.cpp, Ollama and LM Studio
65
+ - Omarchy theme colours (Omarchy 4 and older), with a built-in palette elsewhere
@@ -0,0 +1,69 @@
1
+ # Contributing to padou
2
+
3
+ Thanks for helping! padou is a small project: bug reports, test results on your hardware, ideas and pull requests are all welcome.
4
+
5
+ ## Reporting a bug
6
+
7
+ Open an [issue](https://github.com/padou-dev/padou/issues/new/choose) and include:
8
+
9
+ - the output of `padou doctor` (it shows your system, model server, model and config problems; it contains no secrets);
10
+ - what you typed, what you expected, and what happened (a screenshot helps; `/screenshot` saves one as an SVG);
11
+ - the model you use. Many oddities are the model's, not padou's: `padou bench` shows how well a model works with padou.
12
+
13
+ Security problems: please **don't** open a public issue; see [SECURITY.md](SECURITY.md).
14
+
15
+ ## Setting up
16
+
17
+ ```bash
18
+ git clone https://github.com/padou-dev/padou
19
+ cd padou
20
+ uv sync # creates .venv with padou and its dependencies
21
+ uv run pytest -q # the tests: they need no model server and touch nothing outside temp folders
22
+ uv tool install --editable . # the `padou` command, running straight from your clone
23
+ ```
24
+
25
+ You don't need a GPU or a model to work on most of padou: the tests use fake model servers.
26
+
27
+ ## Making a change
28
+
29
+ - **Keep it small-model friendly.** Every word in the system prompt and every tool description is read on every question by a 4B model on a laptop. Short and precise beats complete.
30
+ - **Safety rules live in one place:** `tools.py` (what may be read or run) and `writes.py` (what may be changed). A change there needs tests, including the cases that must be refused.
31
+ - **All three systems.** padou runs on Linux, macOS and Windows; differences go through `compat.py`. GitHub Actions runs the tests on all three for every push and pull request.
32
+ - **Tests:** add or update tests in `tests/` for what you change. `uv run pytest -q` must pass.
33
+ - **Plain language** in messages and docs: padou is used by beginners. Say what happened and what to do next.
34
+ - **CHANGELOG.md:** add a line under *Unreleased* for anything a user would notice.
35
+
36
+ Then open a pull request describing what changed and why, and how you tested it.
37
+
38
+ ## Releasing (maintainers)
39
+
40
+ ### Once: set up PyPI trusted publishing
41
+
42
+ 1. Create an account on [pypi.org](https://pypi.org) and turn on two-factor authentication.
43
+ 2. Go to *Your projects → Publishing* (for the first release: *Add a new pending publisher*) and fill in: project name `padou`, owner `padou-dev`, repository `padou`, workflow `release.yml`, environment `pypi`.
44
+ 3. On GitHub: *Settings → Environments → New environment* named `pypi`. Optionally add yourself as a required reviewer, so every upload waits for your OK.
45
+
46
+ No password or token is stored anywhere: PyPI trusts uploads that come from that workflow in this repository.
47
+
48
+ ### Each release
49
+
50
+ 1. Set the version in `pyproject.toml` and `src/padou/__init__.py`, and turn *Unreleased* in `CHANGELOG.md` into `## X.Y.Z (date)`.
51
+ 2. Commit, push, and wait for the tests to pass on all three systems.
52
+ 3. Tag and push: `git tag -a vX.Y.Z -m "padou X.Y.Z" && git push origin vX.Y.Z`
53
+ 4. On GitHub: *Releases → Draft a new release*, pick the tag, title `padou X.Y.Z`, paste the changelog section, *Publish*. The `release` workflow checks the tag matches the version, runs the tests, builds and uploads to PyPI. Everyone's padou then shows the update notice within a day, and `/update` installs it.
54
+
55
+ ### The AUR package
56
+
57
+ The package files are in `contrib/aur/`. First time: create an account on [aur.archlinux.org](https://aur.archlinux.org) and add your SSH public key in *My Account*. Then:
58
+
59
+ ```bash
60
+ git clone ssh://aur@aur.archlinux.org/padou.git aur-padou
61
+ cp contrib/aur/PKGBUILD aur-padou/
62
+ cd aur-padou
63
+ updpkgsums # fills in the checksum of the release tarball
64
+ makepkg -si # build, run the tests and install it locally, as a check
65
+ makepkg --printsrcinfo > .SRCINFO
66
+ git add PKGBUILD .SRCINFO && git commit -m "padou X.Y.Z" && git push
67
+ ```
68
+
69
+ For each new release: change `pkgver` (and set `pkgrel=1`) in `PKGBUILD`, and repeat from `updpkgsums`.
@@ -0,0 +1,43 @@
1
+ # Disclaimer
2
+
3
+ padou is a free, open-source hobby project, provided **"as is", without warranty of any kind**, as stated in the [MIT License](LICENSE). By installing or using padou you accept the following.
4
+
5
+ ## No warranty, no liability
6
+
7
+ To the maximum extent permitted by applicable law, the author(s) and contributors are **not liable** for any claim, damages, data loss, system damage, security incident or other liability arising from the use of, or inability to use, padou, whether in contract, tort or otherwise. You use padou entirely **at your own risk**.
8
+
9
+ ## AI output can be wrong
10
+
11
+ padou passes your questions to a language model running on your own machine. Language models, small local ones especially, can and do produce answers that are **incorrect, incomplete, outdated or misleading**, including invented commands, file contents or explanations that sound confident.
12
+
13
+ - **Always review and understand a command before you run it.** padou suggests commands; *you* decide whether to run them, and you are solely responsible for what you run on your systems.
14
+ - Verify important information against official documentation or a qualified person.
15
+ - Keep backups of anything you can't afford to lose.
16
+
17
+ ## Not for critical decisions
18
+
19
+ padou is not designed, tested or suitable for medical, legal, financial, safety-critical, security-critical or other high-stakes decisions. Do not rely on it for them.
20
+
21
+ ## Write mode: you approve, you are responsible
22
+
23
+ padou is read-only unless **you** switch modes with `/mode`. In edit mode padou can edit, create, move and delete files and folders in the folder you chose (deleting means moving them to your system's Trash or Recycle Bin); in admin mode it can do so anywhere on your computer, including system files through `sudo` with your password. Either way, only after showing you each change and getting your approval. System files changed in admin mode can break your system; padou keeps copies for `/undo`, but that is a convenience, not a guarantee. **Every change you approve is your decision and your responsibility.** Read each confirmation box carefully: language models can propose wrong, incomplete or destructive changes, and text inside files you ask padou to read can try to manipulate the model into proposing changes you didn't ask for ("prompt injection"). Backups, the Trash and `/undo` are a convenience, not a guarantee: some drives have no Trash, a Trash can be emptied, and large deletions aren't backed up by padou. Keep your own backups, and use version control such as Git.
24
+
25
+ ## Safeguards, not guarantees
26
+
27
+ padou's read tools are designed to be read-only: they run no shell, never use `sudo`, validate their arguments, and block known secret locations (SSH keys, password stores, `.env` files and similar). Write mode adds its own limits (approval for every change, typing a folder's name to delete it, the Trash instead of permanent deletion, backups, no system or hidden folders). These safeguards reduce risk; **they are not a guarantee**. Software has bugs, and a tool that reads files can still show their contents to the model and on your screen. Only run padou on systems and data you are entitled to access, and don't point it at folders containing information you aren't comfortable having read.
28
+
29
+ ## Third-party software and models
30
+
31
+ padou does not include any AI model. Models (for example Qwen by Alibaba, Gemma by Google, Phi by Microsoft, Granite by IBM or Ministral by Mistral AI) and model servers (llama.cpp, Ollama, LM Studio) are **third-party** software, downloaded by those tools from their own sources and governed by **their own licences and terms**. Check the licence on each model's page before use, especially for commercial use. The author of padou is not responsible for third-party software, models or the content they produce.
32
+
33
+ ## No affiliation
34
+
35
+ padou is an independent project. It is not affiliated with, endorsed by or sponsored by Alibaba (Qwen), Google (Gemma), Microsoft (Phi), IBM (Granite), Mistral AI (Ministral), the llama.cpp project, Ollama, LM Studio, Omarchy, Anthropic or any other company or project named in its documentation. All trademarks belong to their respective owners.
36
+
37
+ ## Privacy
38
+
39
+ padou has no telemetry. It sends your conversations only to the model server you configure (by default, on your own machine). At most once a day it asks GitHub's public API for the latest padou release, which sends nothing about you or your conversations; turn it off with `[updates] check = false`. Conversations are saved locally on your computer (see "Where padou keeps things" in the README). You are responsible for the data you choose to share with the model and for protecting your own machine.
40
+
41
+ ---
42
+
43
+ *This disclaimer is not legal advice. If you need legal certainty for your situation, consult a lawyer.*
padou-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 p@nos
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.