Documentation
¶
Overview ¶
Package view renders user-facing command output from typed values.
Index ¶
- func Render(w io.Writer, asJSON bool, v any, text func(io.Writer) error) error
- func RenderAgentsListJSON(w io.Writer, result AgentsList) error
- func RenderAgentsListText(w io.Writer, result AgentsList) error
- func RenderAgentsShowJSON(w io.Writer, result AgentsShow) error
- func RenderAgentsShowText(w io.Writer, result AgentsShow) error
- func RenderConfigAgentSourcesJSON(w io.Writer, result ConfigAgentSources) error
- func RenderConfigAgentSourcesText(w io.Writer, result ConfigAgentSources) error
- func RenderConfigClearJSON(w io.Writer, result ConfigClear) error
- func RenderConfigClearText(w io.Writer, result ConfigClear) error
- func RenderConfigJSON(w io.Writer, show ConfigShow) error
- func RenderConfigPathJSON(w io.Writer, result ConfigPath) error
- func RenderConfigPathText(w io.Writer, result ConfigPath) error
- func RenderConfigResolveProfileJSON(w io.Writer, result ConfigResolveProfile) error
- func RenderConfigResolveProfileText(w io.Writer, result ConfigResolveProfile) error
- func RenderConfigRetentionJSON(w io.Writer, result ConfigRetention) error
- func RenderConfigRetentionText(w io.Writer, result ConfigRetention) error
- func RenderConfigRoutesJSON(w io.Writer, result ConfigRoutes) error
- func RenderConfigRoutesText(w io.Writer, result ConfigRoutes) error
- func RenderConfigSecretsStoreJSON(w io.Writer, profile ConfigSecretsStore) error
- func RenderConfigSecretsStoreText(w io.Writer, profile ConfigSecretsStore) error
- func RenderConfigSecretsStoresJSON(w io.Writer, result ConfigSecretsStores) error
- func RenderConfigSecretsStoresText(w io.Writer, result ConfigSecretsStores) error
- func RenderConfigText(w io.Writer, show ConfigShow) error
- func RenderCredentialWriteJSON(w io.Writer, result CredentialWrite) error
- func RenderDataPruneJSON(w io.Writer, result DataPrune) error
- func RenderDataPruneText(w io.Writer, result DataPrune) error
- func RenderDataPurgeJSON(w io.Writer, result DataPurge) error
- func RenderDataPurgeText(w io.Writer, result DataPurge) error
- func RenderDataShowJSON(w io.Writer, result DataShow) error
- func RenderDataShowText(w io.Writer, result DataShow) error
- func RenderJSON(w io.Writer, v any) error
- func RenderMeJSON(w io.Writer, result MeResult) error
- func RenderMeText(w io.Writer, result MeResult) error
- func RenderReviewDryRunJSON(w io.Writer, result ReviewDryRun) error
- func RenderReviewDryRunText(w io.Writer, result ReviewDryRun) error
- func RenderReviewLiveJSON(w io.Writer, result ReviewLive) error
- func RenderReviewLiveText(w io.Writer, result ReviewLive) error
- func RenderSessionsDeleteJSON(w io.Writer, result SessionsDelete) error
- func RenderSessionsDeleteText(w io.Writer, result SessionsDelete) error
- func RenderSessionsListJSON(w io.Writer, result SessionsList) error
- func RenderSessionsListText(w io.Writer, result SessionsList) error
- func RenderSessionsShowJSON(w io.Writer, result SessionsShow) error
- func RenderSessionsShowText(w io.Writer, result SessionsShow) error
- type AgentDetail
- type AgentSummary
- type AgentsList
- type AgentsShow
- type CacheClear
- type ClearedCredentialRef
- type ConfigAgentSources
- type ConfigClear
- type ConfigPath
- type ConfigResolveProfile
- type ConfigRetention
- type ConfigRoute
- type ConfigRoutes
- type ConfigSecretsStore
- type ConfigSecretsStoreBackendDetails
- type ConfigSecretsStoreOnePassword
- type ConfigSecretsStores
- type ConfigShow
- type ConfigShowSecretsStore
- type CredentialStatus
- type CredentialWrite
- type DataOrphanItem
- type DataPrune
- type DataPurge
- type DataRunItem
- type DataShow
- type KeyStatus
- type LLMCredential
- type MeProfile
- type MeResult
- type ModelMapRow
- type ReviewAction
- type ReviewArtifacts
- type ReviewDryRun
- type ReviewFinding
- type ReviewLive
- type ReviewOutbox
- type ReviewQuota
- type ReviewReviewerCoverageSummary
- type ReviewReviewerSummary
- type ReviewRun
- type ReviewRunSummary
- type ReviewSummary
- type ReviewThreadCounts
- type ReviewWorkstream
- type ReviewWorkstreamTotals
- type SessionSummary
- type SessionsDelete
- type SessionsList
- type SessionsShow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶ added in v0.10.228
Render writes v as JSON when asJSON is true, otherwise it calls text.
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 RenderConfigSecretsStoreJSON ¶ added in v0.10.238
func RenderConfigSecretsStoreJSON(w io.Writer, profile ConfigSecretsStore) error
RenderConfigSecretsStoreJSON writes one credential-store summary as indented JSON.
func RenderConfigSecretsStoreText ¶ added in v0.10.238
func RenderConfigSecretsStoreText(w io.Writer, profile ConfigSecretsStore) error
RenderConfigSecretsStoreText writes one stable human-readable credential-store summary.
func RenderConfigSecretsStoresJSON ¶ added in v0.10.238
func RenderConfigSecretsStoresJSON(w io.Writer, result ConfigSecretsStores) error
RenderConfigSecretsStoresJSON writes the credential-store listing as indented JSON.
func RenderConfigSecretsStoresText ¶ added in v0.10.238
func RenderConfigSecretsStoresText(w io.Writer, result ConfigSecretsStores) error
RenderConfigSecretsStoresText 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 ¶
RenderDataPruneJSON writes a prune summary as indented JSON.
func RenderDataPruneText ¶
RenderDataPruneText writes a prune summary.
func RenderDataPurgeJSON ¶
RenderDataPurgeJSON writes a purge summary as indented JSON.
func RenderDataPurgeText ¶
RenderDataPurgeText writes a purge summary.
func RenderDataShowJSON ¶
RenderDataShowJSON writes data stats as indented JSON.
func RenderDataShowText ¶
RenderDataShowText writes stable human-readable data stats.
func RenderJSON ¶ added in v0.10.228
RenderJSON writes indented JSON followed by a newline.
func RenderMeJSON ¶
RenderMeJSON writes the identity summary as indented JSON.
func RenderMeText ¶
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 ¶
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"`
ActiveSecretsStore *ConfigSecretsStore `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.
func (ConfigRoute) Target ¶ added in v0.10.228
func (r ConfigRoute) Target() string
Target returns the stable human-readable route target.
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 ConfigSecretsStore ¶ added in v0.10.238
type ConfigSecretsStore struct {
ID string `json:"id"`
Label string `json:"label,omitempty"`
Backend string `json:"backend"`
BackendInfo *ConfigSecretsStoreBackendDetails `json:"backend_info,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
Source string `json:"source"`
}
ConfigSecretsStore is one effective credential store summary.
func (ConfigSecretsStore) DisplayName ¶ added in v0.10.238
func (p ConfigSecretsStore) DisplayName() string
DisplayName returns the best user-facing credential-store label.
type ConfigSecretsStoreBackendDetails ¶ added in v0.10.238
type ConfigSecretsStoreBackendDetails struct {
OnePassword *ConfigSecretsStoreOnePassword `json:"onepassword,omitempty"`
}
ConfigSecretsStoreBackendDetails is the safe presentation wrapper for backend-specific non-secret credential-store metadata.
type ConfigSecretsStoreOnePassword ¶ added in v0.10.238
type ConfigSecretsStoreOnePassword struct {
Timeout string `json:"timeout,omitempty"`
VaultID string `json:"vault_id,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"`
}
ConfigSecretsStoreOnePassword is the safe presentation shape for one configured 1Password backend.
type ConfigSecretsStores ¶ added in v0.10.238
type ConfigSecretsStores struct {
Stores []ConfigSecretsStore `json:"profiles"`
}
ConfigSecretsStores 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"`
ActiveSecretsStore *ConfigSecretsStore `json:"active_secrets_profile,omitempty"`
SecretsStores []ConfigShowSecretsStore `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 ConfigShowSecretsStore ¶ added in v0.10.255
type ConfigShowSecretsStore struct {
ID string `json:"id"`
DisplayName string `json:"display_name,omitempty"`
Backend string `json:"backend"`
ReadOnly bool `json:"read_only,omitempty"`
Source config.EffectiveSecretsStoreSource `json:"source"`
Label string `json:"label,omitempty"`
}
ConfigShowSecretsStore preserves the legacy config-show wire names.
func NewConfigShowSecretsStores ¶ added in v0.10.255
func NewConfigShowSecretsStores(stores []config.EffectiveSecretsStore) []ConfigShowSecretsStore
NewConfigShowSecretsStores maps the canonical config inventory to its legacy wire shape.
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 ¶
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 ¶
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 ModelMapRow ¶ added in v0.10.228
type ModelMapRow struct {
Tier string `json:"tier"`
Model string `json:"model,omitempty"`
Source string `json:"source"`
}
ModelMapRow is one effective model-tier mapping.
func ModelMapRows ¶ added in v0.10.228
func ModelMapRows(llm config.LLMConfig) []ModelMapRow
ModelMapRows builds stable rows for every supported model tier.
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 any `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`.
func NewReviewDryRun ¶ added in v0.10.234
func NewReviewDryRun(result pipeline.Result) (ReviewDryRun, error)
NewReviewDryRun maps a pipeline result to the shared dry-run presentation model.
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
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 ¶
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.