zenagent-py 0.2.0__tar.gz → 0.2.2__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.
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/PKG-INFO +61 -12
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/README.md +60 -11
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/pyproject.toml +1 -1
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/pyproject.toml.orig +1 -1
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/__init__.py +1 -1
- zenagent_py-0.2.2/zenagent/agent/session.py +424 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/chat.py +1 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/commands.py +34 -1
- zenagent_py-0.2.2/zenagent/app/modes.py +83 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/permissions.py +70 -17
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/runtime.py +84 -6
- zenagent_py-0.2.2/zenagent/app/sessions.py +212 -0
- zenagent_py-0.2.2/zenagent/app/slash_args.py +56 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/compact.py +2 -2
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/completion.py +30 -1
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/doctor.py +9 -3
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/main.py +114 -30
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/repl.py +98 -17
- zenagent_py-0.2.2/zenagent/cli/sessionscmd.py +93 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/app.py +232 -26
- zenagent_py-0.2.2/zenagent/cli/tui/screens/modals.py +270 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/screens/palette.py +16 -2
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/command_hints.py +5 -2
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/prompt_input.py +20 -2
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/config.py +58 -4
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/mcp/config.py +25 -4
- zenagent_py-0.2.2/zenagent/project.py +205 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/retry.py +13 -1
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/skills.py +9 -2
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/templates.py +9 -2
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/usage.py +12 -9
- zenagent_py-0.2.0/zenagent/agent/session.py +0 -185
- zenagent_py-0.2.0/zenagent/app/permissions.py.append +0 -0
- zenagent_py-0.2.0/zenagent/app/sessions.py +0 -120
- zenagent_py-0.2.0/zenagent/cli/tui/screens/main.py +0 -25
- zenagent_py-0.2.0/zenagent/cli/tui/screens/modals.py +0 -104
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/agent/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/agent/agent.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/agent/loop.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/agent/validate.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/models.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/support.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/app/views.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/catalog.yaml +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/exportcmd.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/images.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/keybindings.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/permissions.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/render.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/rpc.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/theme.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/run.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/screens/secrets.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/status/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/status/presets.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/status/segments.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/theme.tcss +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/new_content.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/prompt_gutter.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/rows.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/sidebar.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/status_band.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/tool_card.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/transcript.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/welcome.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/tui/widgets/work_indicator.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/cli/usagecmd.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/context_files.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/crash.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/evals_runner.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/events.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/export.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/extensions.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/frontmatter.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/mcp/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/mcp/client.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/mcp/manager.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/anthropic_messages.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/catalog.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/compat.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/anthropic-badjson.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/anthropic-text.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/anthropic-thinking-toolcall.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/badjson-toolcall.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/deepseek-chat-live-text.request.json +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/deepseek-chat-live-text.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/deepseek-chat-live-toolcall.request.json +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/deepseek-chat-live-toolcall.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/deepseek-reasoner-live-thinking.request.json +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/deepseek-reasoner-live-thinking.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/deepseek-reasoner.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/google-text.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/google-toolcall.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/multi-tool-parallel.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/openai-responses-text.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/openai-responses-toolcall.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/zai-glm-5.3-text+thinking.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/fixtures/zai-glm-5.3-toolcall.txt +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/google_generative_ai.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/openai_completions.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/openai_responses.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/registry.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/providers/transport.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/settings.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/telemetry.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/bash.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/fs.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/search.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/web/__init__.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/web/net.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/web/providers.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/web/query.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/web/registry.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/web/tools.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/tools/web/types.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/trace.py +0 -0
- {zenagent_py-0.2.0 → zenagent_py-0.2.2}/zenagent/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: zenagent-py
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A minimal, Pythonic coding agent: streaming LLM client, async-generator agent loop, and terminal harness.
|
|
5
5
|
Keywords: agent,llm,ai,cli,async,coding-agent
|
|
6
6
|
Author: Justin Gao
|
|
@@ -91,6 +91,10 @@ uv run zen -p "what is in this picture?" --image shot.png
|
|
|
91
91
|
uv run zen -p "..." --max-turns 20 --max-cost 0.05 --no-context-files
|
|
92
92
|
uv run zen -p "analyze this" --read-only --trace run.jsonl --cwd /path/to/project
|
|
93
93
|
|
|
94
|
+
# runtime modes: plan = read-only, ask = confirm (default), full = automatic
|
|
95
|
+
uv run zen -p "investigate and propose a plan" --mode plan
|
|
96
|
+
uv run zen -p "apply the fix" --mode full
|
|
97
|
+
|
|
94
98
|
# structured output (a single JSON object; no streamed text)
|
|
95
99
|
uv run zen -p "say hi" --json
|
|
96
100
|
|
|
@@ -98,9 +102,12 @@ uv run zen -p "say hi" --json
|
|
|
98
102
|
uv run zen
|
|
99
103
|
```
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
Runtime modes: `plan` (read-only; the agent investigates and proposes a plan),
|
|
106
|
+
`ask` (default: write/execute tools need confirmation), `full` (run write/execute
|
|
107
|
+
tools without asking; catastrophic commands still need `--allow-dangerous`).
|
|
108
|
+
`--yes` means `full`, `--read-only` means `plan`, and `/mode plan|ask|full`
|
|
109
|
+
switches mid-session. Session display names come from the first question; rename
|
|
110
|
+
with `/rename <name>` (or `r` in the TUI session picker).
|
|
104
111
|
|
|
105
112
|
### Diagnostics
|
|
106
113
|
|
|
@@ -150,9 +157,11 @@ a direct MCP call, and a `zen rpc` client. For embedding with the full app layer
|
|
|
150
157
|
| `/clear` | forget the conversation |
|
|
151
158
|
| `/model [id]` | show / switch model (next turn) |
|
|
152
159
|
| `/thinking [level]` | `off` / `low` / `medium` / `high` / `max` |
|
|
160
|
+
| `/mode [plan\|ask\|full]` | show or switch the runtime permission mode |
|
|
153
161
|
| `/compact` | summarize the session into a new session file |
|
|
154
162
|
| `/undo` | drop the last turn (writes a new session file) |
|
|
155
|
-
| `/sessions` | list
|
|
163
|
+
| `/sessions [all]` | list this project's sessions (or all projects) |
|
|
164
|
+
| `/rename <name>` | rename the current session |
|
|
156
165
|
| `/fork <n>` | branch a new session at user message n |
|
|
157
166
|
| `/import <path>` | load a session file and continue it |
|
|
158
167
|
| `/image <path>` | attach an image for the next prompt |
|
|
@@ -162,12 +171,17 @@ a direct MCP call, and a `zen rpc` client. For embedding with the full app layer
|
|
|
162
171
|
| `/theme <name>` | `default` / `mono` / `solarized` / a JSON file |
|
|
163
172
|
| `/hotkeys` | show active keybindings |
|
|
164
173
|
|
|
174
|
+
Command arguments complete too (Tab): `/mode ` → plan/ask/full, `/thinking ` → levels,
|
|
175
|
+
`/model ` → catalog ids. In the TUI the same values appear as you type, and a bare
|
|
176
|
+
`/mode` or `/thinking` opens a selector.
|
|
177
|
+
|
|
165
178
|
While the agent is working, anything you type is queued as steering input
|
|
166
179
|
rather than starting a second run. Ctrl+C aborts the current run cooperatively.
|
|
167
180
|
|
|
168
181
|
## Configuration
|
|
169
182
|
|
|
170
|
-
Optional `~/.zenagent/config.toml
|
|
183
|
+
Optional `~/.zenagent/config.toml`, plus a committable `<project>/.zenagent/config.toml`
|
|
184
|
+
that layers on top (themes, keybindings and MCP live in their own files):
|
|
171
185
|
|
|
172
186
|
```toml
|
|
173
187
|
default_model = "deepseek-flash"
|
|
@@ -203,8 +217,12 @@ read/write separately). DeepSeek bills peak/off-peak; the catalog has no time
|
|
|
203
217
|
dimension, so peak rates are used — treat `usage.cost` as a conservative upper
|
|
204
218
|
bound. Providers with subscription pricing (zai, opencode-go) carry 0.
|
|
205
219
|
|
|
206
|
-
Sessions are append-only JSONL
|
|
207
|
-
|
|
220
|
+
Sessions are append-only JSONL scoped to the project they were started in:
|
|
221
|
+
`~/.zenagent/projects/<project-key>/sessions/`. `/sessions`, `--resume latest`,
|
|
222
|
+
`--list-sessions` and `zen export latest` default to the current project; add
|
|
223
|
+
`all`/`--all-projects` for a cross-project view. Sessions from before project
|
|
224
|
+
scoping stay in `~/.zenagent/sessions/` as read-only `legacy` entries and can be
|
|
225
|
+
moved with `zen sessions adopt PATH`. `--resume` continues the most recent one. Destructive-looking operations never rewrite a file: `/undo`,
|
|
208
226
|
`/fork` and `/compact` all write a new session and leave the old one intact. The file format is exactly the public message model, so it
|
|
209
227
|
can be inspected with `jq` or replayed elsewhere.
|
|
210
228
|
|
|
@@ -249,7 +267,6 @@ kill on timeout/abort), `glob`, `grep` (ripgrep when available, Python fallback)
|
|
|
249
267
|
|
|
250
268
|
```bash
|
|
251
269
|
bash scripts/check.sh # the gate: sync + ruff + pytest (CI runs exactly this)
|
|
252
|
-
bash scripts/check.sh # the gate: sync + ruff + pytest (CI runs exactly this)
|
|
253
270
|
uv run pytest -q # fully offline: fake stream fns + replayed SSE fixtures
|
|
254
271
|
./scripts/eval.sh # behavioral evals against a real model (opt-in, costs money)
|
|
255
272
|
```
|
|
@@ -266,8 +283,40 @@ code; they are separate from the offline gate:
|
|
|
266
283
|
`zenagent/providers/fixtures/` so the parser can be checked against the wire; the
|
|
267
284
|
replay tests skip when a capture is absent.
|
|
268
285
|
|
|
286
|
+
## Releasing
|
|
287
|
+
|
|
288
|
+
`zenagent-py` ships from a tag. Everything before the tag runs offline:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
bash scripts/check.sh # lint + tests
|
|
292
|
+
bash scripts/release-check.sh # build sdist/wheel, install both ways, run the CLI
|
|
293
|
+
git tag vX.Y.Z
|
|
294
|
+
git push origin main vX.Y.Z # the publish workflow re-runs the gate, then uploads
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
`release-check.sh` is the packaging gate: it asserts the version is consistent
|
|
298
|
+
(`pyproject.toml`, `__version__`, and the tag on HEAD), that the sdist and wheel
|
|
299
|
+
carry no dev or stray files, that a kernel-only install works (`pip install
|
|
300
|
+
zenagent-py`), and that a `[cli]` install starts (`zen --version`, TUI imports,
|
|
301
|
+
search providers, a settings round-trip in an isolated `$HOME`). It tests the
|
|
302
|
+
`requires-python` floor by default; pass `--python 3.13` for another
|
|
303
|
+
interpreter, or `--skip-build` to verify the existing `dist/`. It never uploads
|
|
304
|
+
and writes only under a temp dir.
|
|
305
|
+
|
|
306
|
+
`.github/workflows/publish.yml` runs the same gate before uploading. A manual run
|
|
307
|
+
is always a dry run — it builds and verifies but cannot publish; only a `v*` tag
|
|
308
|
+
push reaches PyPI:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
gh workflow run publish.yml # optional dry run on CI (build + verify only)
|
|
312
|
+
```
|
|
313
|
+
|
|
269
314
|
## Status
|
|
270
315
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
316
|
+
v1 (milestones 1–4), S1–S3 and the Textual TUI are complete; the offline suite
|
|
317
|
+
and recorded live captures are the gate (`docs/testing.md`). Implemented:
|
|
318
|
+
interactive REPL + TUI, MCP, skills/templates/extensions, RPC/SDK,
|
|
319
|
+
export/usage/telemetry, four protocol adapters, runtime modes
|
|
320
|
+
(`plan`/`ask`/`full`), session display names + rename, and TUI session
|
|
321
|
+
management (new/fork/delete/export/rename). Not yet: subagents and OS-level
|
|
322
|
+
sandboxing.
|
|
@@ -63,6 +63,10 @@ uv run zen -p "what is in this picture?" --image shot.png
|
|
|
63
63
|
uv run zen -p "..." --max-turns 20 --max-cost 0.05 --no-context-files
|
|
64
64
|
uv run zen -p "analyze this" --read-only --trace run.jsonl --cwd /path/to/project
|
|
65
65
|
|
|
66
|
+
# runtime modes: plan = read-only, ask = confirm (default), full = automatic
|
|
67
|
+
uv run zen -p "investigate and propose a plan" --mode plan
|
|
68
|
+
uv run zen -p "apply the fix" --mode full
|
|
69
|
+
|
|
66
70
|
# structured output (a single JSON object; no streamed text)
|
|
67
71
|
uv run zen -p "say hi" --json
|
|
68
72
|
|
|
@@ -70,9 +74,12 @@ uv run zen -p "say hi" --json
|
|
|
70
74
|
uv run zen
|
|
71
75
|
```
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
Runtime modes: `plan` (read-only; the agent investigates and proposes a plan),
|
|
78
|
+
`ask` (default: write/execute tools need confirmation), `full` (run write/execute
|
|
79
|
+
tools without asking; catastrophic commands still need `--allow-dangerous`).
|
|
80
|
+
`--yes` means `full`, `--read-only` means `plan`, and `/mode plan|ask|full`
|
|
81
|
+
switches mid-session. Session display names come from the first question; rename
|
|
82
|
+
with `/rename <name>` (or `r` in the TUI session picker).
|
|
76
83
|
|
|
77
84
|
### Diagnostics
|
|
78
85
|
|
|
@@ -122,9 +129,11 @@ a direct MCP call, and a `zen rpc` client. For embedding with the full app layer
|
|
|
122
129
|
| `/clear` | forget the conversation |
|
|
123
130
|
| `/model [id]` | show / switch model (next turn) |
|
|
124
131
|
| `/thinking [level]` | `off` / `low` / `medium` / `high` / `max` |
|
|
132
|
+
| `/mode [plan\|ask\|full]` | show or switch the runtime permission mode |
|
|
125
133
|
| `/compact` | summarize the session into a new session file |
|
|
126
134
|
| `/undo` | drop the last turn (writes a new session file) |
|
|
127
|
-
| `/sessions` | list
|
|
135
|
+
| `/sessions [all]` | list this project's sessions (or all projects) |
|
|
136
|
+
| `/rename <name>` | rename the current session |
|
|
128
137
|
| `/fork <n>` | branch a new session at user message n |
|
|
129
138
|
| `/import <path>` | load a session file and continue it |
|
|
130
139
|
| `/image <path>` | attach an image for the next prompt |
|
|
@@ -134,12 +143,17 @@ a direct MCP call, and a `zen rpc` client. For embedding with the full app layer
|
|
|
134
143
|
| `/theme <name>` | `default` / `mono` / `solarized` / a JSON file |
|
|
135
144
|
| `/hotkeys` | show active keybindings |
|
|
136
145
|
|
|
146
|
+
Command arguments complete too (Tab): `/mode ` → plan/ask/full, `/thinking ` → levels,
|
|
147
|
+
`/model ` → catalog ids. In the TUI the same values appear as you type, and a bare
|
|
148
|
+
`/mode` or `/thinking` opens a selector.
|
|
149
|
+
|
|
137
150
|
While the agent is working, anything you type is queued as steering input
|
|
138
151
|
rather than starting a second run. Ctrl+C aborts the current run cooperatively.
|
|
139
152
|
|
|
140
153
|
## Configuration
|
|
141
154
|
|
|
142
|
-
Optional `~/.zenagent/config.toml
|
|
155
|
+
Optional `~/.zenagent/config.toml`, plus a committable `<project>/.zenagent/config.toml`
|
|
156
|
+
that layers on top (themes, keybindings and MCP live in their own files):
|
|
143
157
|
|
|
144
158
|
```toml
|
|
145
159
|
default_model = "deepseek-flash"
|
|
@@ -175,8 +189,12 @@ read/write separately). DeepSeek bills peak/off-peak; the catalog has no time
|
|
|
175
189
|
dimension, so peak rates are used — treat `usage.cost` as a conservative upper
|
|
176
190
|
bound. Providers with subscription pricing (zai, opencode-go) carry 0.
|
|
177
191
|
|
|
178
|
-
Sessions are append-only JSONL
|
|
179
|
-
|
|
192
|
+
Sessions are append-only JSONL scoped to the project they were started in:
|
|
193
|
+
`~/.zenagent/projects/<project-key>/sessions/`. `/sessions`, `--resume latest`,
|
|
194
|
+
`--list-sessions` and `zen export latest` default to the current project; add
|
|
195
|
+
`all`/`--all-projects` for a cross-project view. Sessions from before project
|
|
196
|
+
scoping stay in `~/.zenagent/sessions/` as read-only `legacy` entries and can be
|
|
197
|
+
moved with `zen sessions adopt PATH`. `--resume` continues the most recent one. Destructive-looking operations never rewrite a file: `/undo`,
|
|
180
198
|
`/fork` and `/compact` all write a new session and leave the old one intact. The file format is exactly the public message model, so it
|
|
181
199
|
can be inspected with `jq` or replayed elsewhere.
|
|
182
200
|
|
|
@@ -221,7 +239,6 @@ kill on timeout/abort), `glob`, `grep` (ripgrep when available, Python fallback)
|
|
|
221
239
|
|
|
222
240
|
```bash
|
|
223
241
|
bash scripts/check.sh # the gate: sync + ruff + pytest (CI runs exactly this)
|
|
224
|
-
bash scripts/check.sh # the gate: sync + ruff + pytest (CI runs exactly this)
|
|
225
242
|
uv run pytest -q # fully offline: fake stream fns + replayed SSE fixtures
|
|
226
243
|
./scripts/eval.sh # behavioral evals against a real model (opt-in, costs money)
|
|
227
244
|
```
|
|
@@ -238,8 +255,40 @@ code; they are separate from the offline gate:
|
|
|
238
255
|
`zenagent/providers/fixtures/` so the parser can be checked against the wire; the
|
|
239
256
|
replay tests skip when a capture is absent.
|
|
240
257
|
|
|
258
|
+
## Releasing
|
|
259
|
+
|
|
260
|
+
`zenagent-py` ships from a tag. Everything before the tag runs offline:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
bash scripts/check.sh # lint + tests
|
|
264
|
+
bash scripts/release-check.sh # build sdist/wheel, install both ways, run the CLI
|
|
265
|
+
git tag vX.Y.Z
|
|
266
|
+
git push origin main vX.Y.Z # the publish workflow re-runs the gate, then uploads
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
`release-check.sh` is the packaging gate: it asserts the version is consistent
|
|
270
|
+
(`pyproject.toml`, `__version__`, and the tag on HEAD), that the sdist and wheel
|
|
271
|
+
carry no dev or stray files, that a kernel-only install works (`pip install
|
|
272
|
+
zenagent-py`), and that a `[cli]` install starts (`zen --version`, TUI imports,
|
|
273
|
+
search providers, a settings round-trip in an isolated `$HOME`). It tests the
|
|
274
|
+
`requires-python` floor by default; pass `--python 3.13` for another
|
|
275
|
+
interpreter, or `--skip-build` to verify the existing `dist/`. It never uploads
|
|
276
|
+
and writes only under a temp dir.
|
|
277
|
+
|
|
278
|
+
`.github/workflows/publish.yml` runs the same gate before uploading. A manual run
|
|
279
|
+
is always a dry run — it builds and verifies but cannot publish; only a `v*` tag
|
|
280
|
+
push reaches PyPI:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
gh workflow run publish.yml # optional dry run on CI (build + verify only)
|
|
284
|
+
```
|
|
285
|
+
|
|
241
286
|
## Status
|
|
242
287
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
288
|
+
v1 (milestones 1–4), S1–S3 and the Textual TUI are complete; the offline suite
|
|
289
|
+
and recorded live captures are the gate (`docs/testing.md`). Implemented:
|
|
290
|
+
interactive REPL + TUI, MCP, skills/templates/extensions, RPC/SDK,
|
|
291
|
+
export/usage/telemetry, four protocol adapters, runtime modes
|
|
292
|
+
(`plan`/`ask`/`full`), session display names + rename, and TUI session
|
|
293
|
+
management (new/fork/delete/export/rename). Not yet: subagents and OS-level
|
|
294
|
+
sandboxing.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "zenagent-py"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "A minimal, Pythonic coding agent: streaming LLM client, async-generator agent loop, and terminal harness."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
keywords = ["agent", "llm", "ai", "cli", "async", "coding-agent"]
|