drydock-cli 3.0.99__tar.gz → 3.0.101__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 (115) hide show
  1. {drydock_cli-3.0.99/drydock_cli.egg-info → drydock_cli-3.0.101}/PKG-INFO +1 -1
  2. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tools/__init__.py +23 -4
  3. {drydock_cli-3.0.99 → drydock_cli-3.0.101/drydock_cli.egg-info}/PKG-INFO +1 -1
  4. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock_cli.egg-info/SOURCES.txt +2 -0
  5. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/pyproject.toml +1 -1
  6. drydock_cli-3.0.101/tests/test_bash_stop_partial.py +50 -0
  7. drydock_cli-3.0.101/tests/test_edit_replace_all.py +37 -0
  8. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/LICENSE +0 -0
  9. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/NOTICE +0 -0
  10. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/README.md +0 -0
  11. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/__init__.py +0 -0
  12. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/__main__.py +0 -0
  13. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/advisor.py +0 -0
  14. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/agent.py +0 -0
  15. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/bash_safety.py +0 -0
  16. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/builtin_skills/__init__.py +0 -0
  17. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/builtin_skills/rmf-categorize.md +0 -0
  18. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/builtin_skills/rmf-control.md +0 -0
  19. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/builtin_skills/rmf-poam.md +0 -0
  20. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/builtin_skills/rmf-review.md +0 -0
  21. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/builtin_skills/stig-assess.md +0 -0
  22. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/builtin_skills/stig-remediate.md +0 -0
  23. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/cci.py +0 -0
  24. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/cli.py +0 -0
  25. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/compaction.py +0 -0
  26. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/config.py +0 -0
  27. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/detect.py +0 -0
  28. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/extract.py +0 -0
  29. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/gittools.py +0 -0
  30. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/graphrag.py +0 -0
  31. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/guards.py +0 -0
  32. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/loop_detect.py +0 -0
  33. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/mcp.py +0 -0
  34. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/poam.py +0 -0
  35. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/providers.py +0 -0
  36. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/rmf.py +0 -0
  37. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/rmf_graph.py +0 -0
  38. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/skills.py +0 -0
  39. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/stig.py +0 -0
  40. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tool_registry.py +0 -0
  41. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tui/__init__.py +0 -0
  42. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tui/app.py +0 -0
  43. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tui/approval.py +0 -0
  44. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tui/messages.py +0 -0
  45. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tui/widgets.py +0 -0
  46. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/tuning.py +0 -0
  47. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock/web.py +0 -0
  48. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock_cli.egg-info/dependency_links.txt +0 -0
  49. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock_cli.egg-info/entry_points.txt +0 -0
  50. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock_cli.egg-info/requires.txt +0 -0
  51. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/drydock_cli.egg-info/top_level.txt +0 -0
  52. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/setup.cfg +0 -0
  53. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_advisor.py +0 -0
  54. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_approval.py +0 -0
  55. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_back_command.py +0 -0
  56. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_background.py +0 -0
  57. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_binary_output.py +0 -0
  58. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_output_bounding.py +0 -0
  59. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_process_group.py +0 -0
  60. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_safety.py +0 -0
  61. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_sanitize.py +0 -0
  62. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_shell.py +0 -0
  63. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_stdin.py +0 -0
  64. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_timeout_network.py +0 -0
  65. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_bash_timeout_param.py +0 -0
  66. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_cci.py +0 -0
  67. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_cli_agents.py +0 -0
  68. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_compact_command.py +0 -0
  69. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_compaction.py +0 -0
  70. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_config.py +0 -0
  71. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_config_migration.py +0 -0
  72. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_context_limit_config.py +0 -0
  73. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_detect.py +0 -0
  74. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_dispatch.py +0 -0
  75. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_e2e_connected.py +0 -0
  76. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_empty_response.py +0 -0
  77. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_extract.py +0 -0
  78. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_failure_loop.py +0 -0
  79. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_first_run_setup.py +0 -0
  80. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_gittools.py +0 -0
  81. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_graphify_example.py +0 -0
  82. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_graphrag.py +0 -0
  83. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_grep_and_read_robust.py +0 -0
  84. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_guards_and_tools.py +0 -0
  85. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_hallucinated_tools.py +0 -0
  86. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_leaked_tool_call.py +0 -0
  87. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_loop_detect.py +0 -0
  88. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_mcp.py +0 -0
  89. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_oneshot_unreachable.py +0 -0
  90. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_plan_autocontinue.py +0 -0
  91. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_poam.py +0 -0
  92. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_providers_unreachable.py +0 -0
  93. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_read_index.py +0 -0
  94. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_rmf.py +0 -0
  95. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_rmf_graph.py +0 -0
  96. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_rmf_stig_graph.py +0 -0
  97. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_runaway_repetition.py +0 -0
  98. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_server_probe.py +0 -0
  99. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_skills.py +0 -0
  100. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_stig.py +0 -0
  101. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_stop.py +0 -0
  102. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_streaming_newlines.py +0 -0
  103. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_subagent.py +0 -0
  104. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_system_prompt_help.py +0 -0
  105. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_todo.py +0 -0
  106. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_tool_arg_coercion.py +0 -0
  107. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_tool_arg_parsing.py +0 -0
  108. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_tools_undo.py +0 -0
  109. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_tui.py +0 -0
  110. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_tuning.py +0 -0
  111. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_viewimage.py +0 -0
  112. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_vision_input.py +0 -0
  113. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_web_tools.py +0 -0
  114. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_write_content_coerce.py +0 -0
  115. {drydock_cli-3.0.99 → drydock_cli-3.0.101}/tests/test_xccdf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drydock-cli
3
- Version: 3.0.99
3
+ Version: 3.0.101
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
@@ -192,13 +192,16 @@ SCHEMAS = [
192
192
  },
193
193
  {
194
194
  "name": "Edit",
195
- "description": "Replace exact text in a file. old_string must match exactly.",
195
+ "description": "Replace exact text in a file. old_string must match exactly. "
196
+ "By default old_string must be unique; pass replace_all:true "
197
+ "to replace every occurrence.",
196
198
  "input_schema": {
197
199
  "type": "object",
198
200
  "properties": {
199
201
  "file_path": {"type": "string"},
200
202
  "old_string": {"type": "string", "description": "Exact text to find"},
201
203
  "new_string": {"type": "string", "description": "Replacement text"},
204
+ "replace_all": {"type": "boolean", "description": "Replace ALL occurrences (default false)"},
202
205
  },
203
206
  "required": ["file_path", "old_string", "new_string"],
204
207
  },
@@ -875,9 +878,15 @@ def tool_edit(params: dict, config: dict) -> str:
875
878
  f"to copy the exact text (including indentation)."
876
879
  )
877
880
  count = content.count(old)
878
- if count > 1:
879
- return f"Error: old_string found {count} times in {fp}. Add more context to make it unique."
880
- updated = content.replace(old, new, 1)
881
+ # replace_all (models expect it, like the standard Edit tool): replace
882
+ # EVERY occurrence. Without it, multiple matches are ambiguous error.
883
+ replace_all = bool(params.get("replace_all", False))
884
+ if count > 1 and not replace_all:
885
+ return (
886
+ f"Error: old_string found {count} times in {fp}. Add more context "
887
+ f"to make it unique, or pass replace_all: true to replace all."
888
+ )
889
+ updated = content.replace(old, new) if replace_all else content.replace(old, new, 1)
881
890
  if updated == content:
882
891
  # No-op edit (old_string == new_string, or the replacement changes
883
892
  # nothing). Reporting "Edited" here is a false success that invites
@@ -893,6 +902,8 @@ def tool_edit(params: dict, config: dict) -> str:
893
902
  Path(fp).write_text(updated, encoding="utf-8")
894
903
  _record_undo(config, fp, content)
895
904
  result = f"Edited {fp}: replaced {len(old)} chars with {len(new)} chars"
905
+ if replace_all and count > 1:
906
+ result += f" ({count} occurrences)"
896
907
  # Advisory post-edit syntax check.
897
908
  warn = python_syntax_warning(fp, updated)
898
909
  if warn:
@@ -1051,6 +1062,14 @@ def tool_bash(params: dict, config: dict) -> str:
1051
1062
  if cancel is not None and cancel.is_set():
1052
1063
  kill_process_group(proc)
1053
1064
  proc.wait()
1065
+ partial = _sanitize_bash_output(
1066
+ _collapse_repeated_lines("".join(list(chunks)))
1067
+ ).rstrip()
1068
+ if partial:
1069
+ tail = partial[-_PARTIAL_TAIL:]
1070
+ if len(partial) > _PARTIAL_TAIL:
1071
+ tail = "[... earlier output truncated ...]\n" + tail
1072
+ return f"[stopped by user]\n\n--- output before stop ---\n{tail}"
1054
1073
  return "[stopped by user]"
1055
1074
  # The SHELL has exited but the pipe is still open → the command
1056
1075
  # backgrounded a child (`cmd &`, a server the task wants to keep
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: drydock-cli
3
- Version: 3.0.99
3
+ Version: 3.0.101
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
@@ -57,6 +57,7 @@ tests/test_bash_safety.py
57
57
  tests/test_bash_sanitize.py
58
58
  tests/test_bash_shell.py
59
59
  tests/test_bash_stdin.py
60
+ tests/test_bash_stop_partial.py
60
61
  tests/test_bash_timeout_network.py
61
62
  tests/test_bash_timeout_param.py
62
63
  tests/test_cci.py
@@ -69,6 +70,7 @@ tests/test_context_limit_config.py
69
70
  tests/test_detect.py
70
71
  tests/test_dispatch.py
71
72
  tests/test_e2e_connected.py
73
+ tests/test_edit_replace_all.py
72
74
  tests/test_empty_response.py
73
75
  tests/test_extract.py
74
76
  tests/test_failure_loop.py
@@ -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.99"
10
+ version = "3.0.101"
11
11
  description = "Drydock — a local, provider-agnostic terminal coding agent for local LLMs"
12
12
  readme = "README.md"
13
13
  requires-python = ">=3.11"
@@ -0,0 +1,50 @@
1
+ """tool_bash must preserve partial output when the user presses STOP.
2
+ Without this fix, cancel.is_set() triggered a bare "[stopped by user]" return
3
+ that discarded all chunks accumulated before the stop — losing useful diagnostics
4
+ (test-run results, build output, etc.) that the model needs to continue.
5
+
6
+ Mirrors the timeout-partial-output behaviour already in test_bash_background.py.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ import threading
11
+ import time
12
+
13
+ from drydock.tools import tool_bash
14
+
15
+
16
+ def test_stop_preserves_partial_output():
17
+ """Partial output printed before the cancel Event fires must appear in the
18
+ tool result alongside the '[stopped by user]' marker."""
19
+ cancel = threading.Event()
20
+
21
+ # Fire cancel after a short delay so the command has time to emit output.
22
+ def _fire():
23
+ time.sleep(0.5)
24
+ cancel.set()
25
+
26
+ threading.Thread(target=_fire, daemon=True).start()
27
+ out = tool_bash(
28
+ {"command": "echo PARTIAL_LINE; echo second_line; sleep 30", "timeout": 20},
29
+ {"cwd": "/tmp", "_cancel": cancel},
30
+ )
31
+ assert "stopped by user" in out
32
+ assert "PARTIAL_LINE" in out, f"partial output missing from stop result: {out!r}"
33
+ assert "output before stop" in out
34
+
35
+
36
+ def test_stop_with_no_output_returns_plain_marker():
37
+ """If the command produces no output before the stop, the result is just
38
+ '[stopped by user]' without a spurious empty block."""
39
+ cancel = threading.Event()
40
+
41
+ def _fire():
42
+ time.sleep(0.05)
43
+ cancel.set()
44
+
45
+ threading.Thread(target=_fire, daemon=True).start()
46
+ out = tool_bash(
47
+ {"command": "sleep 30", "timeout": 20},
48
+ {"cwd": "/tmp", "_cancel": cancel},
49
+ )
50
+ assert out == "[stopped by user]"
@@ -0,0 +1,37 @@
1
+ """The Edit tool honors replace_all (models expect it, like the standard Edit
2
+ tool). Without it, multiple matches are an error; with it, every occurrence is
3
+ replaced. Found by probing Edit edge cases."""
4
+ from __future__ import annotations
5
+
6
+ from drydock.tools import tool_edit
7
+ from drydock import tool_registry
8
+
9
+
10
+ def _edit(tmp_path, setup, **kw):
11
+ f = tmp_path / "f.txt"; f.write_text(setup)
12
+ out = tool_edit({"file_path": str(f), **kw}, {"cwd": str(tmp_path)})
13
+ return out, f.read_text()
14
+
15
+
16
+ def test_replace_all_replaces_every_occurrence(tmp_path):
17
+ out, text = _edit(tmp_path, "a a a\n", old_string="a", new_string="b", replace_all=True)
18
+ assert "Error" not in out and text == "b b b\n" and "3 occurrences" in out
19
+
20
+
21
+ def test_default_still_errors_on_multiple(tmp_path):
22
+ out, text = _edit(tmp_path, "a a a\n", old_string="a", new_string="b")
23
+ assert "found 3 times" in out and text == "a a a\n" # unchanged
24
+
25
+
26
+ def test_replace_all_single_occurrence(tmp_path):
27
+ out, text = _edit(tmp_path, "just one\n", old_string="one", new_string="two", replace_all=True)
28
+ assert text == "just two\n"
29
+
30
+
31
+ def test_replace_all_no_match_errors(tmp_path):
32
+ out, text = _edit(tmp_path, "hello\n", old_string="zzz", new_string="b", replace_all=True)
33
+ assert "not found" in out and text == "hello\n"
34
+
35
+
36
+ def test_replace_all_in_schema():
37
+ assert "replace_all" in tool_registry.get("Edit").schema["input_schema"]["properties"]
File without changes
File without changes
File without changes
File without changes