code-puppy 0.0.88__py3-none-any.whl → 0.0.89__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.
- code_puppy/tools/file_operations.py +11 -2
- {code_puppy-0.0.88.dist-info → code_puppy-0.0.89.dist-info}/METADATA +1 -1
- {code_puppy-0.0.88.dist-info → code_puppy-0.0.89.dist-info}/RECORD +7 -7
- {code_puppy-0.0.88.data → code_puppy-0.0.89.data}/data/code_puppy/models.json +0 -0
- {code_puppy-0.0.88.dist-info → code_puppy-0.0.89.dist-info}/WHEEL +0 -0
- {code_puppy-0.0.88.dist-info → code_puppy-0.0.89.dist-info}/entry_points.txt +0 -0
- {code_puppy-0.0.88.dist-info → code_puppy-0.0.89.dist-info}/licenses/LICENSE +0 -0
| @@ -25,6 +25,7 @@ class ListedFile(BaseModel): | |
| 25 25 |  | 
| 26 26 | 
             
            class ListFileOutput(BaseModel):
         | 
| 27 27 | 
             
                files: List[ListedFile]
         | 
| 28 | 
            +
                error: str | None = None
         | 
| 28 29 |  | 
| 29 30 |  | 
| 30 31 | 
             
            def _list_files(
         | 
| @@ -270,7 +271,7 @@ def _grep(context: RunContext, search_string: str, directory: str = ".") -> Grep | |
| 270 271 | 
             
                                            **{
         | 
| 271 272 | 
             
                                                "file_path": file_path,
         | 
| 272 273 | 
             
                                                "line_number": line_number,
         | 
| 273 | 
            -
                                                "line_content": line_content.rstrip("\n\r"),
         | 
| 274 | 
            +
                                                "line_content": line_content.rstrip("\n\r")[2048:],
         | 
| 274 275 | 
             
                                            }
         | 
| 275 276 | 
             
                                        )
         | 
| 276 277 | 
             
                                        matches.append(match_info)
         | 
| @@ -311,7 +312,15 @@ def _grep(context: RunContext, search_string: str, directory: str = ".") -> Grep | |
| 311 312 | 
             
            def list_files(
         | 
| 312 313 | 
             
                context: RunContext, directory: str = ".", recursive: bool = True
         | 
| 313 314 | 
             
            ) -> ListFileOutput:
         | 
| 314 | 
            -
                 | 
| 315 | 
            +
                list_files_output = _list_files(context, directory, recursive)
         | 
| 316 | 
            +
                tokenizer = get_tokenizer()
         | 
| 317 | 
            +
                num_tokens = len(tokenizer.encode(list_files_output.model_dump_json()))
         | 
| 318 | 
            +
                if num_tokens > 10000:
         | 
| 319 | 
            +
                    return ListFileOutput(
         | 
| 320 | 
            +
                        files=[],
         | 
| 321 | 
            +
                        error="Too many files - tokens exceeded. Try listing non-recursively"
         | 
| 322 | 
            +
                    )
         | 
| 323 | 
            +
                return list_files_output
         | 
| 315 324 |  | 
| 316 325 |  | 
| 317 326 | 
             
            def read_file(context: RunContext, file_path: str = "", start_line: int | None = None, num_lines: int | None = None) -> ReadFileOutput:
         | 
| @@ -21,11 +21,11 @@ code_puppy/tools/__init__.py,sha256=WTHYIfRk2KMmk6o45TELpbB3GIiAm8s7GmfJ7Zy_tww, | |
| 21 21 | 
             
            code_puppy/tools/command_runner.py,sha256=9UWCSPpuEndaPx8Ecc8TRsn3rMHNd2AqerirvYPGRIw,14358
         | 
| 22 22 | 
             
            code_puppy/tools/common.py,sha256=UkhnfLG1bmd4f9nZCcmno088AtKtAnEES1tydxUN-Fk,3265
         | 
| 23 23 | 
             
            code_puppy/tools/file_modifications.py,sha256=BzQrGEacS2NZr2ru9N30x_Qd70JDudBKOAPO1XjBohg,13861
         | 
| 24 | 
            -
            code_puppy/tools/file_operations.py,sha256= | 
| 24 | 
            +
            code_puppy/tools/file_operations.py,sha256=5oJSJCKPLSgJ9YcD1CV9D-SJ0hnzVzmuAs-eiriLPLo,13615
         | 
| 25 25 | 
             
            code_puppy/tools/token_check.py,sha256=F3eygdI8fgb6dfCrSkGw_OLI7cb_Kpa5ILft4BQ7hvY,525
         | 
| 26 | 
            -
            code_puppy-0.0. | 
| 27 | 
            -
            code_puppy-0.0. | 
| 28 | 
            -
            code_puppy-0.0. | 
| 29 | 
            -
            code_puppy-0.0. | 
| 30 | 
            -
            code_puppy-0.0. | 
| 31 | 
            -
            code_puppy-0.0. | 
| 26 | 
            +
            code_puppy-0.0.89.data/data/code_puppy/models.json,sha256=jr0-LW87aJS79GosVwoZdHeeq5eflPzgdPoMbcqpVA8,2728
         | 
| 27 | 
            +
            code_puppy-0.0.89.dist-info/METADATA,sha256=Dyf2vyOvwhvrBVfNd1xIvmIgcvCEOKOYK5Hyy6xScT4,6351
         | 
| 28 | 
            +
            code_puppy-0.0.89.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
         | 
| 29 | 
            +
            code_puppy-0.0.89.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
         | 
| 30 | 
            +
            code_puppy-0.0.89.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
         | 
| 31 | 
            +
            code_puppy-0.0.89.dist-info/RECORD,,
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         | 
| 
            File without changes
         |