-
Notifications
You must be signed in to change notification settings - Fork 5.9k
feat: a system for non developers to augment developer system #524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
3fafe74
6480ba5
6a41ce1
68d5d03
761d4df
b071ef1
87c0297
d849556
c194d72
6f30fff
0d657e4
d47176e
c2a7d91
2e2a3cc
0c0ba67
488974f
8703e23
0311fcd
120a2cd
dbf1e7e
0bc74c0
d444867
4d73800
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,11 +5,26 @@ use goose::{ | |||||
| developer::DeveloperSystem, | ||||||
| memory::MemorySystem, | ||||||
| providers::{configs::ProviderConfig, factory}, | ||||||
| systems::goose_hints::GooseHintsSystem, | ||||||
| systems::{goose_hints::GooseHintsSystem, non_developer::NonDeveloperSystem}, | ||||||
| }; | ||||||
| use std::{env, sync::Arc}; | ||||||
| use std::{env, path::Path, process::Command, sync::Arc}; | ||||||
| use tokio::sync::Mutex; | ||||||
|
|
||||||
| /// Check if the current directory or any parent directory contains a .git folder | ||||||
| fn is_in_git_repository() -> bool { | ||||||
| let output = Command::new("git") | ||||||
| .arg("rev-parse") | ||||||
| .arg("--git-dir") | ||||||
| .output(); | ||||||
|
|
||||||
| matches!(output, Ok(output) if output.status.success()) | ||||||
| } | ||||||
|
|
||||||
| /// Check if a .goosehints file exists in the current directory | ||||||
| fn has_goosehints_file() -> bool { | ||||||
| Path::new(".goosehints").exists() | ||||||
| } | ||||||
|
|
||||||
| /// Shared application state | ||||||
| pub struct AppState { | ||||||
| pub provider_config: ProviderConfig, | ||||||
|
|
@@ -21,15 +36,34 @@ impl AppState { | |||||
| pub fn new(provider_config: ProviderConfig, secret_key: String) -> Result<Self> { | ||||||
| let provider = factory::get_provider(provider_config.clone())?; | ||||||
| let mut agent = Agent::new(provider); | ||||||
|
|
||||||
| dbg!("Adding DeveloperSystem"); | ||||||
|
||||||
| agent.add_system(Box::new(DeveloperSystem::new())); | ||||||
|
|
||||||
| // Only add NonDeveloperSystem if we're not in a git repository and don't have a .goosehints file | ||||||
| let in_git = is_in_git_repository(); | ||||||
| let has_hints = has_goosehints_file(); | ||||||
|
|
||||||
| if !in_git && !has_hints { | ||||||
|
michaelneale marked this conversation as resolved.
Outdated
|
||||||
| dbg!("Adding NonDeveloperSystem"); | ||||||
|
||||||
| dbg!("Adding NonDeveloperSystem"); | |
| agent.add_system(Box::new(NonDeveloperSystem::new())); |
Copilot
AI
Dec 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the dbg! macro as it is used for debugging and should not be in production code.
| dbg!("Adding MemorySystem"); | |
| agent.add_system(Box::new(MemorySystem::new())); |
Copilot
AI
Dec 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the dbg! macro as it is used for debugging and should not be in production code.
Copilot
AI
Dec 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the dbg! macro as it is used for debugging and should not be in production code.
| dbg!("Adding GooseHintsSystem"); | |
| // dbg!("Adding GooseHintsSystem"); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ mod system; | |
| pub use system::System; | ||
|
|
||
| pub mod goose_hints; | ||
| pub mod non_developer; | ||
Uh oh!
There was an error while loading. Please reload this page.