wip: refactoring tui

This commit is contained in:
adamdottv
2025-05-30 15:34:22 -05:00
parent f5e2c596d4
commit c69c9327da
13 changed files with 244 additions and 263 deletions

View File

@@ -17,33 +17,6 @@ func NewAgentServiceBridge(client *client.ClientWithResponses) *AgentServiceBrid
return &AgentServiceBridge{client: client}
}
// Run sends a message to the chat API
func (a *AgentServiceBridge) Run(ctx context.Context, sessionID string, text string, attachments ...Attachment) (string, error) {
// TODO: Handle attachments when API supports them
if len(attachments) > 0 {
// For now, ignore attachments
// return "", fmt.Errorf("attachments not supported yet")
}
part := client.MessagePart{}
part.FromMessagePartText(client.MessagePartText{
Type: "text",
Text: text,
})
parts := []client.MessagePart{part}
go a.client.PostSessionChatWithResponse(ctx, client.PostSessionChatJSONRequestBody{
SessionID: sessionID,
Parts: parts,
ProviderID: "anthropic",
ModelID: "claude-sonnet-4-20250514",
})
// The actual response will come through SSE
// For now, just return success
return "", nil
}
// Cancel cancels the current generation - NOT IMPLEMENTED IN API YET
func (a *AgentServiceBridge) Cancel(sessionID string) error {
// TODO: Not implemented in TypeScript API yet