Skip to content

Commit 4b3470e

Browse files
authored
Merge pull request #26 from BrunoV21/typescrit-beta-2
Typescrit beta 2
2 parents 6b88b62 + dec7e73 commit 4b3470e

6 files changed

Lines changed: 38 additions & 5 deletions

File tree

codetide/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from typing import Optional, List, Tuple, Union, Dict
1616
from datetime import datetime, timezone
1717
from pathlib import Path
18+
import traceback
1819
import asyncio
1920
import pygit2
2021
import time
@@ -292,7 +293,7 @@ async def _process_single_file(
292293
logger.debug(f"Processing file: {filepath}")
293294
return await parser.parse_file(filepath, self.rootpath)
294295
except Exception as e:
295-
logger.warning(f"Failed to process {filepath}: {str(e)}")
296+
logger.warning(f"Failed to process {filepath}: {str(e)}\n\n{traceback.format_exc()}")
296297
return None
297298

298299
def _add_results_to_codebase(
@@ -419,6 +420,7 @@ def _get_changed_files(self) -> Tuple[List[Path], bool]:
419420
# Check for deleted files
420421
for stored_file_path in self.files:
421422
if stored_file_path not in files:
423+
logger.info(f"detected deletion: {stored_file_path}")
422424
file_deletion_detected = True
423425
break
424426

codetide/agents/tide/prompts.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,14 @@
407407
Ensure high coverage by including unit, integration, and end-to-end tests that address edge cases and follow best practices.
408408
"""
409409

410+
411+
CMD_BRAINSTORM_PROMPT = """
412+
You are strictly prohibited from writing or generating any code until the user explicitly asks you to do so.
413+
For now, you must put on the hat of a solutions architect: your role is to discuss, brainstorm, and collaboratively explore possible solutions, architectures, and implementation strategies with the user.
414+
Ask clarifying questions, propose alternatives, and help the user refine requirements or approaches.
415+
Maintain a conversational flow, encourage user input, and do not proceed to code generation under any circumstances until the user gives a clear instruction to generate code.
416+
"""
417+
410418
CMD_CODE_REVIEW_PROMPT = """
411419
Review the following code submission for bugs, style inconsistencies, and performance issues.
412420
Provide specific, actionable feedback to improve code quality, maintainability, and adherence to established coding standards.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .app import serve
2+
3+
__all__ = [
4+
"serve"
5+
]

codetide/agents/tide/ui/agent_tide_ui.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"Install it with: pip install codetide[agents-ui]"
1010
) from e
1111

12-
from codetide.agents.tide.prompts import CMD_CODE_REVIEW_PROMPT, CMD_COMMIT_PROMPT, CMD_TRIGGER_PLANNING_STEPS, CMD_WRITE_TESTS_PROMPT
12+
from codetide.agents.tide.prompts import CMD_BRAINSTORM_PROMPT, CMD_CODE_REVIEW_PROMPT, CMD_COMMIT_PROMPT, CMD_TRIGGER_PLANNING_STEPS, CMD_WRITE_TESTS_PROMPT
1313
from codetide.agents.tide.defaults import DEFAULT_AGENT_TIDE_LLM_CONFIG_PATH
1414
from codetide.agents.tide.ui.defaults import PLACEHOLDER_LLM_CONFIG
1515
from codetide.agents.tide.agent import AgentTide
@@ -42,15 +42,17 @@ def __init__(self, project_path: Path = Path("./"), history :Optional[list]=None
4242
"plan": CMD_TRIGGER_PLANNING_STEPS,
4343
"review": CMD_CODE_REVIEW_PROMPT,
4444
"test": CMD_WRITE_TESTS_PROMPT,
45-
"commit": CMD_COMMIT_PROMPT
45+
"commit": CMD_COMMIT_PROMPT,
46+
"brainstorm": CMD_BRAINSTORM_PROMPT
4647
}
4748
self.session_id = session_id if session_id else ulid()
4849

4950
commands = [
5051
{"id": "review", "icon": "search-check", "description": "Review file(s) or object(s)"},
5152
{"id": "test", "icon": "flask-conical", "description": "Test file(s) or object(s)"},
5253
{"id": "commit", "icon": "git-commit", "description": "Commit changed files"},
53-
{"id": "plan", "icon": "notepad-text-dashed", "description": "Create a step-by-step task plan"}
54+
{"id": "plan", "icon": "notepad-text-dashed", "description": "Create a step-by-step task plan"},
55+
{"id": "brainstorm", "icon": "brain-circuit", "description": "Brainstorm and discuss solutions (no code generation)"}
5456
]
5557

5658
async def load(self):

codetide/agents/tide/ui/app.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,23 @@ def serve(
448448

449449

450450
def main():
451-
parser = argparse.ArgumentParser(description="Launch the Tide UI server.")
451+
parser = argparse.ArgumentParser(
452+
description="Launch the Tide UI server.",
453+
epilog=(
454+
"\nAvailable commands and what they do:\n"
455+
" --host Host to bind to (default: None)\n"
456+
" --port Port to bind to (default: 9753)\n"
457+
" --root-path Root path for the app (default: None)\n"
458+
" --ssl-certfile Path to SSL certificate file (default: None)\n"
459+
" --ssl-keyfile Path to SSL key file (default: None)\n"
460+
" --ws-per-message-deflate WebSocket per-message deflate (true/false, default: true)\n"
461+
" --ws-protocol WebSocket protocol (default: auto)\n"
462+
" --project-path Path to the project directory (default: ./)\n"
463+
" --config-path Path to the config file (default: .agent_tide_config.yml)\n"
464+
" -h, --help Show this help message and exit\n"
465+
),
466+
formatter_class=argparse.RawDescriptionHelpFormatter
467+
)
452468
parser.add_argument("--host", type=str, default=None, help="Host to bind to")
453469
parser.add_argument("--port", type=int, default=AGENT_TIDE_PORT, help="Port to bind to")
454470
parser.add_argument("--root-path", type=str, default=None, help="Root path for the app")

codetide/search/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)