bridge.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package app
  2. import (
  3. "context"
  4. "fmt"
  5. "github.com/sst/opencode/pkg/client"
  6. )
  7. // AgentServiceBridge provides a minimal agent service that sends messages to the API
  8. type AgentServiceBridge struct {
  9. client *client.ClientWithResponses
  10. }
  11. // NewAgentServiceBridge creates a new agent service bridge
  12. func NewAgentServiceBridge(client *client.ClientWithResponses) *AgentServiceBridge {
  13. return &AgentServiceBridge{client: client}
  14. }
  15. // Cancel cancels the current generation - NOT IMPLEMENTED IN API YET
  16. func (a *AgentServiceBridge) Cancel(sessionID string) error {
  17. // TODO: Not implemented in TypeScript API yet
  18. return nil
  19. }
  20. // IsBusy checks if the agent is busy - NOT IMPLEMENTED IN API YET
  21. func (a *AgentServiceBridge) IsBusy() bool {
  22. // TODO: Not implemented in TypeScript API yet
  23. return false
  24. }
  25. // IsSessionBusy checks if the agent is busy for a specific session - NOT IMPLEMENTED IN API YET
  26. func (a *AgentServiceBridge) IsSessionBusy(sessionID string) bool {
  27. // TODO: Not implemented in TypeScript API yet
  28. return false
  29. }
  30. // CompactSession compacts a session - NOT IMPLEMENTED IN API YET
  31. func (a *AgentServiceBridge) CompactSession(ctx context.Context, sessionID string, force bool) error {
  32. // TODO: Not implemented in TypeScript API yet
  33. return fmt.Errorf("session compaction not implemented in API")
  34. }