client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDaemonClientRequired reports that the receiver client was nil.
	ErrDaemonClientRequired = errors.New("daemon client is required")
	// ErrDaemonContextRequired reports that the caller did not provide a request context.
	ErrDaemonContextRequired = errors.New("daemon request context is required")
	// ErrWorkflowSlugRequired reports that a workflow slug argument was blank.
	ErrWorkflowSlugRequired = errors.New("workflow slug is required")
	// ErrRunIDRequired reports that a run identifier argument was blank.
	ErrRunIDRequired = errors.New("run id is required")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client issues daemon API requests over the daemon Unix domain socket.

func New

func New(target Target) (*Client, error)

New constructs a transport client for one daemon target.

func (*Client) ArchiveTaskWorkflow

func (c *Client) ArchiveTaskWorkflow(
	ctx context.Context,
	workspace string,
	slug string,
) (apicore.ArchiveResult, error)

ArchiveTaskWorkflow archives one workflow through the daemon API.

func (*Client) CancelRun

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

CancelRun requests cancellation for one daemon-backed run.

func (*Client) DaemonStatus

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

DaemonStatus loads the primary daemon status payload.

func (*Client) DeleteWorkspace

func (c *Client) DeleteWorkspace(ctx context.Context, ref string) error

DeleteWorkspace unregisters one workspace.

func (*Client) FetchReview

func (c *Client) FetchReview(
	ctx context.Context,
	workspace string,
	slug string,
	req apicore.ReviewFetchRequest,
) (apicore.ReviewFetchResult, error)

FetchReview imports provider feedback into a daemon-backed review round.

func (*Client) GetLatestReview

func (c *Client) GetLatestReview(ctx context.Context, workspace string, slug string) (apicore.ReviewSummary, error)

GetLatestReview loads the latest review summary for one workflow.

func (*Client) GetReviewRound

func (c *Client) GetReviewRound(
	ctx context.Context,
	workspace string,
	slug string,
	round int,
) (apicore.ReviewRound, error)

GetReviewRound loads one daemon-backed review round summary.

func (*Client) GetRun

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

GetRun loads the latest daemon-backed run summary for one run.

func (*Client) GetRunSnapshot

func (c *Client) GetRunSnapshot(ctx context.Context, runID string) (apicore.RunSnapshot, error)

GetRunSnapshot loads the dense attach snapshot for one run.

func (*Client) GetRunTranscript

func (c *Client) GetRunTranscript(ctx context.Context, runID string) (apicore.RunTranscript, error)

GetRunTranscript loads the canonical structured transcript for one run.

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(ctx context.Context, ref string) (apicore.Workspace, error)

GetWorkspace loads one workspace by id or path key.

func (*Client) Health

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

Health probes the daemon readiness endpoint. A 503 response with a valid health payload is treated as a successful probe result rather than a transport error.

func (*Client) ListReviewIssues

func (c *Client) ListReviewIssues(
	ctx context.Context,
	workspace string,
	slug string,
	round int,
) ([]apicore.ReviewIssue, error)

ListReviewIssues loads the issue rows for one review round.

func (*Client) ListRunEvents

func (c *Client) ListRunEvents(
	ctx context.Context,
	runID string,
	after apicore.StreamCursor,
	limit int,
) (apicore.RunEventPage, error)

ListRunEvents pages through persisted daemon-backed events for one run.

func (*Client) ListRuns

func (c *Client) ListRuns(ctx context.Context, opts RunListOptions) ([]apicore.Run, error)

ListRuns lists daemon-managed runs for the requested workspace and filters.

func (*Client) ListTaskWorkflows

func (c *Client) ListTaskWorkflows(ctx context.Context, workspace string) ([]apicore.WorkflowSummary, error)

ListTaskWorkflows loads synced workflow summaries for one workspace.

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces(ctx context.Context) ([]apicore.Workspace, error)

ListWorkspaces loads registered workspaces.

func (*Client) OpenRunStream

func (c *Client) OpenRunStream(
	ctx context.Context,
	runID string,
	after apicore.StreamCursor,
) (RunStream, error)

OpenRunStream opens the daemon SSE stream for one run after the supplied cursor.

func (*Client) RegisterWorkspace

func (c *Client) RegisterWorkspace(
	ctx context.Context,
	path string,
	name string,
) (apicore.WorkspaceRegisterResult, error)

RegisterWorkspace registers one workspace explicitly.

func (*Client) ResolveWorkspace

func (c *Client) ResolveWorkspace(ctx context.Context, path string) (apicore.Workspace, error)

ResolveWorkspace resolves or lazily registers one workspace path.

func (*Client) StartExecRun

func (c *Client) StartExecRun(ctx context.Context, req apicore.ExecRequest) (apicore.Run, error)

StartExecRun starts one daemon-backed exec run.

func (*Client) StartReviewRun

func (c *Client) StartReviewRun(
	ctx context.Context,
	workspace string,
	slug string,
	round int,
	req apicore.ReviewRunRequest,
) (apicore.Run, error)

StartReviewRun starts one daemon-backed review-fix run.

func (*Client) StartReviewWatch

func (c *Client) StartReviewWatch(
	ctx context.Context,
	workspace string,
	slug string,
	req apicore.ReviewWatchRequest,
) (apicore.Run, error)

StartReviewWatch starts one daemon-owned review-watch parent run.

func (*Client) StartTaskRun

func (c *Client) StartTaskRun(
	ctx context.Context,
	slug string,
	req apicore.TaskRunRequest,
) (apicore.Run, error)

StartTaskRun starts one daemon-backed task workflow run.

func (*Client) StopDaemon

func (c *Client) StopDaemon(ctx context.Context, force bool) error

StopDaemon requests daemon shutdown.

func (*Client) SyncWorkflow

func (c *Client) SyncWorkflow(ctx context.Context, req apicore.SyncRequest) (apicore.SyncResult, error)

SyncWorkflow runs explicit daemon-backed reconciliation.

func (*Client) Target

func (c *Client) Target() Target

Target reports the transport endpoint in use.

type RemoteError

type RemoteError struct {
	StatusCode int
	Envelope   contract.TransportError
}

RemoteError captures the daemon's non-2xx transport error envelope.

func (*RemoteError) Error

func (e *RemoteError) Error() string

type RunListOptions

type RunListOptions struct {
	Workspace string
	Status    string
	Mode      string
	Limit     int
}

RunListOptions filters the daemon-backed run list query.

type RunStream

type RunStream interface {
	Items() <-chan RunStreamItem
	Errors() <-chan error
	Close() error
}

RunStream consumes daemon SSE frames until EOF, cancellation, or Close.

type RunStreamHeartbeat

type RunStreamHeartbeat struct {
	Cursor    apicore.StreamCursor
	Timestamp time.Time
}

RunStreamHeartbeat reports one idle heartbeat frame from the daemon stream.

type RunStreamItem

type RunStreamItem struct {
	Event     *events.Event
	Snapshot  *RunStreamSnapshot
	Heartbeat *RunStreamHeartbeat
	Overflow  *RunStreamOverflow
}

RunStreamItem is one parsed SSE delivery from the daemon.

type RunStreamOverflow

type RunStreamOverflow struct {
	Cursor    apicore.StreamCursor
	Reason    string
	Timestamp time.Time
}

RunStreamOverflow reports that the client must reconnect from the last acknowledged cursor.

type RunStreamSnapshot

type RunStreamSnapshot struct {
	Snapshot apicore.RunSnapshot
}

RunStreamSnapshot reports one snapshot frame from the daemon stream contract.

type Target

type Target struct {
	SocketPath string
}

Target identifies one daemon transport endpoint.

func (Target) String

func (t Target) String() string

String renders the transport target for logs and user-facing diagnostics.

func (Target) Validate

func (t Target) Validate() error

Validate ensures the target can be dialed over the Unix domain socket.

Jump to

Keyboard shortcuts

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