daemonclient

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAPIStatus

func IsAPIStatus(err error, statusCode int) bool

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
}

func (*APIError) Error

func (e *APIError) Error() string

type Client

type Client struct {
	BaseURL     string
	ClientName  string
	ExternalKey string
	APIToken    string
	HTTPClient  *http.Client
	// EventHTTPClient is intentionally separate from HTTPClient because SSE
	// subscriptions must not inherit the short JSON request timeout.
	EventHTTPClient *http.Client
}

func New

func New(baseURL string, clientName string, externalKey string) *Client

func (*Client) AcknowledgeClientDelivery

func (c *Client) AcknowledgeClientDelivery(ctx context.Context, deliveryID string) error

func (*Client) CancelRun

func (c *Client) CancelRun(ctx context.Context, runID string) (core.Run, error)

func (*Client) CleanupTemporaryStorageFiles

func (c *Client) CleanupTemporaryStorageFiles(ctx context.Context) (localstorage.CleanupResult, error)

func (*Client) CompactSession

func (c *Client) CompactSession(ctx context.Context, sessionID string) (core.CompactSessionResult, error)

func (*Client) CompleteAutomationJob

func (c *Client) CompleteAutomationJob(ctx context.Context, jobID string) (automation.Job, error)

func (*Client) ConfigureSetupProvider

func (c *Client) ConfigureSetupProvider(ctx context.Context, providerID string, update setup.ProviderSetupUpdate) (setup.ProviderSetupItem, error)

func (*Client) CreateAutomationJob

func (c *Client) CreateAutomationJob(ctx context.Context, input automation.CreateJobInput) (automation.Job, error)

func (*Client) CreateSession

func (c *Client) CreateSession(ctx context.Context, title string, workingDir string) (core.Session, error)

func (*Client) CreateSystemMessage

func (c *Client) CreateSystemMessage(ctx context.Context, sessionID string, content string) (core.Message, error)

func (*Client) CurrentBinding

func (c *Client) CurrentBinding(ctx context.Context) (core.ClientBinding, error)

func (*Client) DeleteAutomationJob

func (c *Client) DeleteAutomationJob(ctx context.Context, jobID string) (automation.Job, error)

func (*Client) DeleteSession

func (c *Client) DeleteSession(ctx context.Context, sessionID string) error

func (*Client) DeleteSetupProvider

func (c *Client) DeleteSetupProvider(ctx context.Context, providerID string) error

func (*Client) DeleteStorageFile

func (c *Client) DeleteStorageFile(ctx context.Context, storagePath string) (localstorage.Entry, error)

func (*Client) DeleteTemporaryStorageFile

func (c *Client) DeleteTemporaryStorageFile(ctx context.Context, tempPath string) (localstorage.TempEntry, error)

func (*Client) GetRun

func (c *Client) GetRun(ctx context.Context, runID string) (core.Run, error)

func (*Client) Health

func (c *Client) Health(ctx context.Context) (Health, error)

func (*Client) ListAutomationJobs

func (c *Client) ListAutomationJobs(ctx context.Context) ([]automation.Job, error)

func (*Client) ListClientDeliveries

func (c *Client) ListClientDeliveries(ctx context.Context, filter core.ClientDeliveryFilter) ([]core.ClientDelivery, error)

func (*Client) ListSessionProviders

func (c *Client) ListSessionProviders(ctx context.Context) ([]core.SessionProviderOption, error)

func (*Client) ListSessions

func (c *Client) ListSessions(ctx context.Context) ([]core.Session, error)

func (*Client) ListSetupProviders

func (c *Client) ListSetupProviders(ctx context.Context) ([]setup.ProviderSetupItem, error)

func (*Client) ListStorageFiles

func (c *Client) ListStorageFiles(ctx context.Context, filter localstorage.ListFilter) (localstorage.ListResult, error)

func (*Client) ListTemporaryStorageFiles

func (c *Client) ListTemporaryStorageFiles(ctx context.Context, limit int) (localstorage.TempListResult, error)

func (*Client) LoadSnapshot

func (c *Client) LoadSnapshot(ctx context.Context) (core.ClientSnapshot, error)

func (*Client) PauseAutomationJob

func (c *Client) PauseAutomationJob(ctx context.Context, jobID string) (automation.Job, error)

func (*Client) PromoteTemporaryStorageFile

func (c *Client) PromoteTemporaryStorageFile(ctx context.Context, tempPath string, destPath string) (localstorage.Entry, error)

func (*Client) ProviderModels added in v0.1.1

func (c *Client) ProviderModels(ctx context.Context, providerID string, update setup.ProviderSetupUpdate) ([]string, error)

func (*Client) ReadStorageFile

func (c *Client) ReadStorageFile(ctx context.Context, storagePath string) (localstorage.ReadResult, error)

func (*Client) RenameSession

func (c *Client) RenameSession(ctx context.Context, sessionID string, title string) (core.Session, error)

func (*Client) ResolveApproval

func (c *Client) ResolveApproval(ctx context.Context, approvalID string, approved bool) (core.Approval, error)

func (*Client) RestartDaemon

func (c *Client) RestartDaemon(ctx context.Context) error

func (*Client) RestartDaemonWithNotification

func (c *Client) RestartDaemonWithNotification(ctx context.Context, notification core.ClientDeliveryTarget) error

func (*Client) ResumeAutomationJob

func (c *Client) ResumeAutomationJob(ctx context.Context, jobID string) (automation.Job, error)

func (*Client) RunAutomationJobNow

func (c *Client) RunAutomationJobNow(ctx context.Context, jobID string) (automation.Fire, error)

func (*Client) SaveStorageFile

func (c *Client) SaveStorageFile(ctx context.Context, storagePath string, content []byte, title string, tags []string, mimeType string) (localstorage.Entry, error)

func (*Client) SaveTemporaryStorageFile

func (c *Client) SaveTemporaryStorageFile(ctx context.Context, storagePath string, content []byte, title string, tags []string, mimeType string) (localstorage.TempEntry, error)

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, sessionID string, text string, workingDir string) (core.AcceptRunResult, error)

func (*Client) SendMessageParts

func (c *Client) SendMessageParts(ctx context.Context, sessionID string, text string, parts []core.MessagePart, workingDir string) (core.AcceptRunResult, error)

func (*Client) ServerStatus

func (c *Client) ServerStatus(ctx context.Context) (core.ServerStatus, error)

func (*Client) SessionContext

func (c *Client) SessionContext(ctx context.Context, sessionID string) (core.ContextReport, error)

func (*Client) SubscribeEvents

func (c *Client) SubscribeEvents(ctx context.Context, sessionID string, afterID uint64) (<-chan LiveEvent, <-chan error, error)

func (*Client) UpdateSessionPermissionMode

func (c *Client) UpdateSessionPermissionMode(ctx context.Context, sessionID string, mode core.PermissionMode) (core.Session, error)

func (*Client) UpdateSessionProvider

func (c *Client) UpdateSessionProvider(ctx context.Context, sessionID string, providerID string) (core.Session, error)

func (*Client) UpdateTemporaryStorageSettings

func (c *Client) UpdateTemporaryStorageSettings(ctx context.Context, autoCleanup *bool, ttlDays int64, maxGB float64) (localstorage.TempSettings, error)

func (*Client) UseSession

func (c *Client) UseSession(ctx context.Context, sessionID string) (core.ClientBinding, error)

func (*Client) WithAPIToken

func (c *Client) WithAPIToken(token string) *Client

type Health

type Health = core.HealthResponse

type LiveEvent

type LiveEvent struct {
	ID        uint64          `json:"id,omitempty"`
	Type      core.EventType  `json:"type"`
	SessionID string          `json:"session_id"`
	RunID     string          `json:"run_id,omitempty"`
	Payload   json.RawMessage `json:"payload,omitempty"`
	At        time.Time       `json:"at,omitempty"`
}

func (LiveEvent) DecodeApproval

func (e LiveEvent) DecodeApproval() (core.Approval, error)

func (LiveEvent) DecodeFileSnapshot

func (e LiveEvent) DecodeFileSnapshot() (core.FileSnapshot, error)

func (LiveEvent) DecodeMessage

func (e LiveEvent) DecodeMessage() (core.Message, error)

func (LiveEvent) DecodePermissionNotification

func (e LiveEvent) DecodePermissionNotification() (core.PermissionNotification, error)

func (LiveEvent) DecodePermissionRequest

func (e LiveEvent) DecodePermissionRequest() (core.PermissionRequest, error)

func (LiveEvent) DecodeRun

func (e LiveEvent) DecodeRun() (core.Run, error)

func (LiveEvent) DecodeToolUpdate

func (e LiveEvent) DecodeToolUpdate() (core.ToolUpdate, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL