dscli-agent 0.1.0__tar.gz → 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 (35) hide show
  1. {dscli_agent-0.1.0/dscli_agent.egg-info → dscli_agent-0.2.0}/PKG-INFO +56 -8
  2. dscli_agent-0.1.0/PKG-INFO → dscli_agent-0.2.0/README.md +397 -379
  3. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/__init__.py +1 -1
  4. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/agent.py +201 -49
  5. dscli_agent-0.2.0/dscli/branding.py +30 -0
  6. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/browser.py +2 -0
  7. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/cli.py +64 -3
  8. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/config.py +16 -0
  9. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/display.py +37 -1
  10. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/prompts.py +63 -9
  11. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/protocol.py +4 -0
  12. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/tools.py +177 -12
  13. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/tui.py +183 -34
  14. dscli_agent-0.1.0/README.md → dscli_agent-0.2.0/dscli_agent.egg-info/PKG-INFO +427 -349
  15. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli_agent.egg-info/SOURCES.txt +1 -0
  16. dscli_agent-0.2.0/tests/test_agent.py +449 -0
  17. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/tests/test_browser.py +21 -0
  18. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/tests/test_cli.py +168 -3
  19. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/tests/test_display.py +132 -1
  20. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/tests/test_protocol.py +37 -0
  21. dscli_agent-0.2.0/tests/test_tools.py +261 -0
  22. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/tests/test_tui.py +149 -3
  23. dscli_agent-0.1.0/tests/test_agent.py +0 -140
  24. dscli_agent-0.1.0/tests/test_tools.py +0 -97
  25. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/LICENSE +0 -0
  26. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/__main__.py +0 -0
  27. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/attachments.py +0 -0
  28. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/scraper.py +0 -0
  29. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli/ui.py +0 -0
  30. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli_agent.egg-info/dependency_links.txt +0 -0
  31. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli_agent.egg-info/entry_points.txt +0 -0
  32. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli_agent.egg-info/requires.txt +0 -0
  33. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/dscli_agent.egg-info/top_level.txt +0 -0
  34. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/pyproject.toml +0 -0
  35. {dscli_agent-0.1.0 → dscli_agent-0.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dscli-agent
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: A local coding agent that uses the DeepSeek web chat UI as its model
5
5
  Author: Anish
6
6
  License-Expression: MIT
@@ -103,12 +103,20 @@ Start dscli without a task to open an ongoing conversation:
103
103
  dscli
104
104
  ```
105
105
 
106
- dscli shows an inline terminal UI inspired by Claude Code: an animated spinner with
107
- rotating status verbs, a smoothly revealed streaming answer, compact tool cards
108
- (`⏺ Read(...)`, `⏺ Update(...)`, `⏺ Run(...)`), colored diffs for approvals, and the
109
- final answer rendered as Markdown. Output stays in normal scrollback; dscli does not
110
- take over the full screen, and startup shows only `Starting agent` instead of browser
111
- or session internals.
106
+ dscli shows an inline terminal UI inspired by Claude Code: a cleared screen and gradient
107
+ ASCII wordmark on launch, an animated spinner with rotating status verbs, a smoothly
108
+ revealed streaming answer, compact tool cards (`⏺ Read(...)`, `⏺ Update(...)`,
109
+ `⏺ Run(...)`), colored diffs for approvals, and the final answer rendered as Markdown.
110
+ Output stays in normal scrollback after startup; dscli does not take over the full
111
+ screen, and the welcome card shows the workspace, active modes, and shortcuts. Plans
112
+ render as a compact checklist, and a configured verification command appears as a
113
+ `Verify` card after file edits. `dscli chat --verify CMD` applies the check to each
114
+ message.
115
+
116
+ On launch, the visible terminal is cleared before the wordmark appears. Pass
117
+ `--no-clear` to `chat`, or set `DSCLI_NO_CLEAR=1`, to keep the previous screen contents;
118
+ the logo and welcome card still show. This behavior is TUI-only: `--plain`, non-TTY
119
+ output, `run`, `doctor`, `login`, and `config` keep their existing output.
112
120
 
113
121
  The agent session stays open while you work at the `❯` prompt. The complete JSON
114
122
  envelope is still parsed and validated before any tool runs. File approvals,
@@ -177,6 +185,10 @@ The final answer is printed to stdout. Progress, diffs, and approval prompts go
177
185
  stderr, so `dscli run ... > result.txt` captures only the answer. `run` never uses the
178
186
  interactive UI; its output contract is unchanged.
179
187
 
188
+ Exit codes: `0` success, `1` error, `2` model-turn budget exhausted, and `3`
189
+ verification failed (takes precedence over `2`). Verification failures are always
190
+ logged to stderr, including under `-q`.
191
+
180
192
  ### Common flags
181
193
 
182
194
  | Flag | Meaning |
@@ -190,7 +202,10 @@ interactive UI; its output contract is unchanged.
190
202
  | `--deepthink` / `--search` | Turn DeepSeek's modes on for the run. |
191
203
  | `--max-steps N` | Maximum model turns (default 12). |
192
204
  | `--timeout N` | Response timeout per turn in seconds (default 300). |
205
+ | `--verify CMD` | Run CMD automatically after file edits; failures block success. |
206
+ | `--no-verify` | Disable the configured `verify_command` for this run. |
193
207
  | `--prompt-file PATH` | Read the task from a UTF-8 file. |
208
+ | `--no-clear` | Keep previous terminal output when the TUI starts (chat only). |
194
209
  | `--no-auto-login` | Do not open a visible browser if a headless login is needed. |
195
210
  | `-v, --verbose` | Show model thoughts and raw replies. |
196
211
  | `-q, --quiet` | Only print the final answer. |
@@ -223,6 +238,8 @@ dscli parses the envelope (also tolerating unfenced JSON and small formatting
223
238
  variations), runs the tool calls locally, and sends the results back in the next
224
239
  message inside nonce-tagged markers. The loop ends when the model replies with
225
240
  `tool_calls: []` and a non-empty `final` string, or when the turn budget is exhausted.
241
+ Before a final is accepted, unfinished plan steps and the configured verification
242
+ command can send the model back for more work (see below).
226
243
 
227
244
  Malformed replies get up to two correction prompts. Every raw reply that fails to parse
228
245
  is saved to the debug directory.
@@ -237,10 +254,37 @@ is saved to the debug directory.
237
254
  | `list_files` | Bounded recursive listing. |
238
255
  | `delete_file` | Delete one file when explicitly requested (approval required). |
239
256
  | `run_command` | Run a shell command (only with `--allow-shell`, approval required). |
257
+ | `update_plan` | Create or revise the task plan; the final is deferred while steps are unfinished. |
240
258
 
241
259
  `apply_patch` normalises line endings for matching, preserves the file's encoding and
242
260
  line endings when writing, and refuses ambiguous matches unless `replace_all` is set.
243
261
 
262
+ ### Plan and verification loop
263
+
264
+ The agent can maintain a short task plan with `update_plan` (at most 20 steps). While
265
+ any step is `pending` or `in_progress`, dscli holds the final answer back and sends a
266
+ bounded reminder (at most two) asking the model to finish or revise the plan. If the
267
+ steps are still unfinished at the turn limit, the answer is accepted with a visible
268
+ "plan incomplete" warning rather than deadlocking the run. Plans apply to a single
269
+ message on chat and are reset for every new task.
270
+
271
+ Configure a verification command with `--verify CMD` or the `verify_command` config
272
+ key, for example:
273
+
274
+ ```powershell
275
+ dscli run -y --verify "python -m pytest -q" "Add a test for the parser"
276
+ ```
277
+
278
+ After a turn changes files, dscli runs the command itself, shows the result, and feeds
279
+ failures back to the model for up to two repair attempts. If the check still fails, the
280
+ run ends with the best available answer, marks verification as failed, and `dscli run`
281
+ exits with code `3`. Verification only runs when the current message changed files.
282
+
283
+ The verification command is supplied by you and is never a model-callable tool. It is
284
+ run without `--allow-shell` and without a per-command approval prompt because you
285
+ configured it explicitly. Treat it like any other command you run from the shell: the
286
+ model can modify the files it checks, so review the final diff.
287
+
244
288
  ## Approvals and safety
245
289
 
246
290
  - Tools are confined to the workspace unless `--allow-outside` is passed.
@@ -248,6 +292,9 @@ line endings when writing, and refuses ambiguous matches unless `replace_all` is
248
292
  - Every write, patch, delete, and command shows a diff/command and asks
249
293
  `[y]es / [n]o / [a]ll / [q]uit` before changing anything. `-y` skips the prompts.
250
294
  - Shell access is off by default and can be enabled only for a run.
295
+ - The verification command is the one exception to the approval flow: when you configure
296
+ it with `--verify` or `verify_command`, dscli runs it automatically after edits without
297
+ `--allow-shell` or a prompt. The model can neither call nor change it.
251
298
  - Attachment contents, file contents, command output, and tool results are treated as
252
299
  untrusted data by the system prompt.
253
300
  - No network access is performed by the tools; the only network traffic is the browser
@@ -274,7 +321,8 @@ session import), `chrome_profile` (empty = Chrome's last-used profile, or a name
274
321
  installed browser), `response_timeout_sec`, `first_response_timeout_sec`,
275
322
  `stable_seconds`, `fallback_stable_seconds`, `max_steps`, `max_tool_calls`,
276
323
  `max_read_chars`, `max_attachment_mb`, `deepthink`, `search`, `allow_shell`,
277
- `allow_outside`.
324
+ `allow_outside`, `verify_command` (empty disables verification),
325
+ `verify_timeout_sec` (clamped to 1–600, default 300).
278
326
 
279
327
  Headless Chrome normally sends a `HeadlessChrome/...` user agent, which DeepSeek's CDN
280
328
  rejects with a CloudFront 403. dscli automatically replaces it with the installed