Go API server + Preact UI + Claude Code adapter. - App-centric model (ideas, not repos) - AgentProvider interface for multi-agent support - K8s pod lifecycle for sandboxed agent sessions - Gitea integration (create repos, push branches) - WebSocket streaming for live session output - Woodpecker CI/CD pipelines (kaniko build + kubectl deploy)
56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
package provider
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"io"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Status string
|
|
|
|
const (
|
|
StatusPending Status = "pending"
|
|
StatusRunning Status = "running"
|
|
StatusCompleted Status = "completed"
|
|
StatusFailed Status = "failed"
|
|
StatusStopped Status = "stopped"
|
|
)
|
|
|
|
type SessionConfig struct {
|
|
SessionID uuid.UUID `json:"session_id"`
|
|
AppName string `json:"app_name"`
|
|
RepoClone string `json:"repo_clone_url"`
|
|
Branch string `json:"branch"`
|
|
Prompt string `json:"prompt"`
|
|
Provider json.RawMessage `json:"provider_config,omitempty"`
|
|
}
|
|
|
|
type SessionHandle struct {
|
|
SessionID uuid.UUID
|
|
PodName string
|
|
}
|
|
|
|
type Capability struct {
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
}
|
|
|
|
type Info struct {
|
|
Name string `json:"name"`
|
|
DisplayName string `json:"display_name"`
|
|
Description string `json:"description"`
|
|
Capabilities []Capability `json:"capabilities"`
|
|
ConfigSchema json.RawMessage `json:"config_schema,omitempty"`
|
|
}
|
|
|
|
type AgentProvider interface {
|
|
Info() Info
|
|
CreateSession(ctx context.Context, cfg SessionConfig) (*SessionHandle, error)
|
|
StopSession(ctx context.Context, handle *SessionHandle) error
|
|
SendMessage(ctx context.Context, handle *SessionHandle, msg string) error
|
|
StreamOutput(ctx context.Context, handle *SessionHandle) (io.ReadCloser, error)
|
|
GetStatus(ctx context.Context, handle *SessionHandle) (Status, error)
|
|
}
|