vibe-engineering 0.1.7__py3-none-any.whl → 0.1.9__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.
src/cli/commands.py CHANGED
@@ -1,4 +1,6 @@
1
1
  """CLI commands for vibe-engineering."""
2
+ import json
3
+
2
4
  import typer
3
5
  from rich.console import Console
4
6
  from rich.table import Table
@@ -8,7 +10,7 @@ from rich.progress import Progress, SpinnerColumn, TextColumn
8
10
  from rich import box
9
11
  import time
10
12
 
11
- from src.db import MongoDBClient, get_documents
13
+ from src.db import MongoDBClient, get_documents, insert_document
12
14
  from src.llm import FireworksClient
13
15
  from src.schemas import SpecifySchema
14
16
 
@@ -140,84 +142,50 @@ def team():
140
142
 
141
143
 
142
144
  @app.command()
143
- def specify(
144
- prompt: str = typer.Argument(..., help="The specification prompt to process"),
145
- output_format: str = typer.Option("json", "--format", "-f", help="Output format: json, yaml, markdown"),
146
- save: bool = typer.Option(False, "--save", "-s", help="Save the specification to database"),
147
- verbose: bool = typer.Option(False, "--verbose", "-v", help="Show detailed output")
148
- ):
149
- """✨ Generate a specification schema using AI."""
145
+ def specify(prompt: str, db_name: str = "master", collection_name: str = "llm"):
146
+ """Generate a specification schema using LLM and store it in MongoDB."""
150
147
  console = Console()
151
-
152
- console.print(f"\n[bold blue]✨ Generating Specification[/bold blue]\n")
153
-
154
- if verbose:
155
- console.print(f"[cyan]📝 Prompt:[/cyan] {prompt}")
156
- console.print(f"[cyan]📄 Format:[/cyan] {output_format}")
157
- console.print(f"[cyan]💾 Save:[/cyan] {'Yes' if save else 'No'}")
158
- console.print()
159
-
160
- with Progress(
161
- SpinnerColumn(),
162
- TextColumn("[progress.description]{task.description}"),
163
- console=console
164
- ) as progress:
165
- task = progress.add_task("🤖 Processing with AI...", total=None)
166
-
167
- try:
168
- llm_client = FireworksClient()
169
- response = llm_client.generate_with_schema(
170
- prompt=prompt,
171
- schema=SpecifySchema.model_json_schema(),
172
- schema_name="SpecifySchema",
173
- )
174
- progress.update(task, completed=True)
175
148
 
176
- # Display results
177
- console.print()
178
- result_panel = Panel(
179
- response,
180
- title="📋 Generated Specification",
181
- border_style="green",
182
- box=box.ROUNDED
149
+ try:
150
+ # Generate schema using LLM
151
+ llm_client = FireworksClient()
152
+ response = llm_client.generate_with_schema(
153
+ prompt=prompt,
154
+ schema=SpecifySchema.model_json_schema(),
155
+ schema_name="SpecifySchema",
156
+ )
157
+
158
+ # Parse the JSON response
159
+ doc = json.loads(response)
160
+
161
+ # Store in MongoDB
162
+ with MongoDBClient() as db_client:
163
+ inserted_id = insert_document(
164
+ db_client=db_client,
165
+ db_name=db_name,
166
+ collection_name=collection_name,
167
+ document=doc
183
168
  )
184
- console.print(result_panel)
185
-
186
- if save:
187
- console.print("\n[yellow]💾 Saving to database...[/yellow]")
188
- # TODO: Implement save functionality
189
- console.print("[green]✅ Specification saved successfully![/green]")
190
-
191
- # Next steps
192
- next_steps = """[yellow]💡 Next Steps:[/yellow]
193
-
194
- • Review and refine the specification
195
- • Save to database with [cyan]--save[/cyan] flag
196
- • Use [cyan]vibe plan[/cyan] to create implementation plan
197
- • Generate tasks with [cyan]vibe tasks[/cyan]"""
198
-
199
- steps_panel = Panel(
200
- next_steps,
201
- title="🚀 What's Next?",
202
- border_style="yellow",
203
- box=box.ROUNDED
204
- )
205
- console.print(steps_panel)
206
-
207
- except Exception as e:
208
- progress.update(task, completed=True)
209
- console.print(f"\n[red]❌ Error generating specification:[/red] {e}")
210
- console.print("[yellow]💡 Check your API keys and network connection[/yellow]")
211
-
212
169
 
213
- @app.callback()
214
- def main():
215
- """
216
- 🚀 [bold blue]Vibe Engineering[/bold blue] - AI-powered specification and memory management CLI
217
-
218
- [dim]Manage your project specifications, team knowledge, and development workflows with AI assistance.[/dim]
219
- """
220
- pass
170
+ console.print(f"[green]✓[/green] Document stored in {db_name}.{collection_name}")
171
+ console.print(f"[dim]Document ID: {inserted_id}[/dim]\n")
172
+
173
+ # Create a copy of doc for display, converting ObjectId to string if present
174
+ display_doc = doc.copy()
175
+ if "_id" in display_doc:
176
+ display_doc["_id"] = str(display_doc["_id"])
177
+
178
+ # Pretty print the schema with rich
179
+ console.print("[bold cyan]Generated Schema:[/bold cyan]")
180
+ from rich.syntax import Syntax
181
+ json_str = json.dumps(display_doc, indent=2, default=str)
182
+ syntax = Syntax(json_str, "json", theme="monokai", line_numbers=False)
183
+ console.print(syntax)
184
+
185
+ except json.JSONDecodeError as e:
186
+ console.print(f"[red]Error parsing JSON response:[/red] {e}")
187
+ except Exception as e:
188
+ console.print(f"[red]Error:[/red] {e}")
221
189
 
222
190
 
223
191
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vibe-engineering
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Add your description here
5
5
  Home-page: https://github.com/vibeengineering/vibe-engineering
6
6
  Author: Vibe Engineering Team
@@ -1,6 +1,6 @@
1
1
  src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  src/cli/__init__.py,sha256=jJ7tHuLwJcPDuk45xRuu8xbMBQL45k5oZ6EcNa9MD8k,94
3
- src/cli/commands.py,sha256=dlZoLSR9n4InbdeAXJXxKmATMGOwLW70ylXlBIJ_808,7885
3
+ src/cli/commands.py,sha256=9aZFNNwlpAJjqqYv0qo1aYhr86vGZefbB3WrcYovRig,6549
4
4
  src/db/__init__.py,sha256=zrfEUYNVRhGAq0DgIWBkxoM8L0jJNgy1_GhtBVJvhYA,470
5
5
  src/db/client.py,sha256=a-KZDyJjUWB1y15p1pxPn_q8UPDLVtOSvidx8XvULlU,1741
6
6
  src/db/operations.py,sha256=nJ2AJrYOaOi9L8ZJgQjr4eukKbr2al0tFls83S8M8GY,4881
@@ -10,7 +10,7 @@ src/llm/embeddings.py,sha256=wH-aihD6HfkJtUn4TJGpqLz9BYnX5i0SyRT0tf8hb2E,2987
10
10
  src/llm/segmentation.py,sha256=zex5Elfk_ph0nFFzszxtagN6o1SmTu1BsHJ9W9Njlb0,4753
11
11
  src/schemas/__init__.py,sha256=rdw4M8Gm95XN5sPgfReQO0WLePty-OE-4OYjSFrGlBM,163
12
12
  src/schemas/models.py,sha256=aIO8qtG0gdL6pWc0cyhYC1jqevpNIfkOQJYSA3Lc_Ew,1011
13
- vibe_engineering-0.1.7.dist-info/METADATA,sha256=4qsfe3zn4Ln8TQ3l6z17azo6i9Pn4zW9jrJGbI48n98,7650
14
- vibe_engineering-0.1.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- vibe_engineering-0.1.7.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
16
- vibe_engineering-0.1.7.dist-info/RECORD,,
13
+ vibe_engineering-0.1.9.dist-info/METADATA,sha256=XRbrqZxYW-CVzE2kxwfRm0sUYS7Zfb8LjrPlO65fIlw,7650
14
+ vibe_engineering-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ vibe_engineering-0.1.9.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4
16
+ vibe_engineering-0.1.9.dist-info/RECORD,,