drydock-cli 3.0.20__tar.gz → 3.0.22__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 (50) hide show
  1. {drydock_cli-3.0.20/drydock_cli.egg-info → drydock_cli-3.0.22}/PKG-INFO +1 -1
  2. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/__init__.py +1 -1
  3. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/detect.py +5 -3
  4. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tools/__init__.py +12 -0
  5. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/app.py +55 -7
  6. {drydock_cli-3.0.20 → drydock_cli-3.0.22/drydock_cli.egg-info}/PKG-INFO +1 -1
  7. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/pyproject.toml +1 -1
  8. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_detect.py +2 -0
  9. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_guards_and_tools.py +13 -0
  10. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/LICENSE +0 -0
  11. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/NOTICE +0 -0
  12. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/README.md +0 -0
  13. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/__main__.py +0 -0
  14. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/agent.py +0 -0
  15. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/bash_safety.py +0 -0
  16. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/cli.py +0 -0
  17. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/compaction.py +0 -0
  18. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/config.py +0 -0
  19. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/guards.py +0 -0
  20. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/loop_detect.py +0 -0
  21. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/providers.py +0 -0
  22. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tool_registry.py +0 -0
  23. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/__init__.py +0 -0
  24. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/approval.py +0 -0
  25. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/messages.py +0 -0
  26. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/widgets.py +0 -0
  27. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tuning.py +0 -0
  28. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/SOURCES.txt +0 -0
  29. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/dependency_links.txt +0 -0
  30. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/entry_points.txt +0 -0
  31. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/requires.txt +0 -0
  32. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/top_level.txt +0 -0
  33. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/setup.cfg +0 -0
  34. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_approval.py +0 -0
  35. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_back_command.py +0 -0
  36. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_bash_safety.py +0 -0
  37. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_cli_agents.py +0 -0
  38. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_compaction.py +0 -0
  39. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_config.py +0 -0
  40. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_hallucinated_tools.py +0 -0
  41. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_leaked_tool_call.py +0 -0
  42. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_loop_detect.py +0 -0
  43. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_plan_autocontinue.py +0 -0
  44. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_providers_unreachable.py +0 -0
  45. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_stop.py +0 -0
  46. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_subagent.py +0 -0
  47. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_todo.py +0 -0
  48. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_tools_undo.py +0 -0
  49. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_tui.py +0 -0
  50. {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_tuning.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drydock-cli
3
- Version: 3.0.20
3
+ Version: 3.0.22
4
4
  Summary: Drydock — a local, provider-agnostic terminal coding agent for local LLMs
5
5
  Author: Frank Bobe III
6
6
  License-Expression: Apache-2.0
@@ -7,4 +7,4 @@ try:
7
7
  __version__ = _version("drydock-cli")
8
8
  except PackageNotFoundError:
9
9
  # Running from source before install (e.g. PYTHONPATH dev runs).
10
- __version__ = "3.0.20"
10
+ __version__ = "3.0.22"
@@ -61,9 +61,11 @@ def onboarding_message(found: list[dict]) -> str:
61
61
  if not found:
62
62
  ports = ", ".join(b.split("//")[1] for _, b in CANDIDATES)
63
63
  return (
64
- "No local LLM detected (" + ports + "). Start a server "
65
- "(llama.cpp / vLLM / Ollama / LM Studio), or set base_url in "
66
- "~/.drydock/config.toml, then restart."
64
+ "No local LLM detected (" + ports + "). Point Drydock at your model "
65
+ "right here:\n"
66
+ " /model url <http://host:port/v1> then /model <model-name>\n"
67
+ "(saved to ~/.drydock/config.toml). Or start a local server "
68
+ "(llama.cpp / vLLM / Ollama / LM Studio) and restart."
67
69
  )
68
70
  best = found[0]
69
71
  model = best["models"][0] if best["models"] else "?"
@@ -401,6 +401,18 @@ def tool_edit(params: dict, config: dict) -> str:
401
401
  if count > 1:
402
402
  return f"Error: old_string found {count} times in {fp}. Add more context to make it unique."
403
403
  updated = content.replace(old, new, 1)
404
+ if updated == content:
405
+ # No-op edit (old_string == new_string, or the replacement changes
406
+ # nothing). Reporting "Edited" here is a false success that invites
407
+ # the model to re-issue the identical call forever. Tell it plainly
408
+ # that nothing changed and to move on — this is what breaks the
409
+ # same-file edit-thrash loop at its source.
410
+ return (
411
+ f"No change: that edit leaves {fp} byte-for-byte identical "
412
+ f"(old_string and new_string are effectively the same). Nothing "
413
+ f"was written. Do NOT repeat this edit — the file already has "
414
+ f"this content, so move on to your next step."
415
+ )
404
416
  Path(fp).write_text(updated, encoding="utf-8")
405
417
  _record_undo(config, fp, content)
406
418
  result = f"Edited {fp}: replaced {len(old)} chars with {len(new)} chars"
@@ -405,7 +405,8 @@ class DrydockApp(App):
405
405
  self._info(
406
406
  "Commands:\n"
407
407
  " /help this help\n"
408
- " /model [name] show or switch the model\n"
408
+ " /model show/set model, provider, endpoint URL\n"
409
+ " /model <name> · /model url <url> · /model provider <p>\n"
409
410
  " /cwd [path] show or change the working directory\n"
410
411
  " /undo revert the last file write/edit\n"
411
412
  " /back rewind the last turn from the model's context\n"
@@ -418,14 +419,61 @@ class DrydockApp(App):
418
419
  else:
419
420
  self._mount(ErrorMessage(f"unknown command: {cmd} (try /help)"))
420
421
 
421
- def _cmd_model(self, name: str) -> None:
422
- if not name:
423
- self._info(f"model: {self.config.get('model')}")
422
+ def _persist_config(self) -> None:
423
+ """Save the persistable settings (model/provider/base_url/… — save_file
424
+ filters to those) to ~/.drydock/config.toml so setup survives restart."""
425
+ from drydock import config as cfgmod
426
+
427
+ ok = cfgmod.save_file(self.config, cfgmod.default_config_path())
428
+ if not ok:
429
+ self._mount(ErrorMessage("could not write ~/.drydock/config.toml"))
430
+
431
+ def _cmd_model(self, arg: str) -> None:
432
+ """Model + endpoint setup. Subcommands persist so they survive restart:
433
+ /model show model, provider, endpoint
434
+ /model <name> set the model name
435
+ /model url <base_url> set the server URL (e.g. http://host:8000/v1)
436
+ /model provider <name> vllm | ollama | lmstudio | openai
437
+ """
438
+ arg = (arg or "").strip()
439
+ if not arg:
440
+ prov = self.config.get("provider") or "(default)"
441
+ url = self.config.get("base_url") or "(provider default)"
442
+ self._info(
443
+ f"model: {self.config.get('model')}\n"
444
+ f"provider: {prov}\n"
445
+ f"endpoint: {url}\n"
446
+ "Set up: /model <name> · /model url <http://host:port/v1> · "
447
+ "/model provider <vllm|ollama|lmstudio|openai>"
448
+ )
449
+ return
450
+ parts = arg.split(maxsplit=1)
451
+ sub = parts[0].lower()
452
+ val = parts[1].strip() if len(parts) > 1 else ""
453
+ if sub == "url":
454
+ if not val:
455
+ self._info("usage: /model url <http://host:port/v1>")
456
+ return
457
+ self.config["base_url"] = val
458
+ self._persist_config()
459
+ self._info(f"endpoint → {val} (saved). Send a prompt to test it.")
460
+ return
461
+ if sub == "provider":
462
+ from drydock.providers import PROVIDERS
463
+
464
+ if val not in PROVIDERS:
465
+ self._info(f"unknown provider {val!r}. Choose: {', '.join(PROVIDERS)}")
466
+ return
467
+ self.config["provider"] = val
468
+ self._persist_config()
469
+ self._info(f"provider → {val} (saved)")
424
470
  return
425
- self.config["model"] = name
426
- self.system = self._build_system(name) # prompt may be model-specific
471
+ # Otherwise: set the model name (the whole arg, so names with spaces work).
472
+ self.config["model"] = arg
473
+ self.system = self._build_system(arg) # prompt may be model-specific
474
+ self._persist_config()
427
475
  self._refresh_status()
428
- self._info(f"switched model → {name}")
476
+ self._info(f"model → {arg} (saved)")
429
477
 
430
478
  def _cmd_cwd(self, path: str) -> None:
431
479
  if not path:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drydock-cli
3
- Version: 3.0.20
3
+ Version: 3.0.22
4
4
  Summary: Drydock — a local, provider-agnostic terminal coding agent for local LLMs
5
5
  Author: Frank Bobe III
6
6
  License-Expression: Apache-2.0
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
  # PyPI distribution name is drydock-cli (the established install name, continued
8
8
  # from the retired v2 fork); the import package + CLI command stay `drydock`.
9
9
  name = "drydock-cli"
10
- version = "3.0.20"
10
+ version = "3.0.22"
11
11
  description = "Drydock — a local, provider-agnostic terminal coding agent for local LLMs"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.12"
@@ -71,3 +71,5 @@ def test_onboarding_message_when_nothing_found():
71
71
  msg = detect.onboarding_message([])
72
72
  assert "No local LLM detected" in msg
73
73
  assert "config.toml" in msg
74
+ # New users must learn how to point Drydock at their model from the TUI.
75
+ assert "/model url" in msg and "/model" in msg
@@ -263,6 +263,19 @@ def test_tool_edit_fuzzy_applies_unique_near_miss(tmp_path):
263
263
  assert "compute2" in fp.read_text()
264
264
 
265
265
 
266
+ def test_tool_edit_noop_when_old_equals_new(tmp_path):
267
+ # old_string == new_string changes nothing. Reporting "Edited" is a false
268
+ # success that loops a weak model; it must say "No change" and not write.
269
+ fp = tmp_path / "f.py"
270
+ fp.write_text("a = 1\n")
271
+ out = tool_edit(
272
+ {"file_path": str(fp), "old_string": "a = 1", "new_string": "a = 1"}, {}
273
+ )
274
+ assert "No change" in out and "Edited" not in out
275
+ assert "move on" in out.lower()
276
+ assert fp.read_text() == "a = 1\n" # untouched
277
+
278
+
266
279
  def test_tool_edit_fuzzy_refuses_indent_mismatch(tmp_path):
267
280
  # If the near-miss differs in INDENT, applying the model's new_string would
268
281
  # corrupt the file — so it must error (and show the real text) instead.
File without changes
File without changes
File without changes
File without changes