worksetapi

package
v0.3.0-alpha.55 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package worksetapi exposes a stable, JSON-friendly API for Workset.

The DTOs in this package are intended to mirror CLI JSON output. External callers should treat these shapes as stable, and internal code should avoid renaming fields or changing JSON tags without a compatibility plan.

Service provides CRUD-style operations for workspaces, repos, aliases, and groups, plus session and exec actions.

Example:

svc := worksetapi.NewService(worksetapi.Options{})
ctx := context.Background()
result, err := svc.ListWorkspaces(ctx)
if err != nil {
	// handle error
}
_ = result

Index

Constants

This section is empty.

Variables

View Source
var ErrTokenNotFound = errors.New("auth token not found")

ErrTokenNotFound indicates no token was stored.

Functions

func IsAuthRequiredError

func IsAuthRequiredError(err error) bool

IsAuthRequiredError reports whether the error indicates missing authentication.

Types

type AgentCLIStatusJSON

type AgentCLIStatusJSON struct {
	Installed      bool   `json:"installed"`
	Path           string `json:"path,omitempty"`
	ConfiguredPath string `json:"configuredPath,omitempty"`
	Command        string `json:"command"`
	Error          string `json:"error,omitempty"`
}

AgentCLIStatusJSON describes local availability for an agent command.

type AuthRequiredError

type AuthRequiredError struct{ Message string }

AuthRequiredError indicates a missing or invalid authentication token.

func (AuthRequiredError) Error

func (e AuthRequiredError) Error() string

type CheckAnnotationJSON

type CheckAnnotationJSON struct {
	Path      string `json:"path"`
	StartLine int    `json:"start_line"`
	EndLine   int    `json:"end_line"`
	Level     string `json:"level"`
	Message   string `json:"message"`
	Title     string `json:"title,omitempty"`
}

CheckAnnotationJSON describes a single check annotation.

type CheckAnnotationsResult

type CheckAnnotationsResult struct {
	Annotations []CheckAnnotationJSON `json:"annotations"`
}

CheckAnnotationsResult wraps check annotations payload.

type CommandResult

type CommandResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
}

CommandResult captures command output for integrations that need stdout/stderr.

type CommandRunner

type CommandRunner func(ctx context.Context, root string, command []string, env []string, stdin string) (CommandResult, error)

CommandRunner executes a command with optional stdin and captures its output.

type CommitAndPushInput

type CommitAndPushInput struct {
	Workspace WorkspaceSelector
	Repo      string
	Message   string // Empty = auto-generate via agent
	OnStage   func(stage CommitAndPushStage)
}

CommitAndPushInput describes inputs for committing and pushing changes.

type CommitAndPushResult

type CommitAndPushResult struct {
	Payload CommitAndPushResultJSON
	Config  config.GlobalConfigLoadInfo
}

CommitAndPushResult wraps the commit/push result with config metadata.

type CommitAndPushResultJSON

type CommitAndPushResultJSON struct {
	Committed bool   `json:"committed"`
	Pushed    bool   `json:"pushed"`
	Message   string `json:"message"`
	SHA       string `json:"sha,omitempty"`
}

CommitAndPushResultJSON describes the result of a commit and push operation.

type CommitAndPushStage

type CommitAndPushStage string

CommitAndPushStage describes progress phases for commit/push.

const (
	CommitAndPushStageGeneratingMessage CommitAndPushStage = "generating_message"
	CommitAndPushStageStaging           CommitAndPushStage = "staging"
	CommitAndPushStageCommitting        CommitAndPushStage = "committing"
	CommitAndPushStagePushing           CommitAndPushStage = "pushing"
)

type ConfigRecoverInput

type ConfigRecoverInput struct {
	WorkspaceRoot string
	RebuildRepos  bool
	DryRun        bool
}

ConfigRecoverInput controls config recovery behavior.

type ConfigRecoverResult

type ConfigRecoverResult struct {
	Payload ConfigRecoverResultJSON
	Config  config.GlobalConfigLoadInfo
}

ConfigRecoverResult wraps the recovery payload with config metadata.

type ConfigRecoverResultJSON

type ConfigRecoverResultJSON struct {
	Status              string   `json:"status"`
	WorkspaceRoot       string   `json:"workspace_root"`
	WorkspacesRecovered []string `json:"workspaces_recovered,omitempty"`
	ReposRecovered      []string `json:"repos_recovered,omitempty"`
	Conflicts           []string `json:"conflicts,omitempty"`
	Warnings            []string `json:"warnings,omitempty"`
	DryRun              bool     `json:"dry_run"`
}

ConfigRecoverResultJSON is the JSON payload for config recovery.

type ConfigSetResultJSON

type ConfigSetResultJSON struct {
	Status string `json:"status"`
	Key    string `json:"key"`
	Value  string `json:"value"`
}

ConfigSetResultJSON is the JSON payload for config set operations.

type ConfigStore

type ConfigStore interface {
	Load(ctx context.Context, path string) (config.GlobalConfig, config.GlobalConfigLoadInfo, error)
	Save(ctx context.Context, path string, cfg config.GlobalConfig) error
}

ConfigStore abstracts global config persistence for the Service.

type ConfigUpdater

type ConfigUpdater interface {
	Update(ctx context.Context, path string, fn func(cfg *config.GlobalConfig, info config.GlobalConfigLoadInfo) error) (config.GlobalConfigLoadInfo, error)
}

ConfigUpdater optionally provides atomic update support for global config.

type ConfirmationRequired

type ConfirmationRequired struct{ Message string }

ConfirmationRequired indicates an operation needs explicit confirmation.

func (ConfirmationRequired) Error

func (e ConfirmationRequired) Error() string

type ConflictError

type ConflictError struct{ Message string }

ConflictError indicates a conflicting resource already exists.

func (ConflictError) Error

func (e ConflictError) Error() string

type DeleteReviewCommentInput

type DeleteReviewCommentInput struct {
	Workspace WorkspaceSelector
	Repo      string
	CommentID int64
}

DeleteReviewCommentInput describes inputs for deleting a review comment.

type DeleteReviewCommentResult

type DeleteReviewCommentResult struct {
	Success bool
	Config  config.GlobalConfigLoadInfo
}

DeleteReviewCommentResult wraps the result of a delete operation.

type EditReviewCommentInput

type EditReviewCommentInput struct {
	Workspace WorkspaceSelector
	Repo      string
	CommentID int64
	Body      string
}

EditReviewCommentInput describes inputs for editing a review comment.

type EnvSnapshotResultJSON

type EnvSnapshotResultJSON struct {
	Updated     bool     `json:"updated"`
	AppliedKeys []string `json:"appliedKeys,omitempty"`
}

EnvSnapshotResultJSON reports whether a login-shell env snapshot updated values.

func EnsureLoginEnv

func EnsureLoginEnv(ctx context.Context) (EnvSnapshotResultJSON, error)

EnsureLoginEnv loads the login-shell environment once per process.

type ExecInput

type ExecInput struct {
	Workspace WorkspaceSelector
	Command   []string
}

ExecInput describes inputs for Exec.

type FileConfigStore

type FileConfigStore struct{}

FileConfigStore implements ConfigStore using filesystem-backed config.

func (FileConfigStore) Load

func (FileConfigStore) Save

func (FileConfigStore) Update

type FileWorkspaceStore

type FileWorkspaceStore struct{}

FileWorkspaceStore implements WorkspaceStore using filesystem-backed config/state.

func (FileWorkspaceStore) Init

func (FileWorkspaceStore) Init(_ context.Context, root, name string, defaults config.Defaults) (workspace.Workspace, error)

func (FileWorkspaceStore) Load

func (FileWorkspaceStore) LoadConfig

func (FileWorkspaceStore) LoadState

func (FileWorkspaceStore) SaveConfig

func (FileWorkspaceStore) SaveState

func (FileWorkspaceStore) SaveState(_ context.Context, root string, state workspace.State) error

type GetCheckAnnotationsInput

type GetCheckAnnotationsInput struct {
	Owner      string `json:"owner"`
	Repo       string `json:"repo"`
	CheckRunID int64  `json:"check_run_id"`
}

GetCheckAnnotationsInput describes inputs for fetching check annotations.

type GitHubAuthInfoJSON

type GitHubAuthInfoJSON struct {
	Mode   string               `json:"mode"`
	Status GitHubAuthStatusJSON `json:"status"`
	CLI    GitHubCLIStatusJSON  `json:"cli"`
}

GitHubAuthInfoJSON wraps auth mode, status, and CLI availability.

type GitHubAuthModeProvider

type GitHubAuthModeProvider interface {
	AuthMode(ctx context.Context) string
	SetAuthMode(ctx context.Context, mode string) error
}

GitHubAuthModeProvider exposes the selected GitHub auth mode.

type GitHubAuthStatusJSON

type GitHubAuthStatusJSON struct {
	Authenticated bool     `json:"authenticated"`
	Login         string   `json:"login,omitempty"`
	Name          string   `json:"name,omitempty"`
	Scopes        []string `json:"scopes,omitempty"`
	TokenSource   string   `json:"tokenSource,omitempty"`
}

GitHubAuthStatusJSON describes the current GitHub auth state.

type GitHubCLIStatusJSON

type GitHubCLIStatusJSON struct {
	Installed      bool   `json:"installed"`
	Version        string `json:"version,omitempty"`
	Path           string `json:"path,omitempty"`
	ConfiguredPath string `json:"configuredPath,omitempty"`
	Error          string `json:"error,omitempty"`
}

GitHubCLIStatusJSON describes the local GitHub CLI availability.

type GitHubClient

type GitHubClient interface {
	CreatePullRequest(ctx context.Context, owner, repo string, pr GitHubNewPullRequest) (GitHubPullRequest, error)
	GetPullRequest(ctx context.Context, owner, repo string, number int) (GitHubPullRequest, error)
	ListPullRequests(ctx context.Context, owner, repo, head, state string, page, perPage int) ([]GitHubPullRequest, int, error)
	ListReviewComments(ctx context.Context, owner, repo string, number, page, perPage int) ([]PullRequestReviewCommentJSON, int, error)
	CreateReplyComment(ctx context.Context, owner, repo string, number int, commentID int64, body string) (PullRequestReviewCommentJSON, error)
	EditReviewComment(ctx context.Context, owner, repo string, commentID int64, body string) (PullRequestReviewCommentJSON, error)
	DeleteReviewComment(ctx context.Context, owner, repo string, commentID int64) error
	ListCheckRuns(ctx context.Context, owner, repo, ref string, page, perPage int) ([]PullRequestCheckJSON, int, error)
	GetCheckRunAnnotations(ctx context.Context, owner, repo string, checkRunID int64) ([]CheckAnnotationJSON, error)
	GetRepoDefaultBranch(ctx context.Context, owner, repo string) (string, error)
	GetCurrentUser(ctx context.Context) (GitHubUserJSON, []string, error)
	ReviewThreadMap(ctx context.Context, owner, repo string, number int) (map[string]threadInfo, error)
	GetReviewThreadID(ctx context.Context, commentNodeID string) (string, error)
	ResolveReviewThread(ctx context.Context, threadID string, resolve bool) (bool, error)
}

GitHubClient executes GitHub API operations for a given host.

type GitHubNewPullRequest

type GitHubNewPullRequest struct {
	Title string
	Head  string
	Base  string
	Body  string
	Draft bool
}

GitHubNewPullRequest describes an API payload.

type GitHubPATImporter

type GitHubPATImporter interface {
	ImportPATFromEnv(ctx context.Context) (bool, error)
}

GitHubPATImporter supports importing PAT tokens from environment variables.

type GitHubProvider

type GitHubProvider interface {
	AuthStatus(ctx context.Context) (GitHubAuthStatusJSON, error)
	SetToken(ctx context.Context, token string) (GitHubAuthStatusJSON, error)
	ClearAuth(ctx context.Context) error
	Client(ctx context.Context, host string) (GitHubClient, error)
}

GitHubProvider selects an authenticated GitHub client and auth status.

func NewGitHubCLIProvider

func NewGitHubCLIProvider() GitHubProvider

func NewGitHubPATProvider

func NewGitHubPATProvider(store TokenStore) GitHubProvider

type GitHubProviderSelector

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

GitHubProviderSelector chooses the auth provider based on stored mode.

func NewGitHubProviderSelector

func NewGitHubProviderSelector(store TokenStore) *GitHubProviderSelector

func (*GitHubProviderSelector) AuthMode

func (p *GitHubProviderSelector) AuthMode(ctx context.Context) string

func (*GitHubProviderSelector) AuthStatus

func (*GitHubProviderSelector) ClearAuth

func (p *GitHubProviderSelector) ClearAuth(ctx context.Context) error

func (*GitHubProviderSelector) Client

func (*GitHubProviderSelector) ImportPATFromEnv

func (p *GitHubProviderSelector) ImportPATFromEnv(ctx context.Context) (bool, error)

func (*GitHubProviderSelector) SetAuthMode

func (p *GitHubProviderSelector) SetAuthMode(ctx context.Context, mode string) error

func (*GitHubProviderSelector) SetToken

type GitHubPullRequest

type GitHubPullRequest struct {
	Number    int
	URL       string
	Title     string
	Body      string
	Draft     bool
	State     string
	BaseRef   string
	HeadRef   string
	HeadSHA   string
	Mergeable *bool
}

GitHubPullRequest captures the fields used by Workset.

type GitHubTokenInput

type GitHubTokenInput struct {
	Token  string `json:"token"`
	Source string `json:"source,omitempty"`
}

GitHubTokenInput stores a GitHub API token.

type GitHubUserInput

type GitHubUserInput struct {
	Workspace WorkspaceSelector
	Repo      string
}

GitHubUserInput describes inputs for getting the current GitHub user.

type GitHubUserJSON

type GitHubUserJSON struct {
	ID    int64  `json:"id"`
	Login string `json:"login"`
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
}

GitHubUserJSON describes a GitHub user.

type GitHubUserResult

type GitHubUserResult struct {
	User   GitHubUserJSON
	Config config.GlobalConfigLoadInfo
}

GitHubUserResult wraps the current user with config metadata.

type GroupApplyInput

type GroupApplyInput struct {
	Workspace WorkspaceSelector
	Name      string
}

GroupApplyInput describes inputs for ApplyGroup.

type GroupApplyResultJSON

type GroupApplyResultJSON struct {
	Status    string `json:"status"`
	Template  string `json:"template"`
	Workspace string `json:"workspace"`
}

GroupApplyResultJSON is the JSON payload for group apply operations.

type GroupJSON

type GroupJSON struct {
	Name        string               `json:"name"`
	Description string               `json:"description,omitempty"`
	Members     []config.GroupMember `json:"members"`
}

GroupJSON is the JSON-friendly view of a group with members.

type GroupListResult

type GroupListResult struct {
	Groups []GroupSummaryJSON
	Config config.GlobalConfigLoadInfo
}

GroupListResult returns group summaries with config metadata.

type GroupMemberInput

type GroupMemberInput struct {
	GroupName string
	RepoName  string
}

GroupMemberInput describes inputs for AddGroupMember and RemoveGroupMember.

type GroupSummaryJSON

type GroupSummaryJSON struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	RepoCount   int    `json:"repo_count"`
}

GroupSummaryJSON is the JSON summary view of a group.

type GroupUpsertInput

type GroupUpsertInput struct {
	Name        string
	Description string
}

GroupUpsertInput describes inputs for CreateGroup and UpdateGroup.

type HookExecutionJSON

type HookExecutionJSON struct {
	Event   string        `json:"event"`
	Repo    string        `json:"repo"`
	ID      string        `json:"id"`
	Status  HookRunStatus `json:"status"`
	LogPath string        `json:"log_path,omitempty"`
}

HookExecutionJSON reports hook execution results with repo and event context.

type HookPending

type HookPending struct {
	Event  string
	Repo   string
	Hooks  []string
	Status HookRunStatus
	Reason string
}

HookPending provides structured hook approval details.

type HookPendingJSON

type HookPendingJSON struct {
	Event  string        `json:"event"`
	Repo   string        `json:"repo"`
	Hooks  []string      `json:"hooks"`
	Status HookRunStatus `json:"status,omitempty"`
	Reason string        `json:"reason,omitempty"`
}

HookPendingJSON describes hooks waiting for approval/trust.

type HookProgress

type HookProgress struct {
	Phase     string        `json:"phase"`
	Event     string        `json:"event"`
	Repo      string        `json:"repo"`
	Workspace string        `json:"workspace,omitempty"`
	HookID    string        `json:"hook_id"`
	Reason    string        `json:"reason,omitempty"`
	Status    HookRunStatus `json:"status,omitempty"`
	LogPath   string        `json:"log_path,omitempty"`
	Error     string        `json:"error,omitempty"`
}

HookProgress describes lifecycle updates emitted while hooks run.

type HookProgressObserver

type HookProgressObserver interface {
	OnHookProgress(progress HookProgress)
}

HookProgressObserver receives live hook lifecycle updates.

type HookRunJSON

type HookRunJSON struct {
	ID      string        `json:"id"`
	Status  HookRunStatus `json:"status"`
	LogPath string        `json:"log_path,omitempty"`
}

HookRunJSON reports individual hook execution results.

type HookRunStatus

type HookRunStatus string
const (
	HookRunStatusOK      HookRunStatus = "ok"
	HookRunStatusFailed  HookRunStatus = "failed"
	HookRunStatusSkipped HookRunStatus = "skipped"
)

type HooksRunInput

type HooksRunInput struct {
	Workspace WorkspaceSelector
	Repo      string
	Event     string
	Reason    string
	TrustRepo bool
}

HooksRunInput describes inputs for running hooks.

type HooksRunResult

type HooksRunResult struct {
	Event   string
	Repo    string
	Results []HookRunJSON
	Config  config.GlobalConfigLoadInfo
}

HooksRunResult describes hook execution results.

type KeyringTokenStore

type KeyringTokenStore struct{}

KeyringTokenStore stores tokens in the OS keychain.

func (KeyringTokenStore) Delete

func (KeyringTokenStore) Delete(_ context.Context, key string) error

func (KeyringTokenStore) Get

func (KeyringTokenStore) Set

func (KeyringTokenStore) Set(_ context.Context, key, value string) error

type ListRemotesInput

type ListRemotesInput struct {
	Workspace WorkspaceSelector
	Repo      string
}

ListRemotesInput describes inputs for listing repo remotes.

type ListRemotesResult

type ListRemotesResult struct {
	Remotes []RemoteInfoJSON
}

ListRemotesResult wraps the remotes list.

type NotFoundError

type NotFoundError struct{ Message string }

NotFoundError indicates a missing resource.

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Options

type Options struct {
	ConfigPath     string
	ConfigStore    ConfigStore
	WorkspaceStore WorkspaceStore
	Git            git.Client
	SessionRunner  session.Runner
	CommandRunner  CommandRunner
	GitHubProvider GitHubProvider
	TokenStore     TokenStore
	// ExecFunc overrides how Exec runs commands (useful for embedding/tests).
	ExecFunc func(ctx context.Context, root string, command []string, env []string) error
	// HookRunner overrides how hooks run commands (useful for embedding/tests).
	HookRunner hooks.Runner
	// HookObserver receives per-hook execution lifecycle updates.
	HookObserver HookProgressObserver
	Clock        func() time.Time
	Logf         func(format string, args ...any)
}

Options configures a Service instance. Zero values select defaults that match the CLI behavior.

type PullRequestCheckJSON

type PullRequestCheckJSON struct {
	Name        string `json:"name"`
	Status      string `json:"status"`
	Conclusion  string `json:"conclusion,omitempty"`
	DetailsURL  string `json:"details_url,omitempty"`
	StartedAt   string `json:"started_at,omitempty"`
	CompletedAt string `json:"completed_at,omitempty"`
	CheckRunID  int64  `json:"check_run_id,omitempty"`
}

PullRequestCheckJSON describes a single check run.

type PullRequestCreateInput

type PullRequestCreateInput struct {
	Workspace  WorkspaceSelector
	Repo       string
	Base       string
	Head       string
	BaseRemote string // Optional: override auto-detected base remote
	Title      string
	Body       string
	Draft      bool
	AutoCommit bool
	AutoPush   bool
}

PullRequestCreateInput describes inputs for CreatePullRequest.

type PullRequestCreateResult

type PullRequestCreateResult struct {
	Payload PullRequestCreatedJSON
	Config  config.GlobalConfigLoadInfo
}

PullRequestCreateResult wraps PR creation payload with config metadata.

type PullRequestCreatedJSON

type PullRequestCreatedJSON struct {
	Repo       string `json:"repo"`
	Number     int    `json:"number"`
	URL        string `json:"url"`
	Title      string `json:"title"`
	Body       string `json:"body,omitempty"`
	Draft      bool   `json:"draft"`
	State      string `json:"state"`
	BaseRepo   string `json:"base_repo"`
	BaseBranch string `json:"base_branch"`
	HeadRepo   string `json:"head_repo"`
	HeadBranch string `json:"head_branch"`
}

PullRequestCreatedJSON describes a created pull request.

type PullRequestGenerateInput

type PullRequestGenerateInput struct {
	Workspace    WorkspaceSelector
	Repo         string
	Base         string
	Head         string
	MaxDiffBytes int
}

PullRequestGenerateInput describes inputs for AI PR generation.

type PullRequestGenerateResult

type PullRequestGenerateResult struct {
	Payload PullRequestGeneratedJSON
	Config  config.GlobalConfigLoadInfo
}

PullRequestGenerateResult wraps generated text with config metadata.

type PullRequestGeneratedJSON

type PullRequestGeneratedJSON struct {
	Title string `json:"title"`
	Body  string `json:"body"`
}

PullRequestGeneratedJSON is the AI-generated title/body.

type PullRequestReviewCommentJSON

type PullRequestReviewCommentJSON struct {
	ID             int64  `json:"id"`
	NodeID         string `json:"node_id,omitempty"`
	ThreadID       string `json:"thread_id,omitempty"`
	ReviewID       int64  `json:"review_id,omitempty"`
	Author         string `json:"author,omitempty"`
	AuthorID       int64  `json:"author_id,omitempty"`
	Body           string `json:"body"`
	Path           string `json:"path"`
	Line           int    `json:"line,omitempty"`
	Side           string `json:"side,omitempty"`
	CommitID       string `json:"commit_id,omitempty"`
	OriginalCommit string `json:"original_commit_id,omitempty"`
	OriginalLine   int    `json:"original_line,omitempty"`
	OriginalStart  int    `json:"original_start_line,omitempty"`
	Outdated       bool   `json:"outdated"`
	URL            string `json:"url,omitempty"`
	CreatedAt      string `json:"created_at,omitempty"`
	UpdatedAt      string `json:"updated_at,omitempty"`
	InReplyTo      int64  `json:"in_reply_to,omitempty"`
	Resolved       bool   `json:"resolved,omitempty"`
	ReplyToComment bool   `json:"reply,omitempty"`
}

PullRequestReviewCommentJSON describes a review comment.

type PullRequestReviewCommentsResult

type PullRequestReviewCommentsResult struct {
	Comments []PullRequestReviewCommentJSON
	Config   config.GlobalConfigLoadInfo
}

PullRequestReviewCommentsResult wraps review comments with config metadata.

type PullRequestReviewsInput

type PullRequestReviewsInput struct {
	Workspace WorkspaceSelector
	Repo      string
	Number    int
	Branch    string
}

PullRequestReviewsInput describes inputs for listing review comments.

type PullRequestStatusInput

type PullRequestStatusInput struct {
	Workspace WorkspaceSelector
	Repo      string
	Number    int
	Branch    string
}

PullRequestStatusInput describes inputs for PR status/checks.

type PullRequestStatusJSON

type PullRequestStatusJSON struct {
	Repo       string `json:"repo"`
	Number     int    `json:"number"`
	URL        string `json:"url"`
	Title      string `json:"title"`
	State      string `json:"state"`
	Draft      bool   `json:"draft"`
	BaseRepo   string `json:"base_repo"`
	BaseBranch string `json:"base_branch"`
	HeadRepo   string `json:"head_repo"`
	HeadBranch string `json:"head_branch"`
	Mergeable  string `json:"mergeable,omitempty"`
}

PullRequestStatusJSON summarizes a pull request.

type PullRequestStatusResult

type PullRequestStatusResult struct {
	PullRequest PullRequestStatusJSON
	Checks      []PullRequestCheckJSON
	Config      config.GlobalConfigLoadInfo
}

PullRequestStatusResult wraps status payload with check runs.

type PullRequestTrackedInput

type PullRequestTrackedInput struct {
	Workspace WorkspaceSelector
	Repo      string
}

PullRequestTrackedInput describes inputs for a tracked PR lookup.

type PullRequestTrackedJSON

type PullRequestTrackedJSON struct {
	Found       bool                   `json:"found"`
	PullRequest PullRequestCreatedJSON `json:"pull_request,omitempty"`
}

PullRequestTrackedJSON describes a locally tracked PR reference.

type PullRequestTrackedResult

type PullRequestTrackedResult struct {
	Payload PullRequestTrackedJSON
	Config  config.GlobalConfigLoadInfo
}

PullRequestTrackedResult wraps a tracked PR lookup.

type RegisteredRepoJSON

type RegisteredRepoJSON struct {
	Name          string `json:"name"`
	URL           string `json:"url,omitempty"`
	Path          string `json:"path,omitempty"`
	Remote        string `json:"remote,omitempty"`
	DefaultBranch string `json:"default_branch,omitempty"`
}

RegisteredRepoJSON is the JSON-friendly view of a registered repo entry.

type RegisteredRepoListResult

type RegisteredRepoListResult struct {
	Repos  []RegisteredRepoJSON
	Config config.GlobalConfigLoadInfo
}

RegisteredRepoListResult returns registered repos with config metadata.

type RegisteredRepoMutationResultJSON

type RegisteredRepoMutationResultJSON struct {
	Status string `json:"status"`
	Name   string `json:"name"`
}

RegisteredRepoMutationResultJSON is the JSON payload for repo registry create/update/delete.

type RemoteInfoJSON

type RemoteInfoJSON struct {
	Name  string `json:"name"`
	Owner string `json:"owner"`
	Repo  string `json:"repo"`
}

RemoteInfoJSON describes a git remote.

type ReplyToReviewCommentInput

type ReplyToReviewCommentInput struct {
	Workspace WorkspaceSelector
	Repo      string
	Number    int    // PR number (0 = auto-detect)
	Branch    string // Branch to resolve PR if Number is 0
	CommentID int64
	Body      string
}

ReplyToReviewCommentInput describes inputs for replying to a review comment.

type RepoAddInput

type RepoAddInput struct {
	Workspace  WorkspaceSelector
	Source     string
	Name       string
	NameSet    bool
	RepoDir    string
	URL        string
	SourcePath string
}

RepoAddInput describes inputs for AddRepo.

type RepoAddResult

type RepoAddResult struct {
	Payload      RepoAddResultJSON
	WorktreePath string
	RepoDir      string
	Warnings     []string
	PendingHooks []HookPending
	HookRuns     []HookExecutionJSON
	Config       config.GlobalConfigLoadInfo
}

RepoAddResult includes worktree details and config metadata.

type RepoAddResultJSON

type RepoAddResultJSON struct {
	Status       string            `json:"status"`
	Workspace    string            `json:"workspace"`
	Repo         string            `json:"repo"`
	LocalPath    string            `json:"local_path"`
	Managed      bool              `json:"managed"`
	PendingHooks []HookPendingJSON `json:"pending_hooks,omitempty"`
}

RepoAddResultJSON is the JSON payload for repo add operations.

type RepoJSON

type RepoJSON struct {
	Name          string `json:"name"`
	LocalPath     string `json:"local_path"`
	Managed       bool   `json:"managed"`
	RepoDir       string `json:"repo_dir"`
	Remote        string `json:"remote"`
	DefaultBranch string `json:"default_branch"`
}

RepoJSON is the JSON-friendly view of a workspace repo entry.

type RepoListResult

type RepoListResult struct {
	Repos  []RepoJSON
	Config config.GlobalConfigLoadInfo
}

RepoListResult returns repos for a workspace with config metadata.

type RepoLocalStatusInput

type RepoLocalStatusInput struct {
	Workspace WorkspaceSelector
	Repo      string
}

RepoLocalStatusInput describes inputs for checking local repo status.

type RepoLocalStatusJSON

type RepoLocalStatusJSON struct {
	HasUncommitted bool   `json:"hasUncommitted"`
	Ahead          int    `json:"ahead"`
	Behind         int    `json:"behind"`
	CurrentBranch  string `json:"currentBranch"`
}

RepoLocalStatusJSON describes the local status of a repo.

type RepoLocalStatusResult

type RepoLocalStatusResult struct {
	Payload RepoLocalStatusJSON
	Config  config.GlobalConfigLoadInfo
}

RepoLocalStatusResult wraps local status with config metadata.

type RepoRegistryInput

type RepoRegistryInput struct {
	Name             string
	Source           string
	DefaultBranch    string
	Remote           string
	SourceSet        bool
	DefaultBranchSet bool
	RemoteSet        bool
}

RepoRegistryInput describes inputs for RegisterRepo and UpdateRegisteredRepo.

type RepoRemoveDeletedJSON

type RepoRemoveDeletedJSON struct {
	Worktrees bool `json:"worktrees"`
	Local     bool `json:"local"`
}

RepoRemoveDeletedJSON captures what was removed for a repo delete.

type RepoRemoveInput

type RepoRemoveInput struct {
	Workspace       WorkspaceSelector
	Name            string
	DeleteWorktrees bool
	DeleteLocal     bool
	Force           bool
	Confirmed       bool
	FetchRemotes    bool
}

RepoRemoveInput describes inputs for RemoveRepo.

type RepoRemoveResult

type RepoRemoveResult struct {
	Payload  RepoRemoveResultJSON
	Warnings []string
	Unpushed []string
	Safety   ops.RepoSafetyReport
	Config   config.GlobalConfigLoadInfo
}

RepoRemoveResult includes safety details and config metadata.

type RepoRemoveResultJSON

type RepoRemoveResultJSON struct {
	Status    string                `json:"status"`
	Workspace string                `json:"workspace"`
	Repo      string                `json:"repo"`
	Deleted   RepoRemoveDeletedJSON `json:"deleted"`
}

RepoRemoveResultJSON is the JSON payload for repo removal operations.

type RepoSelectionInput

type RepoSelectionInput struct {
	Workspace WorkspaceSelector
	Repo      string
}

RepoSelectionInput selects a repo within a workspace.

type RepoSnapshotJSON

type RepoSnapshotJSON struct {
	Name          string `json:"name"`
	LocalPath     string `json:"local_path"`
	Managed       bool   `json:"managed"`
	RepoDir       string `json:"repo_dir"`
	Remote        string `json:"remote"`
	DefaultBranch string `json:"default_branch"`
	Dirty         bool   `json:"dirty"`
	Missing       bool   `json:"missing"`
	StatusKnown   bool   `json:"status_known"`
}

RepoSnapshotJSON summarizes a workspace repo and optional status.

type RepoStatusJSON

type RepoStatusJSON struct {
	Name    string `json:"name"`
	Path    string `json:"path,omitempty"`
	State   string `json:"state"`
	Dirty   bool   `json:"dirty,omitempty"`
	Missing bool   `json:"missing,omitempty"`
	Error   string `json:"error,omitempty"`
}

RepoStatusJSON is the JSON payload for repo status reporting.

type ResolveReviewThreadInput

type ResolveReviewThreadInput struct {
	Workspace WorkspaceSelector
	Repo      string
	ThreadID  string // GraphQL node ID
	Resolve   bool   // true = resolve, false = unresolve
}

ResolveReviewThreadInput describes inputs for resolving/unresolving a review thread.

type ResolveReviewThreadResult

type ResolveReviewThreadResult struct {
	Resolved bool
	Config   config.GlobalConfigLoadInfo
}

ResolveReviewThreadResult wraps the result of a resolve/unresolve operation.

type ReviewCommentResult

type ReviewCommentResult struct {
	Comment PullRequestReviewCommentJSON
	Config  config.GlobalConfigLoadInfo
}

ReviewCommentResult wraps a single review comment with config metadata.

type Service

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

Service provides the public API for workspace, repo, alias, group, session, and exec operations.

func NewService

func NewService(opts Options) *Service

NewService constructs a Service with injected dependencies or defaults.

func (*Service) AddGroupMember

AddGroupMember adds a repo to a group.

func (*Service) AddRepo

func (s *Service) AddRepo(ctx context.Context, input RepoAddInput) (RepoAddResult, error)

AddRepo adds a repo to a workspace (clone or attach).

func (*Service) ApplyGroup

ApplyGroup applies a group template to a workspace.

func (*Service) ArchiveWorkspace

func (s *Service) ArchiveWorkspace(ctx context.Context, selector WorkspaceSelector, reason string) (WorkspaceRefJSON, config.GlobalConfigLoadInfo, error)

ArchiveWorkspace marks a workspace as archived in the global config.

func (*Service) AttachSession

func (s *Service) AttachSession(ctx context.Context, input SessionAttachInput) (SessionActionResult, error)

AttachSession attaches to a running session.

func (*Service) ClearGitHubAuth

func (s *Service) ClearGitHubAuth(ctx context.Context) error

ClearGitHubAuth removes any stored authentication token.

func (*Service) CommitAndPush

func (s *Service) CommitAndPush(ctx context.Context, input CommitAndPushInput) (CommitAndPushResult, error)

CommitAndPush commits all changes and pushes to the remote.

func (*Service) CreateAlias deprecated

CreateAlias is deprecated, use RegisterRepo instead.

Deprecated: Use RegisterRepo instead. This will be removed in a future version.

func (*Service) CreateGroup

CreateGroup creates or updates a group definition.

func (*Service) CreatePullRequest

func (s *Service) CreatePullRequest(ctx context.Context, input PullRequestCreateInput) (PullRequestCreateResult, error)

CreatePullRequest opens a pull request against the resolved upstream repo.

func (*Service) CreateWorkspace

func (s *Service) CreateWorkspace(ctx context.Context, input WorkspaceCreateInput) (WorkspaceCreateResult, error)

CreateWorkspace creates a new workspace and optionally adds repos/groups.

func (*Service) DeleteAlias deprecated

DeleteAlias is deprecated, use UnregisterRepo instead.

Deprecated: Use UnregisterRepo instead. This will be removed in a future version.

func (*Service) DeleteGroup

DeleteGroup removes a group by name.

func (*Service) DeleteReviewComment

func (s *Service) DeleteReviewComment(ctx context.Context, input DeleteReviewCommentInput) (DeleteReviewCommentResult, error)

DeleteReviewComment deletes a review comment.

func (*Service) DeleteSkill

func (s *Service) DeleteSkill(_ context.Context, scope, dirName, tool string) error

DeleteSkill removes a skill directory for a specific tool.

func (*Service) DeleteSkillWithRoot

func (s *Service) DeleteSkillWithRoot(_ context.Context, scope, dirName, tool, projectRoot string) error

DeleteSkillWithRoot removes a skill directory using an explicit project root.

func (*Service) DeleteWorkspace

func (s *Service) DeleteWorkspace(ctx context.Context, input WorkspaceDeleteInput) (WorkspaceDeleteResult, error)

DeleteWorkspace removes a workspace registration or deletes files when requested.

func (*Service) EditReviewComment

func (s *Service) EditReviewComment(ctx context.Context, input EditReviewCommentInput) (ReviewCommentResult, error)

EditReviewComment updates an existing review comment.

func (*Service) Exec

func (s *Service) Exec(ctx context.Context, input ExecInput) error

Exec runs a command inside the workspace root with standard env variables set.

func (*Service) GeneratePullRequestText

func (s *Service) GeneratePullRequestText(ctx context.Context, input PullRequestGenerateInput) (PullRequestGenerateResult, error)

GeneratePullRequestText runs the default agent to propose a title/body.

func (*Service) GetAgentCLIStatus

func (s *Service) GetAgentCLIStatus(ctx context.Context, agent string) (AgentCLIStatusJSON, error)

GetAgentCLIStatus reports whether the configured agent command is available.

func (*Service) GetAlias deprecated

GetAlias is deprecated, use GetRegisteredRepo instead.

Deprecated: Use GetRegisteredRepo instead. This will be removed in a future version.

func (*Service) GetCheckAnnotations

func (s *Service) GetCheckAnnotations(ctx context.Context, input GetCheckAnnotationsInput) (CheckAnnotationsResult, error)

GetCheckAnnotations returns annotations for a specific check run.

func (*Service) GetConfig

GetConfig loads the global config and its load metadata.

func (*Service) GetCurrentGitHubUser

func (s *Service) GetCurrentGitHubUser(ctx context.Context, input GitHubUserInput) (GitHubUserResult, error)

GetCurrentGitHubUser returns the authenticated GitHub user.

func (*Service) GetGitHubAuthInfo

func (s *Service) GetGitHubAuthInfo(ctx context.Context) (GitHubAuthInfoJSON, error)

GetGitHubAuthInfo reports auth mode, status, and local CLI availability.

func (*Service) GetGitHubAuthStatus

func (s *Service) GetGitHubAuthStatus(ctx context.Context) (GitHubAuthStatusJSON, error)

GetGitHubAuthStatus reports the current authentication state.

func (*Service) GetGitHubCLIStatus

func (s *Service) GetGitHubCLIStatus(ctx context.Context) (GitHubCLIStatusJSON, error)

GetGitHubCLIStatus reports whether the GitHub CLI is available on PATH.

func (*Service) GetGroup

GetGroup returns a single group by name.

func (*Service) GetPullRequestStatus

func (s *Service) GetPullRequestStatus(ctx context.Context, input PullRequestStatusInput) (PullRequestStatusResult, error)

GetPullRequestStatus returns the PR summary and checks.

func (*Service) GetRegisteredRepo

func (s *Service) GetRegisteredRepo(ctx context.Context, name string) (RegisteredRepoJSON, config.GlobalConfigLoadInfo, error)

GetRegisteredRepo returns a single registered repo by name.

func (*Service) GetRepoLocalStatus

func (s *Service) GetRepoLocalStatus(ctx context.Context, input RepoLocalStatusInput) (RepoLocalStatusResult, error)

GetRepoLocalStatus returns the local uncommitted/ahead/behind status for a repo.

func (*Service) GetSkill

func (s *Service) GetSkill(_ context.Context, scope, dirName, tool string) (SkillContent, error)

GetSkill reads the SKILL.md content for a specific skill.

func (*Service) GetSkillWithRoot

func (s *Service) GetSkillWithRoot(_ context.Context, scope, dirName, tool, projectRoot string) (SkillContent, error)

GetSkillWithRoot reads the SKILL.md content using an explicit project root.

func (*Service) GetTrackedPullRequest

func (s *Service) GetTrackedPullRequest(ctx context.Context, input PullRequestTrackedInput) (PullRequestTrackedResult, error)

GetTrackedPullRequest returns the last recorded PR for a repo.

func (*Service) ListAliases deprecated

func (s *Service) ListAliases(ctx context.Context) (RegisteredRepoListResult, error)

ListAliases is deprecated, use ListRegisteredRepos instead.

Deprecated: Use ListRegisteredRepos instead. This will be removed in a future version.

func (*Service) ListGroups

func (s *Service) ListGroups(ctx context.Context) (GroupListResult, error)

ListGroups returns group summaries from global config.

func (*Service) ListPullRequestReviewComments

func (s *Service) ListPullRequestReviewComments(ctx context.Context, input PullRequestReviewsInput) (PullRequestReviewCommentsResult, error)

ListPullRequestReviewComments returns review comments for a PR.

func (*Service) ListRegisteredRepos

func (s *Service) ListRegisteredRepos(ctx context.Context) (RegisteredRepoListResult, error)

ListRegisteredRepos returns all registered repos from config.

func (*Service) ListRemotes

func (s *Service) ListRemotes(ctx context.Context, input ListRemotesInput) (ListRemotesResult, error)

ListRemotes returns the list of git remotes for a repo with owner/repo info.

func (*Service) ListRepos

func (s *Service) ListRepos(ctx context.Context, selector WorkspaceSelector) (RepoListResult, error)

ListRepos lists repos configured for a workspace.

func (*Service) ListSessions

func (s *Service) ListSessions(ctx context.Context, selector WorkspaceSelector) (SessionListResult, error)

ListSessions lists known sessions for a workspace.

func (*Service) ListSkills

func (s *Service) ListSkills(_ context.Context, projectRoot string) ([]SkillInfo, error)

ListSkills scans all tool directories for SKILL.md files and returns a deduplicated list grouped by skill directory name and scope.

func (*Service) ListWorkspaceSnapshots

func (s *Service) ListWorkspaceSnapshots(ctx context.Context, opts WorkspaceSnapshotOptions) (WorkspaceSnapshotResult, error)

ListWorkspaceSnapshots returns workspace snapshots with optional repo status.

func (*Service) ListWorkspaces

func (s *Service) ListWorkspaces(ctx context.Context) (WorkspaceListResult, error)

ListWorkspaces returns registered workspaces from global config.

func (*Service) ListWorkspacesWithOptions

func (s *Service) ListWorkspacesWithOptions(ctx context.Context, opts WorkspaceListOptions) (WorkspaceListResult, error)

ListWorkspacesWithOptions returns registered workspaces with optional filters.

func (*Service) PinWorkspace

PinWorkspace pins or unpins a workspace.

func (*Service) RecoverConfig

func (s *Service) RecoverConfig(ctx context.Context, input ConfigRecoverInput) (ConfigRecoverResult, error)

RecoverConfig rebuilds workspace registrations (and optionally repo aliases) from workset.yaml files.

func (*Service) RegisterRepo

RegisterRepo adds a new repo to the registry.

func (*Service) ReloadLoginEnv

func (s *Service) ReloadLoginEnv(ctx context.Context) (EnvSnapshotResultJSON, error)

ReloadLoginEnv re-reads the login shell environment and applies changes.

func (*Service) RemoveGroupMember

func (s *Service) RemoveGroupMember(ctx context.Context, input GroupMemberInput) (GroupJSON, config.GlobalConfigLoadInfo, error)

RemoveGroupMember removes a repo from a group.

func (*Service) RemoveRepo

func (s *Service) RemoveRepo(ctx context.Context, input RepoRemoveInput) (RepoRemoveResult, error)

RemoveRepo removes a repo from a workspace and optionally deletes files.

func (*Service) RenameWorkspace

func (s *Service) RenameWorkspace(ctx context.Context, input WorkspaceRenameInput) (WorkspaceRefJSON, error)

RenameWorkspace updates the workspace name in global config and workset.yaml.

func (*Service) ReorderWorkspaces

func (s *Service) ReorderWorkspaces(ctx context.Context, orders map[string]int) ([]WorkspaceRefJSON, config.GlobalConfigLoadInfo, error)

ReorderWorkspaces updates the pin order for multiple workspaces. orders is a map of workspace name to pin order.

func (*Service) ReplyToReviewComment

func (s *Service) ReplyToReviewComment(ctx context.Context, input ReplyToReviewCommentInput) (ReviewCommentResult, error)

ReplyToReviewComment creates a reply to an existing review comment.

func (*Service) ResolveReviewThread

func (s *Service) ResolveReviewThread(ctx context.Context, input ResolveReviewThreadInput) (ResolveReviewThreadResult, error)

ResolveReviewThread resolves or unresolves a review thread using GraphQL.

func (*Service) RunHooks

func (s *Service) RunHooks(ctx context.Context, input HooksRunInput) (HooksRunResult, error)

func (*Service) SaveSkill

func (s *Service) SaveSkill(_ context.Context, scope, dirName, tool, content string) error

SaveSkill writes SKILL.md content for a specific skill, creating the directory if needed.

func (*Service) SaveSkillWithRoot

func (s *Service) SaveSkillWithRoot(_ context.Context, scope, dirName, tool, content, projectRoot string) error

SaveSkillWithRoot writes SKILL.md using an explicit project root.

func (*Service) SetAgentCLIPath

func (s *Service) SetAgentCLIPath(ctx context.Context, agent, path string) (AgentCLIStatusJSON, error)

SetAgentCLIPath stores an explicit path to the agent CLI binary.

func (*Service) SetDefault

SetDefault updates a defaults.* key in the global config.

func (*Service) SetGitHubAuthMode

func (s *Service) SetGitHubAuthMode(ctx context.Context, mode string) (GitHubAuthInfoJSON, error)

SetGitHubAuthMode switches the active GitHub auth provider.

func (*Service) SetGitHubCLIPath

func (s *Service) SetGitHubCLIPath(ctx context.Context, path string) (GitHubAuthInfoJSON, error)

SetGitHubCLIPath stores an explicit path to the GitHub CLI binary.

func (*Service) SetGitHubToken

func (s *Service) SetGitHubToken(ctx context.Context, input GitHubTokenInput) (GitHubAuthStatusJSON, error)

SetGitHubToken stores a personal access token for GitHub API usage.

func (*Service) SetWorkspaceColor

func (s *Service) SetWorkspaceColor(ctx context.Context, selector WorkspaceSelector, color string) (WorkspaceRefJSON, config.GlobalConfigLoadInfo, error)

SetWorkspaceColor sets the color for a workspace.

func (*Service) SetWorkspaceExpanded

func (s *Service) SetWorkspaceExpanded(ctx context.Context, selector WorkspaceSelector, expanded bool) (WorkspaceRefJSON, config.GlobalConfigLoadInfo, error)

SetWorkspaceExpanded sets the expanded state for a workspace.

func (*Service) ShowSession

ShowSession returns a single session record.

func (*Service) StartSession

func (s *Service) StartSession(ctx context.Context, input SessionStartInput) (SessionStartResult, error)

StartSession starts a new session for a workspace.

func (*Service) StatusWorkspace

func (s *Service) StatusWorkspace(ctx context.Context, selector WorkspaceSelector) (WorkspaceStatusResult, error)

StatusWorkspace reports per-repo status for a workspace.

func (*Service) StopSession

func (s *Service) StopSession(ctx context.Context, input SessionStopInput) (SessionActionResult, error)

StopSession stops a running session.

func (*Service) SyncSkill

func (s *Service) SyncSkill(_ context.Context, scope, dirName, fromTool string, toTools []string) error

SyncSkill copies a skill directory from one tool to others.

func (*Service) SyncSkillWithRoot

func (s *Service) SyncSkillWithRoot(_ context.Context, scope, dirName, fromTool string, toTools []string, projectRoot string) error

SyncSkillWithRoot copies a skill directory using an explicit project root.

func (*Service) TrustRepoHooks

func (s *Service) TrustRepoHooks(ctx context.Context, repoName string) (config.GlobalConfigLoadInfo, error)

func (*Service) UnarchiveWorkspace

func (s *Service) UnarchiveWorkspace(ctx context.Context, selector WorkspaceSelector) (WorkspaceRefJSON, config.GlobalConfigLoadInfo, error)

UnarchiveWorkspace removes archived flags for a workspace.

func (*Service) UnregisterRepo

UnregisterRepo removes a repo from the registry by name.

func (*Service) UpdateAlias deprecated

UpdateAlias is deprecated, use UpdateRegisteredRepo instead.

Deprecated: Use UpdateRegisteredRepo instead. This will be removed in a future version.

func (*Service) UpdateGroup

UpdateGroup updates an existing group definition.

func (*Service) UpdateRegisteredRepo

UpdateRegisteredRepo updates an existing registered repo.

func (*Service) UpdateWorkspaceLastUsed

func (s *Service) UpdateWorkspaceLastUsed(ctx context.Context, selector WorkspaceSelector) (WorkspaceRefJSON, config.GlobalConfigLoadInfo, error)

UpdateWorkspaceLastUsed updates the last used timestamp for a workspace.

type SessionActionResult

type SessionActionResult struct {
	Notice SessionNotice
	Config config.GlobalConfigLoadInfo
}

SessionActionResult captures notices for attach/stop actions.

type SessionAttachInput

type SessionAttachInput struct {
	Workspace WorkspaceSelector
	Backend   string
	Name      string
	Confirmed bool
}

SessionAttachInput describes inputs for AttachSession.

type SessionListResult

type SessionListResult struct {
	Sessions []SessionRecordJSON
	Config   config.GlobalConfigLoadInfo
}

SessionListResult returns sessions with config metadata.

type SessionNotice

type SessionNotice struct {
	Title         string
	Workspace     string
	Session       string
	Backend       string
	ThemeLabel    string
	ThemeHint     string
	AttachCommand string
	AttachNote    string
	DetachHint    string
	NameNotice    string
}

SessionNotice provides user-facing guidance for session operations.

type SessionRecordJSON

type SessionRecordJSON struct {
	Name         string   `json:"name"`
	Backend      string   `json:"backend"`
	Command      []string `json:"command,omitempty"`
	StartedAt    string   `json:"started_at,omitempty"`
	LastAttached string   `json:"last_attached,omitempty"`
	Running      bool     `json:"running"`
}

SessionRecordJSON describes a session entry for list/show calls.

type SessionShowInput

type SessionShowInput struct {
	Workspace WorkspaceSelector
	Backend   string
	Name      string
}

SessionShowInput describes inputs for ShowSession.

type SessionStartInput

type SessionStartInput struct {
	Workspace   WorkspaceSelector
	Backend     string
	Attach      bool
	Interactive bool
	Name        string
	Command     []string
	Confirmed   bool
}

SessionStartInput describes inputs for StartSession.

type SessionStartResult

type SessionStartResult struct {
	Notice   SessionNotice
	Attached bool
	Config   config.GlobalConfigLoadInfo
}

SessionStartResult captures notices and attachment state for StartSession.

type SessionStopInput

type SessionStopInput struct {
	Workspace WorkspaceSelector
	Backend   string
	Name      string
	Confirmed bool
}

SessionStopInput describes inputs for StopSession.

type SkillContent

type SkillContent struct {
	SkillInfo

	Content string `json:"content"`
}

SkillContent is a SkillInfo plus the raw SKILL.md content.

type SkillInfo

type SkillInfo struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	DirName     string   `json:"dirName"`
	Scope       string   `json:"scope"` // "global" or "project"
	Tools       []string `json:"tools"` // e.g. ["claude","codex","copilot","agents"]
	Path        string   `json:"path"`  // primary SKILL.md path (first found)
}

SkillInfo describes a discovered SKILL.md file.

type TokenStore

type TokenStore interface {
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key, value string) error
	Delete(ctx context.Context, key string) error
}

TokenStore persists authentication tokens.

type UnsafeOperation

type UnsafeOperation struct {
	Message  string
	Dirty    []string
	Unmerged []string
	Unpushed []string
	Warnings []string
}

UnsafeOperation describes safety concerns for potentially destructive actions.

func (UnsafeOperation) Error

func (e UnsafeOperation) Error() string

type ValidationError

type ValidationError struct{ Message string }

ValidationError indicates invalid input or state.

func (ValidationError) Error

func (e ValidationError) Error() string

type WorkspaceCreateInput

type WorkspaceCreateInput struct {
	Name   string
	Path   string
	Groups []string
	Repos  []string
}

WorkspaceCreateInput describes inputs for CreateWorkspace.

type WorkspaceCreateResult

type WorkspaceCreateResult struct {
	Workspace    WorkspaceCreatedJSON
	Warnings     []string
	PendingHooks []HookPending
	HookRuns     []HookExecutionJSON
	Config       config.GlobalConfigLoadInfo
}

WorkspaceCreateResult wraps the create payload with warnings and config metadata.

type WorkspaceCreatedJSON

type WorkspaceCreatedJSON struct {
	Name    string `json:"name"`
	Path    string `json:"path"`
	Workset string `json:"workset"`
	Branch  string `json:"branch"`
	Next    string `json:"next"`
}

WorkspaceCreatedJSON describes the JSON payload for a created workspace.

type WorkspaceDeleteInput

type WorkspaceDeleteInput struct {
	Selector     WorkspaceSelector
	DeleteFiles  bool
	Force        bool
	Confirmed    bool
	FetchRemotes bool
}

WorkspaceDeleteInput describes inputs for DeleteWorkspace.

type WorkspaceDeleteResult

type WorkspaceDeleteResult struct {
	Payload  WorkspaceDeleteResultJSON
	Warnings []string
	Unpushed []string
	Safety   ops.WorkspaceSafetyReport
	Config   config.GlobalConfigLoadInfo
}

WorkspaceDeleteResult includes safety details and config metadata.

type WorkspaceDeleteResultJSON

type WorkspaceDeleteResultJSON struct {
	Status       string `json:"status"`
	Name         string `json:"name,omitempty"`
	Path         string `json:"path"`
	DeletedFiles bool   `json:"deleted_files"`
}

WorkspaceDeleteResultJSON is the JSON payload for workspace deletion.

type WorkspaceListOptions

type WorkspaceListOptions struct {
	IncludeArchived bool
}

WorkspaceListOptions controls workspace listing behavior.

type WorkspaceListResult

type WorkspaceListResult struct {
	Workspaces []WorkspaceRefJSON
	Config     config.GlobalConfigLoadInfo
}

WorkspaceListResult returns registered workspaces with config load metadata.

type WorkspaceRefJSON

type WorkspaceRefJSON struct {
	Name           string `json:"name"`
	Path           string `json:"path"`
	CreatedAt      string `json:"created_at,omitempty"`
	LastUsed       string `json:"last_used,omitempty"`
	ArchivedAt     string `json:"archived_at,omitempty"`
	ArchivedReason string `json:"archived_reason,omitempty"`
	Archived       bool   `json:"archived"`
	Pinned         bool   `json:"pinned"`
	PinOrder       int    `json:"pin_order"`
	Color          string `json:"color,omitempty"`
	Expanded       bool   `json:"expanded"`
}

WorkspaceRefJSON is the JSON-friendly representation of a registered workspace.

type WorkspaceRenameInput

type WorkspaceRenameInput struct {
	Selector WorkspaceSelector
	NewName  string
}

WorkspaceRenameInput describes inputs for RenameWorkspace.

type WorkspaceSelector

type WorkspaceSelector struct {
	Value   string
	Require bool
}

WorkspaceSelector identifies a workspace by name or path. Require indicates whether missing selection should be treated as an error.

type WorkspaceSnapshotJSON

type WorkspaceSnapshotJSON struct {
	Name           string             `json:"name"`
	Path           string             `json:"path"`
	CreatedAt      string             `json:"created_at,omitempty"`
	LastUsed       string             `json:"last_used,omitempty"`
	ArchivedAt     string             `json:"archived_at,omitempty"`
	ArchivedReason string             `json:"archived_reason,omitempty"`
	Archived       bool               `json:"archived"`
	Pinned         bool               `json:"pinned"`
	PinOrder       int                `json:"pin_order"`
	Color          string             `json:"color,omitempty"`
	Expanded       bool               `json:"expanded"`
	Repos          []RepoSnapshotJSON `json:"repos"`
}

WorkspaceSnapshotJSON describes a workspace and its repos.

type WorkspaceSnapshotOptions

type WorkspaceSnapshotOptions struct {
	IncludeArchived bool `json:"include_archived"`
	IncludeStatus   bool `json:"include_status"`
}

WorkspaceSnapshotOptions controls workspace snapshot behavior.

type WorkspaceSnapshotResult

type WorkspaceSnapshotResult struct {
	Workspaces []WorkspaceSnapshotJSON
	Config     config.GlobalConfigLoadInfo
}

WorkspaceSnapshotResult returns workspace snapshots with config metadata.

type WorkspaceStatusResult

type WorkspaceStatusResult struct {
	Statuses []RepoStatusJSON
	Config   config.GlobalConfigLoadInfo
}

WorkspaceStatusResult returns per-repo status with config metadata.

type WorkspaceStore

type WorkspaceStore interface {
	Init(ctx context.Context, root, name string, defaults config.Defaults) (workspace.Workspace, error)
	Load(ctx context.Context, root string, defaults config.Defaults) (workspace.Workspace, error)
	LoadConfig(ctx context.Context, root string) (config.WorkspaceConfig, error)
	SaveConfig(ctx context.Context, root string, cfg config.WorkspaceConfig) error
	LoadState(ctx context.Context, root string) (workspace.State, error)
	SaveState(ctx context.Context, root string, state workspace.State) error
}

WorkspaceStore abstracts workspace config/state persistence for the Service.

Jump to

Keyboard shortcuts

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