reimplement agent,provider and add file history
This commit is contained in:
parent
76b4065f17
commit
bbfa60c787
73 changed files with 3595 additions and 3879 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kujtimiihoxha/termai/internal/config"
|
||||
"github.com/kujtimiihoxha/termai/internal/db"
|
||||
"github.com/kujtimiihoxha/termai/internal/history"
|
||||
"github.com/kujtimiihoxha/termai/internal/llm/agent"
|
||||
|
|
@ -20,7 +21,7 @@ import (
|
|||
type App struct {
|
||||
Sessions session.Service
|
||||
Messages message.Service
|
||||
Files history.Service
|
||||
History history.Service
|
||||
Permissions permission.Service
|
||||
|
||||
CoderAgent agent.Service
|
||||
|
|
@ -43,7 +44,7 @@ func New(ctx context.Context, conn *sql.DB) (*App, error) {
|
|||
app := &App{
|
||||
Sessions: sessions,
|
||||
Messages: messages,
|
||||
Files: files,
|
||||
History: files,
|
||||
Permissions: permission.NewPermissionService(),
|
||||
LSPClients: make(map[string]*lsp.Client),
|
||||
}
|
||||
|
|
@ -51,11 +52,17 @@ func New(ctx context.Context, conn *sql.DB) (*App, error) {
|
|||
app.initLSPClients(ctx)
|
||||
|
||||
var err error
|
||||
app.CoderAgent, err = agent.NewCoderAgent(
|
||||
app.Permissions,
|
||||
app.CoderAgent, err = agent.NewAgent(
|
||||
config.AgentCoder,
|
||||
app.Sessions,
|
||||
app.Messages,
|
||||
app.LSPClients,
|
||||
agent.CoderAgentTools(
|
||||
app.Permissions,
|
||||
app.Sessions,
|
||||
app.Messages,
|
||||
app.History,
|
||||
app.LSPClients,
|
||||
),
|
||||
)
|
||||
if err != nil {
|
||||
logging.Error("Failed to create coder agent", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue