Documentation
¶
Index ¶
- Variables
- func AppendAgentInstructions(agent AgentConfig, prefix string) error
- func BranchExists(name string) bool
- func CheckGitHooks() []string
- func CheckGitRepo() bool
- func CheckGithubWorkflows() bool
- func CheckoutBranch(name string) error
- func CreateAndCheckoutBranch(name, base string) error
- func CurrentBranch() string
- func DefaultBranch() string
- func EnsureMCPConfig() error
- func FilterIssues(issues []*model.Issue, opts FilterOptions, currentUser string) []*model.Issue
- func FormatInboxItem(item InboxItem, me string) string
- func GenerateAgentDocs(prefix string) string
- func GenerateAgentStub(prefix string) string
- func GenerateMCPToolsRef() string
- func GenerateSkillMD() string
- func GenerateSpecGuide() string
- func GenerateUpdateTemplate(i *model.Issue) string
- func GetCommitDiffText(sha string) string
- func GetCompletionInstallCmd(shell string) string
- func GetDiffText(branch, base string) string
- func GitCommit(msg string)
- func IsMeaningfulActivityEvent(evt model.Event) bool
- func IsWorkingTreeClean() bool
- func ParseTimeFilter(input string) (time.Time, error)
- func ParseUpdateContent(content string, original *model.Issue) (*model.UpdatePayload, error)
- func ProjectIssues(events []model.Event) map[string]*model.Issue
- func ProjectIssuesWithConfig(events []model.Event, cfg *config.Config) map[string]*model.Issue
- func RemoteBranchExists(name string) bool
- func RunMigrations(currentVersion int) (int, error)
- func Slugify(s string) string
- func SortIssues(issues map[string]*model.Issue) []*model.Issue
- func UpdateConfigVersion(newVersion int) error
- func ValidateUser(user string) error
- func WithGitLock(fn func() error) error
- func WriteAgentSkill(agent AgentConfig) (string, error)
- type AgentConfig
- type AgentDetectionResult
- type AgentExecutor
- type AgentResult
- type AgentStats
- type ArchiveStats
- type Client
- func (c *Client) AddArtifact(issueID, artifactType, filename, content string) error
- func (c *Client) AddComment(issueID, text string) error
- func (c *Client) AddIssue(payload model.CreatePayload) (*model.Issue, error)
- func (c *Client) CheckDuplicates(title string) ([]*model.Issue, error)
- func (c *Client) DeleteArtifact(issueID, filename string) error
- func (c *Client) DeleteIssue(id string, reason string, cascade ...bool) error
- func (c *Client) DeleteSpec(issueID string) error
- func (c *Client) DeleteWalkthrough(issueID string) error
- func (c *Client) DriveIssue(opts DriveOptions) (*DriveResult, error)
- func (c *Client) FillLocalBranchStats(issue *model.Issue)
- func (c *Client) FindIssue(id string) (*model.Issue, []*model.Issue, bool, error)
- func (c *Client) GetArchiveStats(days int, keep int) (*ArchiveStats, error)
- func (c *Client) GetInbox(since time.Time) ([]InboxItem, error)
- func (c *Client) GetIssue(id string) (*model.Issue, error)
- func (c *Client) GetUser() string
- func (c *Client) IssueIDFromBranch(branch string) (*model.Issue, error)
- func (c *Client) ListArtifacts(issueID string) ([]model.ArtifactSummary, error)
- func (c *Client) ListIssues(opts FilterOptions) ([]*model.Issue, error)
- func (c *Client) MergeIssue(id string, opts MergeOptions) (*MergeResult, error)
- func (c *Client) PerformArchive(stats *ArchiveStats) error
- func (c *Client) ReadArtifact(issueID, filename string) (string, error)
- func (c *Client) ReadSpec(issueID string) (string, error)
- func (c *Client) ReadWalkthrough(issueID string) (string, error)
- func (c *Client) ResolveReviewIssue(idOrEmpty string) (*model.Issue, error)
- func (c *Client) StartWork(id string, force bool) (branchName string, msgs []string, err error)
- func (c *Client) UpdateIssue(id string, payload model.UpdatePayload, action string) ([]string, error)
- func (c *Client) WriteSpec(issueID, content string) error
- func (c *Client) WriteWalkthrough(issueID, content string) error
- type CommitDetail
- type CommitEntry
- type CommitFile
- type CompletionResult
- type DetailedCommit
- type DriveOptions
- type DriveResult
- type FileStat
- type FilterOptions
- type InboxItem
- type InitResult
- type LocalTransport
- func (t *LocalTransport) AddArtifact(issueID, artifactType, filename, content string) error
- func (t *LocalTransport) AddComment(issueID, text string) error
- func (t *LocalTransport) AddIssue(payload model.CreatePayload) (*model.Issue, error)
- func (t *LocalTransport) CheckDuplicates(title string) ([]*model.Issue, error)
- func (t *LocalTransport) DeleteArtifact(issueID, filename string) error
- func (t *LocalTransport) DeleteIssue(id string, reason string, cascade bool) error
- func (t *LocalTransport) DeleteSpec(issueID string) error
- func (t *LocalTransport) DeleteWalkthrough(issueID string) error
- func (t *LocalTransport) FindIssue(id string) (*model.Issue, []*model.Issue, bool, error)
- func (t *LocalTransport) GetInbox(since time.Time) ([]InboxItem, error)
- func (t *LocalTransport) GetIssue(id string) (*model.Issue, error)
- func (t *LocalTransport) GetUser() string
- func (t *LocalTransport) ListArtifacts(issueID string) ([]model.ArtifactSummary, error)
- func (t *LocalTransport) ListIssues(opts FilterOptions) ([]*model.Issue, error)
- func (t *LocalTransport) ReadArtifact(issueID, filename string) (string, error)
- func (t *LocalTransport) ReadSpec(issueID string) (string, error)
- func (t *LocalTransport) ReadWalkthrough(issueID string) (string, error)
- func (t *LocalTransport) UpdateIssue(id string, payload model.UpdatePayload, action string) ([]string, error)
- func (t *LocalTransport) WriteSpec(issueID, content string) error
- func (t *LocalTransport) WriteWalkthrough(issueID, content string) error
- type MCPConfigStatus
- type MergeOptions
- type MergeResult
- type MergeStrategy
- type RemoteTransport
- func (t *RemoteTransport) AddArtifact(issueID, artifactType, filename, content string) error
- func (r *RemoteTransport) AddComment(issueID, text string) error
- func (r *RemoteTransport) AddIssue(payload model.CreatePayload) (*model.Issue, error)
- func (r *RemoteTransport) CheckDuplicates(title string) ([]*model.Issue, error)
- func (t *RemoteTransport) DeleteArtifact(issueID, filename string) error
- func (r *RemoteTransport) DeleteIssue(id string, reason string, cascade bool) error
- func (t *RemoteTransport) DeleteSpec(issueID string) error
- func (t *RemoteTransport) DeleteWalkthrough(issueID string) error
- func (r *RemoteTransport) FindIssue(id string) (*model.Issue, []*model.Issue, bool, error)
- func (r *RemoteTransport) GetInbox(since time.Time) ([]InboxItem, error)
- func (r *RemoteTransport) GetIssue(id string) (*model.Issue, error)
- func (r *RemoteTransport) GetUser() string
- func (t *RemoteTransport) ListArtifacts(issueID string) ([]model.ArtifactSummary, error)
- func (r *RemoteTransport) ListIssues(opts FilterOptions) ([]*model.Issue, error)
- func (t *RemoteTransport) ReadArtifact(issueID, filename string) (string, error)
- func (t *RemoteTransport) ReadSpec(issueID string) (string, error)
- func (t *RemoteTransport) ReadWalkthrough(issueID string) (string, error)
- func (r *RemoteTransport) UpdateIssue(id string, payload model.UpdatePayload, action string) ([]string, error)
- func (t *RemoteTransport) WriteSpec(issueID, content string) error
- func (t *RemoteTransport) WriteWalkthrough(issueID, content string) error
- type StreamCallback
- type StreamEvent
- type StreamEventKind
- type TimelineEntry
- type Transport
Constants ¶
This section is empty.
Variables ¶
var AgentRegistry = []AgentConfig{ {Name: "Generic Agent", File: "AGENTS.md", Format: "markdown"}, {Name: "Claude Code", File: "CLAUDE.md", Binary: "claude", SkillDir: ".claude/skills", Format: "markdown"}, {Name: "Gemini", File: "GEMINI.md", Binary: "gemini", SkillDir: ".gemini/skills", Format: "markdown"}, {Name: "Cursor", File: ".cursorrules", Binary: "cursor", SkillDir: ".cursor/skills", Format: "plain"}, {Name: "Windsurf", File: ".windsurfrules", Binary: "windsurf", Format: "plain"}, {Name: "GitHub Copilot", File: ".github/copilot-instructions.md", Format: "markdown", NeedsDir: true}, {Name: "Cline", File: ".clinerules", Format: "markdown"}, {Name: "Roo Code", File: ".roorules", Format: "markdown"}, {Name: "Aider", File: "CONVENTIONS.md", Binary: "aider", Format: "markdown"}, {Name: "Continue", File: ".continue/rule./xpo.md", Format: "markdown", NeedsDir: true}, }
AgentRegistry contains all supported AI agent configurations
var ErrLocalOnly = errors.New("operation requires local mode")
ErrLocalOnly is returned when a local-only operation (git branch, merge, archive) is attempted on a remote transport.
Functions ¶
func AppendAgentInstructions ¶
func AppendAgentInstructions(agent AgentConfig, prefix string) error
AppendAgentInstructions appends xpo instructions to an agent file. For agents with skill support, writes the thin stub; otherwise writes the full docs.
func BranchExists ¶
BranchExists checks whether a local branch with the given name exists.
func CheckGitHooks ¶
func CheckGitHooks() []string
CheckGitHooks returns a list of active git hooks found.
func CheckGitRepo ¶
func CheckGitRepo() bool
CheckGitRepo checks if the current directory is a git repository.
func CheckGithubWorkflows ¶
func CheckGithubWorkflows() bool
CheckGithubWorkflows checks for existence of GitHub workflow files.
func CheckoutBranch ¶
CheckoutBranch switches to an existing branch.
func CreateAndCheckoutBranch ¶
CreateAndCheckoutBranch creates a new branch from base and checks it out.
func CurrentBranch ¶
func CurrentBranch() string
CurrentBranch returns the name of the currently checked-out branch.
func DefaultBranch ¶
func DefaultBranch() string
DefaultBranch returns the name of the default branch by inspecting the remote HEAD ref. Falls back to "main" if detection fails.
func EnsureMCPConfig ¶
func EnsureMCPConfig() error
EnsureMCPConfig creates or updates .mcp.json to include a xpo MCP server entry.
func FilterIssues ¶
FilterIssues applies filtering logic to a list of issues.
func FormatInboxItem ¶
FormatInboxItem renders a single inbox item as a one-line human sentence from the perspective of `me` (used to render "to you").
func GenerateAgentDocs ¶
GenerateAgentDocs generates the full xpo agent documentation for agents without skill support. This is the complete document combining stub + workflow + references inline.
func GenerateAgentStub ¶ added in v1.0.2
GenerateAgentStub generates the thin always-on stub for agent instruction files. This contains only hard invariants and a directive to load the xpo-workflow skill.
func GenerateMCPToolsRef ¶ added in v1.0.2
func GenerateMCPToolsRef() string
GenerateMCPToolsRef generates the mcp-tools.md reference content.
func GenerateSkillMD ¶ added in v1.0.2
func GenerateSkillMD() string
GenerateSkillMD generates the SKILL.md content for the xpo-workflow skill.
func GenerateSpecGuide ¶ added in v1.0.2
func GenerateSpecGuide() string
GenerateSpecGuide generates the spec-guide.md reference content.
func GenerateUpdateTemplate ¶
GenerateUpdateTemplate generates text content for editing an issue.
func GetCommitDiffText ¶
GetCommitDiffText returns the unified diff for a single commit.
func GetCompletionInstallCmd ¶
GetCompletionInstallCmd returns the command to install completion for the given shell
func GetDiffText ¶
GetDiffText returns the unified diff as a string.
func IsWorkingTreeClean ¶
func IsWorkingTreeClean() bool
func ParseTimeFilter ¶
ParseTimeFilter parses a time string (duration or date) into a time.Time.
func ParseUpdateContent ¶
ParseUpdateContent parses edited text content into an UpdatePayload.
func ProjectIssuesWithConfig ¶
ProjectIssuesWithConfig projects issues and applies config-driven automations.
func RemoteBranchExists ¶
RemoteBranchExists checks whether a remote branch with the given name exists.
func RunMigrations ¶
RunMigrations runs all pending migrations up to the current DataModelVersion.
func Slugify ¶
Slugify converts a string into a URL/branch-friendly slug. Lowercase, non-alphanumeric runs replaced with hyphens, truncated to ~50 characters on a word boundary.
func UpdateConfigVersion ¶
UpdateConfigVersion updates the version field in config.yaml
func ValidateUser ¶
ValidateUser validates that a user string matches the expected format "Name <email>".
func WithGitLock ¶
WithGitLock acquires an exclusive file lock on .xpo/git.lock before running fn, preventing concurrent git-mutating operations from corrupting the working tree. The lock is released when fn returns or if the process crashes.
func WriteAgentSkill ¶ added in v1.0.2
func WriteAgentSkill(agent AgentConfig) (string, error)
WriteAgentSkill writes the xpo-workflow skill to the agent's skill directory. Returns the skill directory path, or empty string if the agent has no skill support.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Name string // Agent name (e.g., "Cursor", "GitHub Copilot")
File string // Primary file path (e.g., ".cursorrules")
Binary string // CLI binary name for PATH detection (empty = not detectable via PATH)
SkillDir string // Skill directory for this harness (empty = no skill support)
Format string // "markdown" or "plain"
NeedsDir bool // If true, parent directory must be created
}
AgentConfig defines an AI agent and its instruction file location
func DetectInstalledAgents ¶ added in v1.0.2
func DetectInstalledAgents() []AgentConfig
DetectInstalledAgents returns agents whose CLI binary is found on PATH. Falls back to the Generic Agent if no specific agent is detected.
type AgentDetectionResult ¶
type AgentDetectionResult struct {
Agent AgentConfig
Exists bool
HasExponentialConfig bool
}
AgentDetectionResult contains information about a detected agent file
func DetectAgentFiles ¶
func DetectAgentFiles() []AgentDetectionResult
DetectAgentFiles scans for existing agent instruction files
type AgentExecutor ¶
type AgentExecutor interface {
Run(ctx context.Context, prompt string) (*AgentResult, error)
RunStreaming(ctx context.Context, prompt string, cb StreamCallback) (*AgentResult, error)
Name() string
Stats() AgentStats
}
AgentExecutor runs prompts against an AI agent.
func NewAgentExecutor ¶
func NewAgentExecutor(agent string, model ...string) AgentExecutor
NewAgentExecutor creates the appropriate executor for the given agent name. An optional model override can be passed (e.g. "sonnet") to use a specific model instead of the CLI default.
type AgentResult ¶
type AgentResult struct {
Output string
Duration time.Duration
TokensIn int
TokensOut int
CostUSD float64
}
AgentResult holds the output and usage from a single agent call.
type AgentStats ¶
type AgentStats struct {
Calls int
Duration time.Duration
TokensIn int
TokensOut int
CostUSD float64
}
AgentStats holds accumulated usage across multiple calls.
type ArchiveStats ¶
type Client ¶
type Client struct {
Transport Transport
Config *config.Config
Collapse bool
UserOverride string
OnBehalfOf string
Source string
// contains filtered or unexported fields
}
Client manages the interaction with the xpo issue tracker. It delegates data operations to a Transport (local or remote) and keeps git-only operations (start, merge, review) as direct methods.
func NewClient ¶
NewClient creates a new Client with the given configuration. By default it uses a LocalTransport. When cfg.Remote.URL is set, a RemoteTransport is used instead.
func (*Client) AddArtifact ¶
func (*Client) AddComment ¶
func (*Client) CheckDuplicates ¶
func (*Client) DeleteArtifact ¶
func (*Client) DeleteIssue ¶
func (*Client) DeleteSpec ¶
func (*Client) DeleteWalkthrough ¶
func (*Client) DriveIssue ¶
func (c *Client) DriveIssue(opts DriveOptions) (*DriveResult, error)
func (*Client) FillLocalBranchStats ¶
FillLocalBranchStats computes BranchStats from a local branch when no remote branch was detected. Checks both the current branch and any local branch whose name contains the issue ID.
func (*Client) GetArchiveStats ¶
func (c *Client) GetArchiveStats(days int, keep int) (*ArchiveStats, error)
GetArchiveStats calculates which issues would be archived.
func (*Client) IssueIDFromBranch ¶
IssueIDFromBranch attempts to find an issue whose ID matches a segment of the given branch name.
func (*Client) ListArtifacts ¶
func (c *Client) ListArtifacts(issueID string) ([]model.ArtifactSummary, error)
func (*Client) ListIssues ¶
func (c *Client) ListIssues(opts FilterOptions) ([]*model.Issue, error)
func (*Client) MergeIssue ¶
func (c *Client) MergeIssue(id string, opts MergeOptions) (*MergeResult, error)
MergeIssue merges the issue's branch into the default branch, records a MERGE event, and transitions the issue to DONE.
func (*Client) PerformArchive ¶
func (c *Client) PerformArchive(stats *ArchiveStats) error
PerformArchive executes the archiving operation.
func (*Client) ReadArtifact ¶
func (*Client) ResolveReviewIssue ¶
ResolveReviewIssue resolves an issue for review — either by explicit ID or by inferring from the current branch. If the issue has no BranchStats from remote detection, it fills them from the local branch.
func (*Client) StartWork ¶
StartWork transitions an issue to DOING and, when in a git repo, creates (or checks out) a branch named <issue-id>/<slugified-title>.
func (*Client) UpdateIssue ¶
func (*Client) WriteWalkthrough ¶
type CommitDetail ¶
type CommitDetail struct {
SHA string `json:"sha"`
Subject string `json:"subject"`
Body string `json:"body,omitempty"`
Author string `json:"author"`
Date string `json:"date"`
Files []CommitFile `json:"files"`
}
func GetCommitDetail ¶
func GetCommitDetail(sha string) *CommitDetail
type CommitEntry ¶
func ListBranchCommits ¶
func ListBranchCommits(branch, base string) []CommitEntry
ListBranchCommits returns the commits on branch relative to base, newest first.
type CommitFile ¶
type CompletionResult ¶
CompletionResult holds the status of shell completion configuration
func CheckCompletionConfig ¶
func CheckCompletionConfig() CompletionResult
CheckCompletionConfig detects the current shell and checks if completion is configured
type DetailedCommit ¶
type DetailedCommit struct {
SHA string `json:"sha"`
Message string `json:"message"`
Author string `json:"author"`
Date string `json:"date"`
}
func ListBranchCommitsDetailed ¶
func ListBranchCommitsDetailed(branch, base string) []DetailedCommit
ListBranchCommitsDetailed returns commits with author and date info.
type DriveOptions ¶
type DriveResult ¶
type FileStat ¶
func ListFilesChanged ¶
ListFilesChanged returns per-file stats for the branch relative to base.
type FilterOptions ¶
type FilterOptions struct {
Statuses []string
Since string
Before string
Match string
Mine bool
ParentID string
Label string
Assignee string
CycleID string
All bool
Archived bool
}
FilterOptions contains parameters for filtering issues.
type InboxItem ¶
type InboxItem struct {
IssueID string `json:"issue_id"`
IssueTitle string `json:"issue_title"`
Type model.EventType `json:"type"`
Payload interface{} `json:"payload"`
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by"`
OnBehalfOf string `json:"on_behalf_of,omitempty"`
}
InboxItem is a single event surfaced in a user's personal inbox feed.
func BuildInbox ¶
func BuildInbox(events []model.Event, issues map[string]*model.Issue, me string, since time.Time) []InboxItem
BuildInbox filters the full event log down to events relevant to `me` that occurred after `since`, newest-first. Relevance = events on issues where the user is the creator or current assignee — plus all MERGE events (team-wide visibility). The user's own actions are excluded so the inbox shows what others did. A zero `since` returns all matching events.
type InitResult ¶
InitResult contains the outcome of the initialization.
func InitProject ¶
func InitProject(force bool) (*InitResult, error)
InitProject initializes the .xpo directory structure.
type LocalTransport ¶
type LocalTransport struct {
Config *config.Config
Collapse bool
UserOverride string
OnBehalfOf string
Source string
}
LocalTransport implements Transport by reading and writing the local .xpo/issues.db event log directly.
func (*LocalTransport) AddArtifact ¶
func (t *LocalTransport) AddArtifact(issueID, artifactType, filename, content string) error
AddArtifact writes a generic artifact for an issue. Reserved filenames (spec.md, walkthrough.md) are rejected — use WriteSpec/WriteWalkthrough instead.
func (*LocalTransport) AddComment ¶
func (t *LocalTransport) AddComment(issueID, text string) error
AddComment adds a comment to an issue.
func (*LocalTransport) AddIssue ¶
func (t *LocalTransport) AddIssue(payload model.CreatePayload) (*model.Issue, error)
AddIssue creates a new issue and persists it. If payload.Status is empty, the issue defaults to BACKLOG. Side-effect rules (auto-progress, blocked_by checks) are not run on create — they apply only to subsequent updates.
func (*LocalTransport) CheckDuplicates ¶
func (t *LocalTransport) CheckDuplicates(title string) ([]*model.Issue, error)
CheckDuplicates searches for issues with similar titles.
func (*LocalTransport) DeleteArtifact ¶
func (t *LocalTransport) DeleteArtifact(issueID, filename string) error
DeleteArtifact removes an artifact from disk and records a "deleted" ARTIFACT event so the projection drops it from Issue.Artifacts.
func (*LocalTransport) DeleteIssue ¶
func (t *LocalTransport) DeleteIssue(id string, reason string, cascade bool) error
DeleteIssue deletes an issue by appending a delete event. When cascade is true, children are also deleted; otherwise their ParentID is cleared.
func (*LocalTransport) DeleteSpec ¶
func (t *LocalTransport) DeleteSpec(issueID string) error
func (*LocalTransport) DeleteWalkthrough ¶
func (t *LocalTransport) DeleteWalkthrough(issueID string) error
func (*LocalTransport) FindIssue ¶
FindIssue retrieves an issue by ID, checking the active store first, then the archive.
func (*LocalTransport) GetInbox ¶
func (t *LocalTransport) GetInbox(since time.Time) ([]InboxItem, error)
GetInbox scans the local event log for events relevant to the current user since the given cursor.
func (*LocalTransport) GetIssue ¶
func (t *LocalTransport) GetIssue(id string) (*model.Issue, error)
GetIssue retrieves an issue by ID, resolving short IDs if necessary.
func (*LocalTransport) GetUser ¶
func (t *LocalTransport) GetUser() string
GetUser returns the recorded author for new events. Resolution order: caller-provided override (used by MCP for agent identity), configured user, then git config as a last resort.
func (*LocalTransport) ListArtifacts ¶
func (t *LocalTransport) ListArtifacts(issueID string) ([]model.ArtifactSummary, error)
ListArtifacts returns the current artifacts attached to an issue, as derived from the projection.
func (*LocalTransport) ListIssues ¶
func (t *LocalTransport) ListIssues(opts FilterOptions) ([]*model.Issue, error)
ListIssues retrieves and filters issues based on options.
func (*LocalTransport) ReadArtifact ¶
func (t *LocalTransport) ReadArtifact(issueID, filename string) (string, error)
ReadArtifact returns the contents of an artifact for an issue.
func (*LocalTransport) ReadWalkthrough ¶
func (t *LocalTransport) ReadWalkthrough(issueID string) (string, error)
func (*LocalTransport) UpdateIssue ¶
func (t *LocalTransport) UpdateIssue(id string, payload model.UpdatePayload, action string) ([]string, error)
UpdateIssue updates an issue, handles side effects, and optionally creates a git commit when AutoCommit is enabled.
func (*LocalTransport) WriteSpec ¶
func (t *LocalTransport) WriteSpec(issueID, content string) error
func (*LocalTransport) WriteWalkthrough ¶
func (t *LocalTransport) WriteWalkthrough(issueID, content string) error
type MCPConfigStatus ¶
MCPConfigStatus describes the state of .mcp.json in the project root.
func DetectMCPConfig ¶
func DetectMCPConfig() MCPConfigStatus
DetectMCPConfig checks whether .mcp.json exists and contains a xpo entry.
type MergeOptions ¶
type MergeOptions struct {
Strategy MergeStrategy
CommitMessage string
DeleteBranch bool
KeepBranch bool
}
type MergeResult ¶
type MergeStrategy ¶
type MergeStrategy string
const ( MergeStrategyMerge MergeStrategy = "merge" MergeStrategySquash MergeStrategy = "squash" MergeStrategyFF MergeStrategy = "ff" )
type RemoteTransport ¶
RemoteTransport implements Transport by proxying to a xpo server over its existing REST API.
func (*RemoteTransport) AddArtifact ¶
func (t *RemoteTransport) AddArtifact(issueID, artifactType, filename, content string) error
func (*RemoteTransport) AddComment ¶
func (r *RemoteTransport) AddComment(issueID, text string) error
func (*RemoteTransport) AddIssue ¶
func (r *RemoteTransport) AddIssue(payload model.CreatePayload) (*model.Issue, error)
func (*RemoteTransport) CheckDuplicates ¶
func (r *RemoteTransport) CheckDuplicates(title string) ([]*model.Issue, error)
func (*RemoteTransport) DeleteArtifact ¶
func (t *RemoteTransport) DeleteArtifact(issueID, filename string) error
func (*RemoteTransport) DeleteIssue ¶
func (r *RemoteTransport) DeleteIssue(id string, reason string, cascade bool) error
func (*RemoteTransport) DeleteSpec ¶
func (t *RemoteTransport) DeleteSpec(issueID string) error
func (*RemoteTransport) DeleteWalkthrough ¶
func (t *RemoteTransport) DeleteWalkthrough(issueID string) error
func (*RemoteTransport) GetInbox ¶
func (r *RemoteTransport) GetInbox(since time.Time) ([]InboxItem, error)
GetInbox fetches the authenticated user's inbox from the server, which filters events server-side by identity and the optional since cursor.
func (*RemoteTransport) GetIssue ¶
func (r *RemoteTransport) GetIssue(id string) (*model.Issue, error)
func (*RemoteTransport) GetUser ¶
func (r *RemoteTransport) GetUser() string
func (*RemoteTransport) ListArtifacts ¶
func (t *RemoteTransport) ListArtifacts(issueID string) ([]model.ArtifactSummary, error)
func (*RemoteTransport) ListIssues ¶
func (r *RemoteTransport) ListIssues(opts FilterOptions) ([]*model.Issue, error)
func (*RemoteTransport) ReadArtifact ¶
func (t *RemoteTransport) ReadArtifact(issueID, filename string) (string, error)
func (*RemoteTransport) ReadSpec ¶
func (t *RemoteTransport) ReadSpec(issueID string) (string, error)
func (*RemoteTransport) ReadWalkthrough ¶
func (t *RemoteTransport) ReadWalkthrough(issueID string) (string, error)
func (*RemoteTransport) UpdateIssue ¶
func (r *RemoteTransport) UpdateIssue(id string, payload model.UpdatePayload, action string) ([]string, error)
func (*RemoteTransport) WriteSpec ¶
func (t *RemoteTransport) WriteSpec(issueID, content string) error
func (*RemoteTransport) WriteWalkthrough ¶
func (t *RemoteTransport) WriteWalkthrough(issueID, content string) error
type StreamCallback ¶ added in v1.0.2
type StreamCallback func(StreamEvent)
StreamCallback receives progress events during streaming execution.
type StreamEvent ¶ added in v1.0.2
type StreamEvent struct {
Kind StreamEventKind
Text string // text delta, tool name, or status message
ToolArg string // tool description or command (for StreamToolStart)
}
StreamEvent is a progress update emitted during streaming execution.
type StreamEventKind ¶ added in v1.0.2
type StreamEventKind int
StreamEventKind identifies the type of streaming progress event.
const ( StreamText StreamEventKind = iota // Partial text output StreamThinking // Agent is reasoning StreamToolStart // Agent started using a tool StreamToolDone // Tool execution completed StreamStatus // Status update (e.g. "requesting") )
type TimelineEntry ¶
type TimelineEntry struct {
Kind string `json:"kind"`
Timestamp time.Time `json:"timestamp"`
IssueID string `json:"issue_id,omitempty"`
IssueTitle string `json:"issue_title,omitempty"`
EventType string `json:"event_type,omitempty"`
Payload interface{} `json:"payload,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
OnBehalfOf string `json:"on_behalf_of,omitempty"`
Source string `json:"source,omitempty"`
SHA string `json:"sha,omitempty"`
Message string `json:"message,omitempty"`
Author string `json:"author,omitempty"`
Branch string `json:"branch,omitempty"`
}
func BuildTimeline ¶
type Transport ¶
type Transport interface {
ListIssues(opts FilterOptions) ([]*model.Issue, error)
GetIssue(id string) (*model.Issue, error)
FindIssue(id string) (issue *model.Issue, children []*model.Issue, archived bool, err error)
AddIssue(payload model.CreatePayload) (*model.Issue, error)
UpdateIssue(id string, payload model.UpdatePayload, action string) ([]string, error)
AddComment(issueID, text string) error
DeleteIssue(id string, reason string, cascade bool) error
CheckDuplicates(title string) ([]*model.Issue, error)
GetUser() string
GetInbox(since time.Time) ([]InboxItem, error)
// Artifacts
AddArtifact(issueID, artifactType, filename, content string) error
ReadArtifact(issueID, filename string) (string, error)
DeleteArtifact(issueID, filename string) error
ListArtifacts(issueID string) ([]model.ArtifactSummary, error)
WriteSpec(issueID, content string) error
ReadSpec(issueID string) (string, error)
DeleteSpec(issueID string) error
WriteWalkthrough(issueID, content string) error
ReadWalkthrough(issueID string) (string, error)
DeleteWalkthrough(issueID string) error
}
Transport abstracts issue data operations so the Client can work in both local mode (reading .xpo/issues.db directly) and remote mode (proxying to an exponential server over HTTP).
Source Files
¶
- add.go
- agent.go
- agents.go
- artifact.go
- branches.go
- checks.go
- client.go
- comment.go
- completion.go
- delete.go
- drive.go
- duplicates.go
- event.go
- git.go
- gitlock.go
- inbox.go
- list.go
- local_transport.go
- maintenance.go
- merge.go
- migrate.go
- projection.go
- remote_transport.go
- review.go
- setup.go
- slug.go
- start.go
- timeline.go
- transport.go
- update.go
- user.go