Documentation
¶
Index ¶
- func ExtractSSEData(line string) string
- func FindAgentPath(env *exec.Env) (string, error)
- func UnwrapEvent(data []byte) (*crush_types.Event, error)
- type CrushAgent
- type CrushServerClient
- func (c *CrushServerClient) CreateSession(ctx context.Context, workspaceID string, title string) (string, error)
- func (c *CrushServerClient) CreateWorkspace(ctx context.Context, cwd string) (string, error)
- func (c *CrushServerClient) EnsureServer(ctx context.Context) error
- func (c *CrushServerClient) HealthCheck(ctx context.Context) (int, error)
- func (c *CrushServerClient) InitAgent(ctx context.Context, workspaceID string) error
- func (c *CrushServerClient) KillExistingServer()
- func (c *CrushServerClient) SendMessage(ctx context.Context, workspaceID, prompt, sessionID string) error
- func (c *CrushServerClient) ServerPID() int
- func (c *CrushServerClient) ServerStarted() bool
- func (c *CrushServerClient) SubscribeEvents(ctx context.Context, workspaceID string) (<-chan string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractSSEData ¶
func UnwrapEvent ¶
func UnwrapEvent(data []byte) (*crush_types.Event, error)
Types ¶
type CrushAgent ¶
type CrushAgent struct {
AgentPath string
SettingsPath string
Workspace string
Env *exec.Env
LastSessionID string
ServerClient *CrushServerClient
}
func (*CrushAgent) Ask ¶
func (a *CrushAgent) Ask(ctx context.Context, question string, opts *registry.AskOptions, onDelta registry.DeltaCallback) (string, error)
func (*CrushAgent) ListModels ¶
type CrushServerClient ¶
type CrushServerClient struct {
// contains filtered or unexported fields
}
func NewCrushServerClient ¶
func NewCrushServerClient() (*CrushServerClient, error)
func (*CrushServerClient) CreateSession ¶
func (*CrushServerClient) CreateWorkspace ¶
func (*CrushServerClient) EnsureServer ¶
func (c *CrushServerClient) EnsureServer(ctx context.Context) error
func (*CrushServerClient) HealthCheck ¶
func (c *CrushServerClient) HealthCheck(ctx context.Context) (int, error)
func (*CrushServerClient) InitAgent ¶
func (c *CrushServerClient) InitAgent(ctx context.Context, workspaceID string) error
func (*CrushServerClient) KillExistingServer ¶
func (c *CrushServerClient) KillExistingServer()
func (*CrushServerClient) SendMessage ¶
func (c *CrushServerClient) SendMessage(ctx context.Context, workspaceID, prompt, sessionID string) error
func (*CrushServerClient) ServerPID ¶
func (c *CrushServerClient) ServerPID() int
func (*CrushServerClient) ServerStarted ¶
func (c *CrushServerClient) ServerStarted() bool
func (*CrushServerClient) SubscribeEvents ¶
Click to show internal directories.
Click to hide internal directories.