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.
- {drydock_cli-3.0.20/drydock_cli.egg-info → drydock_cli-3.0.22}/PKG-INFO +1 -1
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/__init__.py +1 -1
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/detect.py +5 -3
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tools/__init__.py +12 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/app.py +55 -7
- {drydock_cli-3.0.20 → drydock_cli-3.0.22/drydock_cli.egg-info}/PKG-INFO +1 -1
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/pyproject.toml +1 -1
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_detect.py +2 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_guards_and_tools.py +13 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/LICENSE +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/NOTICE +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/README.md +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/__main__.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/agent.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/bash_safety.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/cli.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/compaction.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/config.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/guards.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/loop_detect.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/providers.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tool_registry.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/__init__.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/approval.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/messages.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tui/widgets.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock/tuning.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/SOURCES.txt +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/dependency_links.txt +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/entry_points.txt +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/requires.txt +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/drydock_cli.egg-info/top_level.txt +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/setup.cfg +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_approval.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_back_command.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_bash_safety.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_cli_agents.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_compaction.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_config.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_hallucinated_tools.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_leaked_tool_call.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_loop_detect.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_plan_autocontinue.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_providers_unreachable.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_stop.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_subagent.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_todo.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_tools_undo.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_tui.py +0 -0
- {drydock_cli-3.0.20 → drydock_cli-3.0.22}/tests/test_tuning.py +0 -0
|
@@ -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 + ").
|
|
65
|
-
"
|
|
66
|
-
"
|
|
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
|
|
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
|
|
422
|
-
|
|
423
|
-
|
|
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
|
-
|
|
426
|
-
self.
|
|
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"
|
|
476
|
+
self._info(f"model → {arg} (saved)")
|
|
429
477
|
|
|
430
478
|
def _cmd_cwd(self, path: str) -> None:
|
|
431
479
|
if not path:
|
|
@@ -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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|