deepy-cli 0.2.11__tar.gz → 0.2.13__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 (103) hide show
  1. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/PKG-INFO +3 -1
  2. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/pyproject.toml +3 -1
  3. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/__init__.py +1 -1
  4. deepy_cli-0.2.13/src/deepy/data/tools/Search.md +20 -0
  5. deepy_cli-0.2.13/src/deepy/data/tools/apply_patch.md +68 -0
  6. deepy_cli-0.2.13/src/deepy/data/tools/edit_text.md +21 -0
  7. deepy_cli-0.2.13/src/deepy/data/tools/read_file.md +16 -0
  8. deepy_cli-0.2.13/src/deepy/data/tools/write_file.md +13 -0
  9. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/prompts/system.py +4 -3
  10. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/prompts/tool_docs.py +5 -2
  11. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tools/agents.py +282 -79
  12. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tools/builtin.py +1504 -74
  13. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tools/file_state.py +61 -6
  14. deepy_cli-0.2.13/src/deepy/tools/search.py +643 -0
  15. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/diff.py +66 -14
  16. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/message_view.py +141 -10
  17. deepy_cli-0.2.11/src/deepy/data/tools/edit.md +0 -17
  18. deepy_cli-0.2.11/src/deepy/data/tools/modify.md +0 -26
  19. deepy_cli-0.2.11/src/deepy/data/tools/read.md +0 -8
  20. deepy_cli-0.2.11/src/deepy/data/tools/write.md +0 -16
  21. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/README.md +0 -0
  22. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/__main__.py +0 -0
  23. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/cli.py +0 -0
  24. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/config/__init__.py +0 -0
  25. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/config/settings.py +0 -0
  26. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/__init__.py +0 -0
  27. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/skills/skill-creator/SKILL.md +0 -0
  28. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/skills/skill-installer/SKILL.md +0 -0
  29. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/tools/AskUserQuestion.md +0 -0
  30. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/tools/WebFetch.md +0 -0
  31. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/tools/WebSearch.md +0 -0
  32. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/tools/__init__.py +0 -0
  33. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/tools/shell.md +0 -0
  34. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/data/tools/todo_write.md +0 -0
  35. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/errors.py +0 -0
  36. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/input_suggestions.py +0 -0
  37. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/__init__.py +0 -0
  38. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/agent.py +0 -0
  39. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/compaction.py +0 -0
  40. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/context.py +0 -0
  41. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/events.py +0 -0
  42. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/model_capabilities.py +0 -0
  43. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/provider.py +0 -0
  44. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/replay.py +0 -0
  45. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/runner.py +0 -0
  46. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/llm/thinking.py +0 -0
  47. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/mcp.py +0 -0
  48. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/prompts/__init__.py +0 -0
  49. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/prompts/compact.py +0 -0
  50. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/prompts/init_agents.py +0 -0
  51. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/prompts/rules.py +0 -0
  52. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/prompts/runtime_context.py +0 -0
  53. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/session_cost.py +0 -0
  54. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/sessions/__init__.py +0 -0
  55. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/sessions/jsonl.py +0 -0
  56. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/sessions/manager.py +0 -0
  57. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/skill_market.py +0 -0
  58. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/skills.py +0 -0
  59. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/status.py +0 -0
  60. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/todos.py +0 -0
  61. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tools/__init__.py +0 -0
  62. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tools/result.py +0 -0
  63. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tools/shell_output.py +0 -0
  64. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tools/shell_utils.py +0 -0
  65. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/__init__.py +0 -0
  66. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/app.py +0 -0
  67. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/commands.py +0 -0
  68. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/compat.py +0 -0
  69. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/runner.py +0 -0
  70. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/screens.py +0 -0
  71. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/state.py +0 -0
  72. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/tui/widgets.py +0 -0
  73. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/types/__init__.py +0 -0
  74. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/types/sdk.py +0 -0
  75. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/types/tool_payloads.py +0 -0
  76. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/__init__.py +0 -0
  77. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/app.py +0 -0
  78. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/ask_user_question.py +0 -0
  79. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/exit_summary.py +0 -0
  80. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/file_mentions.py +0 -0
  81. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/loading_text.py +0 -0
  82. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/local_command.py +0 -0
  83. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/markdown.py +0 -0
  84. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/model_picker.py +0 -0
  85. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/prompt_buffer.py +0 -0
  86. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/prompt_input.py +0 -0
  87. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/session_list.py +0 -0
  88. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/session_picker.py +0 -0
  89. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/skill_picker.py +0 -0
  90. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/slash_commands.py +0 -0
  91. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/status_footer.py +0 -0
  92. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/styles.py +0 -0
  93. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/terminal.py +0 -0
  94. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/theme_picker.py +0 -0
  95. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/thinking_state.py +0 -0
  96. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/ui/welcome.py +0 -0
  97. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/update_check.py +0 -0
  98. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/usage.py +0 -0
  99. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/utils/__init__.py +0 -0
  100. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/utils/debug_logger.py +0 -0
  101. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/utils/error_logger.py +0 -0
  102. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/utils/json.py +0 -0
  103. {deepy_cli-0.2.11 → deepy_cli-0.2.13}/src/deepy/utils/notify.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: deepy-cli
3
- Version: 0.2.11
3
+ Version: 0.2.13
4
4
  Summary: Deepy - Vibe coding for DeepSeek models in your terminal
5
5
  Keywords: deepseek,coding-agent,terminal,cli,agents
6
6
  Author: kirineko
@@ -15,8 +15,10 @@ Classifier: Topic :: Terminals
15
15
  Requires-Dist: openai-agents>=0.17.0
16
16
  Requires-Dist: openai>=2.26,<3
17
17
  Requires-Dist: orjson>=3.10,<4
18
+ Requires-Dist: pathspec>=1.1.1
18
19
  Requires-Dist: pydantic>=2.12,<3
19
20
  Requires-Dist: prompt-toolkit>=3.0,<4
21
+ Requires-Dist: regex>=2026.5.9
20
22
  Requires-Dist: pyyaml>=6.0,<7
21
23
  Requires-Dist: rich>=14.2,<15
22
24
  Requires-Dist: textual>=8.2,<9
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "deepy-cli"
3
- version = "0.2.11"
3
+ version = "0.2.13"
4
4
  description = "Deepy - Vibe coding for DeepSeek models in your terminal"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -21,8 +21,10 @@ dependencies = [
21
21
  "openai-agents>=0.17.0",
22
22
  "openai>=2.26,<3",
23
23
  "orjson>=3.10,<4",
24
+ "pathspec>=1.1.1",
24
25
  "pydantic>=2.12,<3",
25
26
  "prompt-toolkit>=3.0,<4",
27
+ "regex>=2026.5.9",
26
28
  "pyyaml>=6.0,<7",
27
29
  "rich>=14.2,<15",
28
30
  "textual>=8.2,<9",
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.2.11"
3
+ __version__ = "0.2.13"
4
4
 
5
5
 
6
6
  def main() -> None:
@@ -0,0 +1,20 @@
1
+ ## Search
2
+
3
+ Search local project files without shell `grep`, `find`, or `rg`.
4
+
5
+ Args: `query`, `path`, `glob`, `mode`, `output_mode`, `case_sensitive`,
6
+ `context`, `limit`, `offset`, `include_ignored`.
7
+
8
+ Use `Search` for repository code/text search before falling back to `shell`.
9
+ It is built into Deepy and does not require ripgrep or platform-specific shell
10
+ commands. It is read-only.
11
+
12
+ Defaults and guidance:
13
+ - Use `mode: "literal"` unless the user clearly needs a regex.
14
+ - Use `output_mode: "files"` for broad discovery, then `read_file` specific
15
+ files or rerun with `output_mode: "content"`.
16
+ - Use `output_mode: "count"` to understand match distribution.
17
+ - Use `glob` or a narrower `path` to keep results focused.
18
+ - Use `limit` and `offset` to page through large result sets.
19
+ - Leave `include_ignored` false unless ignored build artifacts or dependencies
20
+ are explicitly relevant. Sensitive files are still filtered.
@@ -0,0 +1,68 @@
1
+ ## apply_patch
2
+
3
+ Batch structured file operations in one call.
4
+
5
+ Args: `operations`.
6
+
7
+ Use this when a change has multiple edits in one file, touches multiple files,
8
+ creates/deletes/moves files, replaces a larger block, or needs one all-or-nothing
9
+ preflight before writing. Use `edit_text` only for one small single-file exact
10
+ edit where `old_string` and `new_string` are straightforward.
11
+
12
+ Each operation is an object with a `type` and the fields relevant to that type.
13
+ Set unrelated nullable fields to `null` when required by the schema.
14
+
15
+ Supported operation types:
16
+
17
+ - `create_file`: create a new text file with `file_path` and `content`.
18
+ - `replace_file`: explicitly replace a whole existing file with `file_path`,
19
+ `content`, `overwrite=true`, and either `snapshot_id` or `expected_hash`.
20
+ - `delete_file`: delete `file_path`.
21
+ - `move_file`: move `file_path` to `destination_path`.
22
+ - `replace_block`: replace exact `old_text` with `new_text`.
23
+ - `insert_before`: insert `content` before exact `anchor`.
24
+ - `insert_after`: insert `content` after exact `anchor`.
25
+ - `replace_all`: replace every exact `old_text` match with `new_text`.
26
+
27
+ Example:
28
+
29
+ ```json
30
+ {
31
+ "operations": [
32
+ {
33
+ "type": "replace_block",
34
+ "file_path": "portfolio/index.html",
35
+ "old_text": "<p>Old bio</p>",
36
+ "new_text": "<p>New bio</p>",
37
+ "expected_occurrences": 1,
38
+ "destination_path": null,
39
+ "content": null,
40
+ "anchor": null,
41
+ "replace_all": null,
42
+ "overwrite": null,
43
+ "snapshot_id": null,
44
+ "expected_hash": null
45
+ },
46
+ {
47
+ "type": "insert_after",
48
+ "file_path": "portfolio/styles.css",
49
+ "anchor": ".about {\\n display: grid;\\n}\\n",
50
+ "content": "\\n.about-tags {\\n display: flex;\\n}\\n",
51
+ "expected_occurrences": 1,
52
+ "destination_path": null,
53
+ "old_text": null,
54
+ "new_text": null,
55
+ "replace_all": null,
56
+ "overwrite": null,
57
+ "snapshot_id": null,
58
+ "expected_hash": null
59
+ }
60
+ ]
61
+ }
62
+ ```
63
+
64
+ Deepy preflights all operations before committing file side effects, preserves
65
+ existing encodings and line endings on updates, writes new text files as UTF-8
66
+ without BOM, and returns per-operation, changed-file, diff, and diff-preview
67
+ metadata. Exact text and anchor operations reject absent, ambiguous, no-op, and
68
+ unexpected-count matches with structured diagnostics.
@@ -0,0 +1,21 @@
1
+ ## edit_text
2
+
3
+ Make a small exact/string edit to an existing text file.
4
+
5
+ Args: `file_path`, `old_string`, `new_string`, `replace_all`,
6
+ `expected_occurrences`, optional `snippet_id`.
7
+
8
+ Use this for focused edits where the current text is known. Prefer
9
+ `expected_occurrences` as a safety check, especially with `replace_all`. If a
10
+ partial `read_file` returned a `snippet_id`, pass it only when you intentionally
11
+ want to restrict the replacement to that snippet. For ordinary single-file exact
12
+ edits, pass `file_path` and omit `snippet_id`; Deepy can internally promote a
13
+ fresh partial read to a full-file exact edit when needed. Do not pass
14
+ `snapshot_id` as `snippet_id`; snapshots are for stale protection, while
15
+ snippets are only returned by partial reads.
16
+
17
+ Deepy preserves the existing file encoding and line endings, rejects stale files,
18
+ rejects no-op edits, and returns structured error metadata for missing,
19
+ ambiguous, or count-mismatched replacements. Use `apply_patch` when there are
20
+ multiple edits in one file, multiple files, create/delete/move operations, or a
21
+ larger block replacement.
@@ -0,0 +1,16 @@
1
+ ## read_file
2
+
3
+ Read files or list directories before changes.
4
+
5
+ Args: `file_path`, optional `offset`, optional `limit`, optional `pages`.
6
+
7
+ Text output includes line numbers. Full text reads record a managed snapshot with
8
+ encoding, line-ending, snapshot id, and content hash metadata for later
9
+ `edit_text`, `write_file`, or `apply_patch` calls. Partial reads return snippet
10
+ metadata that can scope later `edit_text` calls but do not authorize unrestricted
11
+ whole-file replacement. For normal single-file exact edits after a partial read,
12
+ prefer `edit_text` with `file_path` and no `snippet_id`; use the snippet only
13
+ when you need to constrain the replacement to that line range.
14
+
15
+ Non-text files such as images, notebooks, and PDFs may return descriptive
16
+ metadata, but they are not tracked for text mutation.
@@ -0,0 +1,13 @@
1
+ ## write_file
2
+
3
+ Create a new text file or explicitly replace a whole file.
4
+
5
+ Args: `file_path`, `content`, `overwrite`, optional `snapshot_id`, optional
6
+ `expected_hash`.
7
+
8
+ For new files, Deepy writes UTF-8 without BOM by default. For existing files,
9
+ whole-file replacement requires `overwrite=true` and a fresh `snapshot_id` or
10
+ `expected_hash` from `read_file`; this prevents accidental stale rewrites.
11
+
12
+ Prefer `edit_text` for small targeted edits and `apply_patch` for structured or
13
+ multi-file edits.
@@ -43,10 +43,11 @@ def build_system_prompt(
43
43
  return f"""You are Deepy, a terminal coding agent in the user's project.
44
44
 
45
45
  Core rules:
46
- - Work in the repo with tools: inspect, modify, test, verify.
46
+ - Work in the repo with tools: inspect, edit, test, verify.
47
47
  - Preserve user changes. Prefer small, verifiable edits.
48
- - Read existing files when you need context; exact `modify` edits can establish the managed snapshot internally.
49
- - Use `modify` for file changes: `content` only creates new files; existing files use `old_string`/`new_string`.
48
+ - Use `Search` for local project code/text search instead of shell `grep`, `find`, or `rg`; narrow with `path`, `glob`, `output_mode`, `limit`, and `offset`.
49
+ - Read existing files when you need context; exact `edit_text` edits can establish the managed snapshot internally.
50
+ - Use `edit_text` for one small single-file exact edit. Use structured `apply_patch.operations` when a change has multiple edits in one file, touches multiple files, creates/deletes/moves files, or replaces a larger block. Use `write_file` for new files or explicit whole-file replacement.
50
51
  - After project generators create scaffold files, read and edit the generated block instead of replacing the file.
51
52
  - Run shell commands using the Runtime context's command dialect and path style: `powershell` -> PowerShell with Windows paths; `cmd` -> cmd; `posix` -> POSIX shell.
52
53
  - Match visible thinking/reasoning language to the user's latest natural language. If the user asks in Chinese, you MUST write visible thinking/reasoning in Chinese unless they explicitly request another language. Do not switch visible thinking/reasoning to English for Chinese requests.
@@ -5,8 +5,11 @@ from importlib import resources
5
5
 
6
6
  TOOL_DOC_FILES = (
7
7
  "shell.md",
8
- "read.md",
9
- "modify.md",
8
+ "Search.md",
9
+ "read_file.md",
10
+ "edit_text.md",
11
+ "write_file.md",
12
+ "apply_patch.md",
10
13
  "AskUserQuestion.md",
11
14
  "WebSearch.md",
12
15
  "WebFetch.md",