wcgw 2.8.10__py3-none-any.whl → 3.0.1__py3-none-any.whl

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.

Potentially problematic release.


This version of wcgw might be problematic. Click here for more details.

@@ -109,18 +109,7 @@ class DirectoryTree:
109
109
  current_path, shown_items
110
110
  )
111
111
  if hidden_files > 0 or hidden_dirs > 0:
112
- hidden_msg = []
113
- if hidden_dirs > 0:
114
- hidden_msg.append(
115
- f"{hidden_dirs} director{'ies' if hidden_dirs != 1 else 'y'}"
116
- )
117
- if hidden_files > 0:
118
- hidden_msg.append(
119
- f"{hidden_files} file{'s' if hidden_files != 1 else ''}"
120
- )
121
- writer.write(
122
- f"{' ' * (indent + 2)}... {' and '.join(hidden_msg)} hidden\n"
123
- )
112
+ writer.write(f"{' ' * (indent + 2)}...\n")
124
113
 
125
114
  _display_recursive(self.root, depth=0)
126
115
 
@@ -0,0 +1,99 @@
1
+ import os
2
+ from dataclasses import dataclass
3
+ from typing import Any
4
+
5
+ from ..types_ import (
6
+ BashCommand,
7
+ ContextSave,
8
+ FileEdit,
9
+ Initialize,
10
+ ReadFiles,
11
+ ReadImage,
12
+ WriteIfEmpty,
13
+ )
14
+
15
+ with open(os.path.join(os.path.dirname(__file__), "diff-instructions.txt")) as f:
16
+ diffinstructions = f.read()
17
+
18
+
19
+ @dataclass
20
+ class Prompts:
21
+ inputSchema: dict[str, Any]
22
+ name: str
23
+ description: str
24
+
25
+
26
+ TOOL_PROMPTS = [
27
+ Prompts(
28
+ inputSchema=Initialize.model_json_schema(),
29
+ name="Initialize",
30
+ description="""
31
+ - Always call this at the start of the conversation before using any of the shell tools from wcgw.
32
+ - Use `any_workspace_path` to initialize the shell in the appropriate project directory.
33
+ - If the user has mentioned a workspace or project root or any other file or folder use it to set `any_workspace_path`.
34
+ - If user has mentioned any files use `initial_files_to_read` to read, use absolute paths only.
35
+ - By default use mode "wcgw"
36
+ - In "code-writer" mode, set the commands and globs which user asked to set, otherwise use 'all'.
37
+ - Use type="first_call" if it's the first call to this tool.
38
+ - Use type="user_asked_mode_change" if in a conversation user has asked to change mode.
39
+ - Use type="reset_shell" if in a conversation shell is not working after multiple tries.
40
+ - Use type="user_asked_change_workspace" if in a conversation user asked to change workspace
41
+ """,
42
+ ),
43
+ Prompts(
44
+ inputSchema=BashCommand.model_json_schema(),
45
+ name="BashCommand",
46
+ description="""
47
+ - Execute a bash command. This is stateful (beware with subsequent calls).
48
+ - Status of the command and the current working directory will always be returned at the end.
49
+ - The first or the last line might be `(...truncated)` if the output is too long.
50
+ - Always run `pwd` if you get any file or directory not found error to make sure you're not lost.
51
+ - Run long running commands in background using screen instead of "&".
52
+ - Do not use 'cat' to read files, use ReadFiles tool instead
53
+ - In order to check status of previous command, use `status_check` with empty command argument.
54
+ - Only command is allowed to run at a time. You need to wait for any previous command to finish before running a new one.
55
+ - Programs don't hang easily, so most likely explanation for no output is usually that the program is still running, and you need to check status again.
56
+ - Do not send Ctrl-c before checking for status till 10 minutes or whatever is appropriate for the program to finish.
57
+ """,
58
+ ),
59
+ Prompts(
60
+ inputSchema=ReadFiles.model_json_schema(),
61
+ name="ReadFiles",
62
+ description="""
63
+ - Read full file content of one or more files.
64
+ - Provide absolute file paths only
65
+ """,
66
+ ),
67
+ Prompts(
68
+ inputSchema=WriteIfEmpty.model_json_schema(),
69
+ name="WriteIfEmpty",
70
+ description="""
71
+ - Write content to an empty or non-existent file. Provide file path and content. Use this instead of BashCommand for writing new files.
72
+ - Provide absolute file path only.
73
+ - For editing existing files, use FileEdit instead of this tool.
74
+ """,
75
+ ),
76
+ Prompts(
77
+ inputSchema=ReadImage.model_json_schema(),
78
+ name="ReadImage",
79
+ description="Read an image from the shell.",
80
+ ),
81
+ Prompts(
82
+ inputSchema=FileEdit.model_json_schema(),
83
+ name="FileEdit",
84
+ description="""
85
+ - Use absolute file path only.
86
+ - Use SEARCH/REPLACE blocks to edit the file.
87
+ - If the edit fails due to block not matching, please retry with correct block till it matches. Re-read the file to ensure you've all the lines correct.
88
+ """
89
+ + diffinstructions,
90
+ ),
91
+ Prompts(
92
+ inputSchema=ContextSave.model_json_schema(),
93
+ name="ContextSave",
94
+ description="""
95
+ Saves provided description and file contents of all the relevant file paths or globs in a single text file.
96
+ - Provide random unqiue id or whatever user provided.
97
+ - Leave project path as empty string if no project path""",
98
+ ),
99
+ ]