view

package
v0.10.195 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package view renders user-facing command output from typed values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderAgentsListJSON

func RenderAgentsListJSON(w io.Writer, result AgentsList) error

RenderAgentsListJSON writes the agent list as indented JSON.

func RenderAgentsListText

func RenderAgentsListText(w io.Writer, result AgentsList) error

RenderAgentsListText writes a stable human-readable agent list.

func RenderAgentsShowJSON

func RenderAgentsShowJSON(w io.Writer, result AgentsShow) error

RenderAgentsShowJSON writes the agent detail as indented JSON.

func RenderAgentsShowText

func RenderAgentsShowText(w io.Writer, result AgentsShow) error

RenderAgentsShowText writes a stable human-readable agent detail.

func RenderConfigAgentSourcesJSON added in v0.3.83

func RenderConfigAgentSourcesJSON(w io.Writer, result ConfigAgentSources) error

RenderConfigAgentSourcesJSON writes the agent-source list as indented JSON.

func RenderConfigAgentSourcesText added in v0.3.83

func RenderConfigAgentSourcesText(w io.Writer, result ConfigAgentSources) error

RenderConfigAgentSourcesText writes a stable human-readable agent-source list.

func RenderConfigClearJSON

func RenderConfigClearJSON(w io.Writer, result ConfigClear) error

RenderConfigClearJSON writes the clear summary as indented JSON.

func RenderConfigClearText

func RenderConfigClearText(w io.Writer, result ConfigClear) error

RenderConfigClearText writes a stable human-readable clear summary.

func RenderConfigJSON

func RenderConfigJSON(w io.Writer, show ConfigShow) error

RenderConfigJSON writes the config summary as indented JSON.

func RenderConfigPathJSON added in v0.3.80

func RenderConfigPathJSON(w io.Writer, result ConfigPath) error

RenderConfigPathJSON writes the config-path summary as indented JSON.

func RenderConfigPathText added in v0.3.80

func RenderConfigPathText(w io.Writer, result ConfigPath) error

RenderConfigPathText writes a stable human-readable config-path summary.

func RenderConfigResolveProfileJSON added in v0.3.82

func RenderConfigResolveProfileJSON(w io.Writer, result ConfigResolveProfile) error

RenderConfigResolveProfileJSON writes the resolution summary as indented JSON.

func RenderConfigResolveProfileText added in v0.3.82

func RenderConfigResolveProfileText(w io.Writer, result ConfigResolveProfile) error

RenderConfigResolveProfileText writes a stable human-readable resolution summary.

func RenderConfigRetentionJSON added in v0.3.87

func RenderConfigRetentionJSON(w io.Writer, result ConfigRetention) error

RenderConfigRetentionJSON writes the retention summary as indented JSON.

func RenderConfigRetentionText added in v0.3.87

func RenderConfigRetentionText(w io.Writer, result ConfigRetention) error

RenderConfigRetentionText writes a stable human-readable retention summary.

func RenderConfigRoutesJSON added in v0.3.81

func RenderConfigRoutesJSON(w io.Writer, result ConfigRoutes) error

RenderConfigRoutesJSON writes the route listing as indented JSON.

func RenderConfigRoutesText added in v0.3.81

func RenderConfigRoutesText(w io.Writer, result ConfigRoutes) error

RenderConfigRoutesText writes a stable human-readable route listing.

func RenderConfigSecretsProfileJSON added in v0.3.147

func RenderConfigSecretsProfileJSON(w io.Writer, profile ConfigSecretsProfile) error

RenderConfigSecretsProfileJSON writes one credential-store summary as indented JSON.

func RenderConfigSecretsProfileText added in v0.3.147

func RenderConfigSecretsProfileText(w io.Writer, profile ConfigSecretsProfile) error

RenderConfigSecretsProfileText writes one stable human-readable credential-store summary.

func RenderConfigSecretsProfilesJSON added in v0.3.147

func RenderConfigSecretsProfilesJSON(w io.Writer, result ConfigSecretsProfiles) error

RenderConfigSecretsProfilesJSON writes the credential-store listing as indented JSON.

func RenderConfigSecretsProfilesText added in v0.3.147

func RenderConfigSecretsProfilesText(w io.Writer, result ConfigSecretsProfiles) error

RenderConfigSecretsProfilesText writes a stable human-readable credential-store listing.

func RenderConfigText

func RenderConfigText(w io.Writer, show ConfigShow) error

RenderConfigText writes a stable human-readable config summary.

func RenderCredentialWriteJSON

func RenderCredentialWriteJSON(w io.Writer, result CredentialWrite) error

RenderCredentialWriteJSON writes a set-credential result envelope.

func RenderDataPruneJSON

func RenderDataPruneJSON(w io.Writer, result DataPrune) error

RenderDataPruneJSON writes a prune summary as indented JSON.

func RenderDataPruneText

func RenderDataPruneText(w io.Writer, result DataPrune) error

RenderDataPruneText writes a prune summary.

func RenderDataPurgeJSON

func RenderDataPurgeJSON(w io.Writer, result DataPurge) error

RenderDataPurgeJSON writes a purge summary as indented JSON.

func RenderDataPurgeText

func RenderDataPurgeText(w io.Writer, result DataPurge) error

RenderDataPurgeText writes a purge summary.

func RenderDataShowJSON

func RenderDataShowJSON(w io.Writer, result DataShow) error

RenderDataShowJSON writes data stats as indented JSON.

func RenderDataShowText

func RenderDataShowText(w io.Writer, result DataShow) error

RenderDataShowText writes stable human-readable data stats.

func RenderMeJSON

func RenderMeJSON(w io.Writer, result MeResult) error

RenderMeJSON writes the identity summary as indented JSON.

func RenderMeText

func RenderMeText(w io.Writer, result MeResult) error

RenderMeText writes a stable human-readable identity summary.

func RenderReviewDryRunJSON

func RenderReviewDryRunJSON(w io.Writer, result ReviewDryRun) error

RenderReviewDryRunJSON writes a dry-run summary as indented JSON.

func RenderReviewDryRunText

func RenderReviewDryRunText(w io.Writer, result ReviewDryRun) error

RenderReviewDryRunText writes a human-readable dry-run summary.

func RenderReviewLiveJSON

func RenderReviewLiveJSON(w io.Writer, result ReviewLive) error

RenderReviewLiveJSON writes a live review summary as indented JSON.

func RenderReviewLiveText

func RenderReviewLiveText(w io.Writer, result ReviewLive) error

RenderReviewLiveText writes a human-readable live review summary.

func RenderSessionsDeleteJSON

func RenderSessionsDeleteJSON(w io.Writer, result SessionsDelete) error

RenderSessionsDeleteJSON writes a named-session deletion result as JSON.

func RenderSessionsDeleteText

func RenderSessionsDeleteText(w io.Writer, result SessionsDelete) error

RenderSessionsDeleteText writes a named-session deletion result.

func RenderSessionsListJSON

func RenderSessionsListJSON(w io.Writer, result SessionsList) error

RenderSessionsListJSON writes a named-session list as indented JSON.

func RenderSessionsListText

func RenderSessionsListText(w io.Writer, result SessionsList) error

RenderSessionsListText writes a stable human-readable session list.

func RenderSessionsShowJSON

func RenderSessionsShowJSON(w io.Writer, result SessionsShow) error

RenderSessionsShowJSON writes a named-session detail as indented JSON.

func RenderSessionsShowText

func RenderSessionsShowText(w io.Writer, result SessionsShow) error

RenderSessionsShowText writes stable human-readable session details.

Types

type AgentDetail

type AgentDetail struct {
	ID                   string            `json:"id"`
	Category             string            `json:"category"`
	CategoryDescription  string            `json:"category_description,omitempty"`
	CategoryOwner        string            `json:"category_owner,omitempty"`
	Name                 string            `json:"name"`
	Description          string            `json:"description,omitempty"`
	ModelTier            string            `json:"model_tier,omitempty"`
	ModelID              string            `json:"model_id,omitempty"`
	Effort               string            `json:"effort,omitempty"`
	FileGlobs            []string          `json:"file_globs,omitempty"`
	AppliesWhen          []string          `json:"applies_when,omitempty"`
	NeedsFullFileContent bool              `json:"needs_full_file_content"`
	Prompt               string            `json:"prompt"`
	Provenance           string            `json:"provenance"`
	Source               agents.SourceInfo `json:"source"`
}

AgentDetail describes one loaded agent.

type AgentSummary

type AgentSummary struct {
	ID          string            `json:"id"`
	Category    string            `json:"category"`
	Name        string            `json:"name"`
	Description string            `json:"description,omitempty"`
	ModelTier   string            `json:"model_tier,omitempty"`
	ModelID     string            `json:"model_id,omitempty"`
	Effort      string            `json:"effort,omitempty"`
	Provenance  string            `json:"provenance"`
	Source      agents.SourceInfo `json:"source"`
}

AgentSummary is one row in `cr agents list`.

type AgentsList

type AgentsList struct {
	Agents    []AgentSummary      `json:"agents"`
	Sources   []agents.SourceInfo `json:"sources,omitempty"`
	Repo      *agents.RepoInfo    `json:"repo,omitempty"`
	TrustNote string              `json:"trust_note,omitempty"`
}

AgentsList is the presentation model for `cr agents list`.

func NewAgentsList

func NewAgentsList(catalog agents.Catalog) AgentsList

NewAgentsList builds the list presentation model.

type AgentsShow

type AgentsShow struct {
	Agent     AgentDetail         `json:"agent"`
	Sources   []agents.SourceInfo `json:"sources,omitempty"`
	Repo      *agents.RepoInfo    `json:"repo,omitempty"`
	TrustNote string              `json:"trust_note,omitempty"`
}

AgentsShow is the presentation model for `cr agents show`.

func NewAgentsShow

func NewAgentsShow(agent agents.Agent, catalog agents.Catalog) AgentsShow

NewAgentsShow builds the detail presentation model.

type CacheClear added in v0.1.32

type CacheClear struct {
	Path   string `json:"path,omitempty"`
	Status string `json:"status,omitempty"`
	Error  string `json:"error,omitempty"`
}

CacheClear describes cache cleanup performed by `config clear --all`.

type ClearedCredentialRef

type ClearedCredentialRef struct {
	Ref  string   `json:"ref"`
	Keys []string `json:"keys"`
}

ClearedCredentialRef describes the keys removed from one credential ref.

type ConfigAgentSources added in v0.3.83

type ConfigAgentSources struct {
	ActiveProfile string   `json:"active_profile"`
	AgentSources  []string `json:"agent_sources"`
}

ConfigAgentSources is the presentation model for `cr config agent-source`.

type ConfigClear

type ConfigClear struct {
	Backend              string                 `json:"backend"`
	BackendSource        string                 `json:"backend_source"`
	ActiveSecretsProfile *ConfigSecretsProfile  `json:"active_secrets_profile,omitempty"`
	DryRun               bool                   `json:"dry_run"`
	Cleared              []ClearedCredentialRef `json:"cleared"`
	ConfigProfileRemoved string                 `json:"config_profile_removed,omitempty"`
	ConfigPathRemoved    string                 `json:"config_path_removed,omitempty"`
	Cache                *CacheClear            `json:"cache,omitempty"`
}

ConfigClear is the presentation model for `cr config clear`.

type ConfigPath added in v0.3.80

type ConfigPath struct {
	ConfigPath string `json:"config_path"`
	ConfigDir  string `json:"config_dir"`
}

ConfigPath is the presentation model for `cr config path`.

type ConfigResolveProfile added in v0.3.82

type ConfigResolveProfile struct {
	PRURL           string       `json:"pr_url"`
	ResolvedProfile string       `json:"resolved_profile"`
	Source          string       `json:"source"`
	GitHost         string       `json:"git_host"`
	MatchedRoute    *ConfigRoute `json:"matched_route,omitempty"`
}

ConfigResolveProfile is the presentation model for `cr config resolve-profile`.

type ConfigRetention added in v0.3.87

type ConfigRetention struct {
	MaxAgeDays  int    `json:"max_age_days"`
	Enforcement string `json:"enforcement"`
}

ConfigRetention is the presentation model for `cr config retention`.

func NewConfigRetention added in v0.3.87

func NewConfigRetention(retention config.RetentionConfig) ConfigRetention

NewConfigRetention builds the retention presentation model.

type ConfigRoute added in v0.3.81

type ConfigRoute struct {
	Profile   string   `json:"profile"`
	Host      string   `json:"host"`
	Namespace string   `json:"namespace"`
	Repos     []string `json:"repos,omitempty"`
}

ConfigRoute is one repository-profile route.

type ConfigRoutes added in v0.3.81

type ConfigRoutes struct {
	Routes []ConfigRoute `json:"routes"`
}

ConfigRoutes is the presentation model for `cr config route list`.

type ConfigSecretsProfile added in v0.3.147

type ConfigSecretsProfile struct {
	ID          string                              `json:"id"`
	Label       string                              `json:"label,omitempty"`
	Backend     string                              `json:"backend"`
	BackendInfo *ConfigSecretsProfileBackendDetails `json:"backend_info,omitempty"`
	ReadOnly    bool                                `json:"read_only,omitempty"`
	Source      string                              `json:"source"`
}

ConfigSecretsProfile is one effective credential store summary.

func (ConfigSecretsProfile) DisplayName added in v0.3.148

func (p ConfigSecretsProfile) DisplayName() string

DisplayName returns the best user-facing credential-store label.

type ConfigSecretsProfileBackendDetails added in v0.3.149

type ConfigSecretsProfileBackendDetails struct {
	OnePassword *ConfigSecretsProfileOnePassword `json:"onepassword,omitempty"`
}

ConfigSecretsProfileBackendDetails is the safe presentation wrapper for backend-specific non-secret credential-store metadata.

type ConfigSecretsProfileOnePassword added in v0.3.149

type ConfigSecretsProfileOnePassword struct {
	Timeout                string `json:"timeout,omitempty"`
	VaultID                string `json:"vault_id,omitempty"`
	ItemTitlePrefix        string `json:"item_title_prefix,omitempty"`
	ItemTag                string `json:"item_tag,omitempty"`
	ItemFieldTitle         string `json:"item_field_title,omitempty"`
	ConnectHost            string `json:"connect_host,omitempty"`
	ConnectTokenEnv        string `json:"connect_token_env,omitempty"`
	ServiceAccountTokenEnv string `json:"service_account_token_env,omitempty"`
	DesktopAccountID       string `json:"desktop_account_id,omitempty"`
	DesktopAccountEnv      string `json:"desktop_account_env,omitempty"`
}

ConfigSecretsProfileOnePassword is the safe presentation shape for one configured 1Password backend.

type ConfigSecretsProfiles added in v0.3.147

type ConfigSecretsProfiles struct {
	Profiles []ConfigSecretsProfile `json:"profiles"`
}

ConfigSecretsProfiles is the presentation model for `cr config credential-store list`.

type ConfigShow

type ConfigShow struct {
	ActiveProfile        string                           `json:"active_profile"`
	Profile              config.Profile                   `json:"profile"`
	Data                 config.DataConfig                `json:"data"`
	Backend              string                           `json:"backend,omitempty"`
	BackendSource        string                           `json:"backend_source,omitempty"`
	ActiveSecretsProfile *ConfigSecretsProfile            `json:"active_secrets_profile,omitempty"`
	SecretsProfiles      []config.EffectiveSecretsProfile `json:"secrets_profiles,omitempty"`
	CredentialRef        string                           `json:"credential_ref,omitempty"`
	CredentialRefs       []CredentialStatus               `json:"credential_refs"`
	LLMCredential        LLMCredential                    `json:"llm_credential"`
	AgentSources         []agents.SourceInfo              `json:"agent_sources,omitempty"`
}

ConfigShow is the presentation model for `cr config show`.

func NewConfigShow

func NewConfigShow(profileName string, profile config.Profile, data config.DataConfig, refs []CredentialStatus) ConfigShow

NewConfigShow builds the config presentation model.

type CredentialStatus

type CredentialStatus struct {
	Purpose string      `json:"purpose"`
	Ref     string      `json:"ref"`
	Mode    string      `json:"mode"`
	Keys    []KeyStatus `json:"keys,omitempty"`
}

CredentialStatus reports key presence for one declared credential ref.

type CredentialWrite

type CredentialWrite struct {
	Ref           string `json:"ref,omitempty"`
	Store         string `json:"store,omitempty"`
	Name          string `json:"name,omitempty"`
	Key           string `json:"key"`
	Backend       string `json:"backend,omitempty"`
	BackendSource string `json:"backend_source,omitempty"`
	Written       bool   `json:"written"`
	Error         string `json:"error,omitempty"`
}

CredentialWrite is the JSON envelope for `cr set-credential`.

type DataOrphanItem

type DataOrphanItem struct {
	Path  string `json:"path"`
	Bytes int64  `json:"bytes"`
}

DataOrphanItem describes one lifecycle orphan artifact directory.

type DataPrune

type DataPrune struct {
	DryRun         bool             `json:"dry_run"`
	SelectedRuns   []DataRunItem    `json:"selected_runs"`
	DeletedRuns    []DataRunItem    `json:"deleted_runs"`
	OrphansRemoved []DataOrphanItem `json:"orphans_removed"`
	Warnings       []string         `json:"warnings,omitempty"`
}

DataPrune is the presentation model for `cr data prune`.

func NewDataPrune

func NewDataPrune(result datalifecycle.PruneResult) DataPrune

NewDataPrune builds a prune presentation model.

type DataPurge

type DataPurge struct {
	DataRoot string `json:"data_root"`
	DryRun   bool   `json:"dry_run"`
	Removed  bool   `json:"removed"`
}

DataPurge is the presentation model for `cr data purge`.

func NewDataPurge

func NewDataPurge(result datalifecycle.PurgeResult) DataPurge

NewDataPurge builds a purge presentation model.

type DataRunItem

type DataRunItem struct {
	RunID        string    `json:"run_id"`
	PostMode     string    `json:"post_mode"`
	StartedAt    time.Time `json:"started_at"`
	ArtifactPath string    `json:"artifact_path"`
}

DataRunItem describes one lifecycle-selected run.

type DataShow

type DataShow struct {
	DataRoot      string         `json:"data_root"`
	LedgerPath    string         `json:"ledger_path"`
	RunsRoot      string         `json:"runs_root"`
	RunCount      int            `json:"run_count"`
	LiveRuns      int            `json:"live_runs"`
	DryRunRuns    int            `json:"dry_run_runs"`
	OutcomeCounts map[string]int `json:"outcome_counts"`
	OldestStarted *time.Time     `json:"oldest_started,omitempty"`
	NewestStarted *time.Time     `json:"newest_started,omitempty"`
	ArtifactBytes int64          `json:"artifact_bytes"`
	OrphanCount   int            `json:"orphan_count"`
	OrphanBytes   int64          `json:"orphan_bytes"`
}

DataShow is the presentation model for `cr data show`.

func NewDataShow

func NewDataShow(stats datalifecycle.Stats) DataShow

NewDataShow builds a data stats presentation model.

type KeyStatus

type KeyStatus struct {
	Key      string `json:"key"`
	Required bool   `json:"required"`
	Present  *bool  `json:"present,omitempty"`
	Status   string `json:"status"`
	Error    string `json:"error,omitempty"`
}

KeyStatus reports one non-secret key name and whether a value exists.

type LLMCredential

type LLMCredential struct {
	Mode string `json:"mode"`
	Ref  string `json:"ref,omitempty"`
}

LLMCredential describes how cr accounts for LLM credentials.

type MeProfile

type MeProfile struct {
	Profile               string `json:"profile"`
	CredentialSource      string `json:"credential_source"`
	Host                  string `json:"host"`
	Login                 string `json:"login"`
	ID                    string `json:"id"`
	DisplayName           string `json:"display_name"`
	PreviousIdentityCache string `json:"previous_identity_cache"`
	IdentityCacheUpdated  bool   `json:"identity_cache_updated"`
}

MeProfile describes one live identity lookup.

type MeResult

type MeResult struct {
	Profiles []MeProfile `json:"profiles"`
}

MeResult is the presentation model for `cr me`.

func NewMeResult

func NewMeResult(results []identity.ProfileResult) MeResult

NewMeResult builds the me presentation model.

type ReviewAction

type ReviewAction struct {
	ID            string          `json:"id"`
	Kind          string          `json:"kind"`
	FindingID     string          `json:"finding_id,omitempty"`
	ThreadID      string          `json:"thread_id,omitempty"`
	Status        string          `json:"status"`
	Required      bool            `json:"required"`
	MarkerOmitted bool            `json:"marker_omitted"`
	Payload       json.RawMessage `json:"payload"`
}

ReviewAction is one planned action.

type ReviewArtifacts

type ReviewArtifacts struct {
	Dir            string `json:"dir"`
	DiffPatch      string `json:"diff_patch"`
	SlicesDir      string `json:"slices_dir"`
	FindingsJSON   string `json:"findings_json"`
	RollupMarkdown string `json:"rollup_markdown"`
	AgentLogsDir   string `json:"agent_logs_dir"`
}

ReviewArtifacts lists dry-run artifact paths.

type ReviewDryRun

type ReviewDryRun struct {
	Run             ReviewRun       `json:"run"`
	Quota           *ReviewQuota    `json:"quota,omitempty"`
	RollupMarkdown  string          `json:"rollup_markdown"`
	Summary         ReviewSummary   `json:"summary"`
	Findings        []ReviewFinding `json:"findings"`
	Actions         []ReviewAction  `json:"actions"`
	Artifacts       ReviewArtifacts `json:"artifacts"`
	FailOnTriggered bool            `json:"fail_on_triggered"`
}

ReviewDryRun is the presentation model for `cr review --dry-run`.

type ReviewFinding

type ReviewFinding struct {
	ID        string `json:"id"`
	Severity  string `json:"severity"`
	FilePath  string `json:"file_path"`
	Anchoring string `json:"anchoring"`
	Side      string `json:"side,omitempty"`
	Line      *int   `json:"line,omitempty"`
	Body      string `json:"body"`
}

ReviewFinding is one dry-run finding summary.

type ReviewLive

type ReviewLive struct {
	Run             ReviewRun       `json:"run"`
	Status          string          `json:"status"`
	Decision        string          `json:"decision,omitempty"`
	Message         string          `json:"message,omitempty"`
	Outbox          ReviewOutbox    `json:"outbox"`
	Artifacts       ReviewArtifacts `json:"artifacts"`
	FailOnTriggered bool            `json:"fail_on_triggered"`
}

ReviewLive is the presentation model for live `cr review`.

type ReviewOutbox

type ReviewOutbox struct {
	Outcome        string `json:"outcome,omitempty"`
	ExitCode       int    `json:"exit_code"`
	Posted         int    `json:"posted"`
	Pending        int    `json:"pending"`
	FailedTerminal int    `json:"failed_terminal"`
	Aborted        bool   `json:"aborted"`
}

ReviewOutbox summarizes live posting state.

type ReviewQuota

type ReviewQuota struct {
	BlockRemainingPct  float64 `json:"block_remaining_pct"`
	WeeklyRemainingPct float64 `json:"weekly_remaining_pct"`
	Low                bool    `json:"low"`
}

ReviewQuota describes adapter quota when the adapter supports it.

type ReviewReviewerCoverageSummary added in v0.9.186

type ReviewReviewerCoverageSummary struct {
	AgentID        string   `json:"agent_id"`
	Status         string   `json:"status"`
	Scope          []string `json:"scope,omitempty"`
	InspectedFiles []string `json:"inspected_files,omitempty"`
	SkippedFiles   []string `json:"skipped_files,omitempty"`
	Constraints    []string `json:"constraints,omitempty"`
	Diagnostic     string   `json:"diagnostic,omitempty"`
}

ReviewReviewerCoverageSummary describes reviewer coverage rendered in the rollup summary.

type ReviewReviewerSummary added in v0.3.73

type ReviewReviewerSummary struct {
	Name     string `json:"name"`
	Findings int    `json:"findings"`
}

ReviewReviewerSummary is one reviewer row with its rendered finding count.

type ReviewRun

type ReviewRun struct {
	RunID          string `json:"run_id"`
	PRURL          string `json:"pr_url"`
	PRKey          string `json:"pr_key"`
	PostMode       string `json:"post_mode"`
	Outcome        string `json:"outcome"`
	ArtifactPath   string `json:"artifact_path"`
	BaseSHA        string `json:"base_sha,omitempty"`
	HeadSHA        string `json:"head_sha,omitempty"`
	CurrentBaseSHA string `json:"current_base_sha,omitempty"`
	CurrentHeadSHA string `json:"current_head_sha,omitempty"`
}

ReviewRun describes the durable run envelope.

type ReviewRunSummary added in v0.3.73

type ReviewRunSummary struct {
	ToolVersion       string                          `json:"tool_version,omitempty"`
	Adapter           string                          `json:"adapter,omitempty"`
	Model             string                          `json:"model,omitempty"`
	PostingIdentity   string                          `json:"posting_identity,omitempty"`
	SelectedReviewers []string                        `json:"selected_reviewers,omitempty"`
	ReviewerCoverage  []ReviewReviewerCoverageSummary `json:"reviewer_coverage,omitempty"`
	WallDurationMS    *int64                          `json:"wall_duration_ms"`
	Workstreams       []ReviewWorkstream              `json:"workstreams"`
}

ReviewRunSummary is the execution metadata rendered in the rollup footer.

type ReviewSummary added in v0.3.73

type ReviewSummary struct {
	Reviewers []ReviewReviewerSummary `json:"reviewers"`
	Threads   ReviewThreadCounts      `json:"threads"`
	Run       ReviewRunSummary        `json:"run"`
	Totals    ReviewWorkstreamTotals  `json:"totals"`
}

ReviewSummary mirrors the derived rollup metadata the rendered comment was built from. Usage fields are nullable; null means not reported, never zero.

type ReviewThreadCounts added in v0.3.73

type ReviewThreadCounts struct {
	Considered int `json:"considered"`
	Summarized int `json:"summarized"`
	Resolved   int `json:"resolved"`
}

ReviewThreadCounts summarizes PR discussion thread handling.

type ReviewWorkstream added in v0.3.73

type ReviewWorkstream struct {
	Name        string   `json:"name"`
	Model       string   `json:"model,omitempty"`
	TokensIn    *int     `json:"tokens_in"`
	TokensOut   *int     `json:"tokens_out"`
	CacheRead   *int     `json:"cache_read"`
	CacheCreate *int     `json:"cache_create"`
	CostUSD     *float64 `json:"cost_usd"`
	DurationMS  *int64   `json:"duration_ms"`
}

ReviewWorkstream is adapter-reported usage for one workstream.

type ReviewWorkstreamTotals added in v0.3.73

type ReviewWorkstreamTotals struct {
	TokensIn          *int     `json:"tokens_in"`
	TokensOut         *int     `json:"tokens_out"`
	CacheRead         *int     `json:"cache_read"`
	CacheCreate       *int     `json:"cache_create"`
	CostUSD           *float64 `json:"cost_usd"`
	ComputeDurationMS *int64   `json:"compute_duration_ms"`
}

ReviewWorkstreamTotals holds run-wide aggregates; each field is non-null only when every workstream reported it.

type SessionSummary

type SessionSummary struct {
	Name              string    `json:"name"`
	Profile           string    `json:"profile"`
	Provider          string    `json:"provider"`
	Adapter           string    `json:"adapter"`
	Model             string    `json:"model"`
	Host              string    `json:"host"`
	ProviderSessionID string    `json:"provider_session_id"`
	CreatedAt         time.Time `json:"created_at"`
	LastUsedAt        time.Time `json:"last_used_at"`
}

SessionSummary describes one named LLM session.

type SessionsDelete

type SessionsDelete struct {
	Name    string `json:"name"`
	Deleted bool   `json:"deleted"`
}

SessionsDelete is the presentation model for `cr sessions delete`.

func NewSessionsDelete

func NewSessionsDelete(name string) SessionsDelete

NewSessionsDelete builds a named-session deletion presentation model.

type SessionsList

type SessionsList struct {
	Sessions []SessionSummary `json:"sessions"`
}

SessionsList is the presentation model for `cr sessions list`.

func NewSessionsList

func NewSessionsList(sessions []ledger.NamedSession) SessionsList

NewSessionsList builds a named-session list presentation model.

type SessionsShow

type SessionsShow struct {
	Session SessionSummary `json:"session"`
}

SessionsShow is the presentation model for `cr sessions show`.

func NewSessionsShow

func NewSessionsShow(session ledger.NamedSession) SessionsShow

NewSessionsShow builds a named-session detail presentation model.

Jump to

Keyboard shortcuts

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