config

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHTTPTimeout は LLM API 用の HTTP クライアントタイムアウト
	// ストリーミング時はアイドルタイムアウト(streaming.idle_timeout_seconds)で管理するため、
	// HTTPクライアントレベルでは無制限(0)に設定
	DefaultHTTPTimeout = 0                // 無制限(context/アイドルタイムアウトで管理)
	SerperHTTPTimeout  = 10 * time.Second // Serper API専用(非ストリーミング)
)

HTTP Configuration

View Source
const (
	MaxToolIterations    = 50 // ツールループ最大回数(複雑なタスクに対応)
	MaxChangeStack       = 10 // Undo履歴最大保存数
	MaxAPIRetries        = 2  // API呼び出し最大リトライ回数
	MaxSameToolCallCount = 3  // 同じツール呼び出しの最大繰り返し回数(ループ検知)
)

Tool Execution Limits

View Source
const (
	OutputTruncateLen   = 5000 // bash出力切り詰め長
	MaxDiffDisplayLines = 15   // diff表示最大行数
	MaxDiffIterations   = 20   // diff比較最大イテレーション
)

Output Display Limits

View Source
const (
	PlanMaxRetries       = 3  // ステップ失敗時の最大リトライ回数
	PlanMaxIterations    = 50 // ステップ内ツール実行の最大イテレーション数
	PlanMaxAutoContinues = 3  // AI質問時の自動続行最大回数
)

Plan Execution Limits

View Source
const (
	MessageTruncateLen = 500 // サマリー生成時のメッセージ切り詰め長
	MaxLastOutputs     = 10  // 最後の出力履歴最大保存数
)

Message Processing Limits

View Source
const (
	HistoryPreviewLen     = 50  // /history コマンドのプレビュー切り詰め長
	SessionPreviewLen     = 60  // /sessions コマンドのプレビュー切り詰め長
	SessionListMaxDisplay = 10  // /sessions の最大表示数
	ErrorOutputMaxLines   = 20  // Plan失敗時のエラー出力最大行数
	DebugPreviewLen       = 500 // デバッグログのプレビュー長
)

UI Display Limits

View Source
const (
	RepoMapMaxFiles   = 20 // RepoMapの最大ファイル数
	RepoMapMaxSymbols = 10 // RepoMapのファイル毎最大シンボル数
)

RepoMap Display Limits

View Source
const (
	DefaultParallelWorkers = 3 // Plan実行のデフォルト並列ワーカー数
	LoopDetectionThreshold = 3 // ループ検知の閾値
)

Parallel Execution Defaults

View Source
const (
	TestOutputMaxLines = 20 // テスト出力の最大行数
)

Test/Verification Limits

Variables

View Source
var CategoryDefinitions = []CategoryDef{
	{Name: "provider", DisplayName: "Provider & Model", Icon: "🤖", Fields: []string{"default_model", "default_provider", "provider_models"}},
	{Name: "compression", DisplayName: "Compression", Icon: "📦", Fields: []string{"compression.auto_compress", "compression.keep_recent", "compression.prefer_compact_api", "compression.threshold_percent", "compression.threshold_tokens"}},
	{Name: "backup", DisplayName: "Backup", Icon: "💾", Fields: []string{"backup.max_generations"}},
	{Name: "loop_detection", DisplayName: "Loop Detection", Icon: "🔄", Fields: []string{"loop_detection.threshold"}},
	{Name: "api_retry", DisplayName: "API Settings", Icon: "🌐", Fields: []string{"api_retry.count", "api_retry.initial_delay", "api_retry.max_delay", "api_retry.timeout"}},
	{Name: "diff", DisplayName: "Diff Display", Icon: "📝", Fields: []string{"diff.context_lines"}},
	{Name: "tool_confirm", DisplayName: "Tool Confirm", Icon: "✅", Fields: []string{"tool_confirm.auto_approve_medium", "tool_confirm.auto_approve_safe"}},
	{Name: "command_aliases", DisplayName: "Command Aliases", Icon: "🔗", Fields: []string{"command_aliases"}},
	{Name: "prompt_cache", DisplayName: "Prompt Cache", Icon: "💨", Fields: []string{"prompt_cache.enabled", "prompt_cache.max_entries", "prompt_cache.ttl_seconds"}},
	{Name: "paste", DisplayName: "Paste Mode", Icon: "📋", Fields: []string{"paste.bracketed_paste", "paste.max_bytes", "paste.max_lines", "paste.timeout_seconds"}},
	{Name: "streaming", DisplayName: "Streaming", Icon: "📺", Fields: []string{"streaming.idle_timeout_seconds", "streaming.show_file_info", "streaming.show_search_progress", "streaming.stream_bash_output"}},
	{Name: "bash", DisplayName: "Bash Safety", Icon: "💻", Fields: []string{"bash.allow_inline_edit", "bash.allow_pipe", "bash.allow_redirect", "bash.safe_commands", "bash.safety_level"}},
	{Name: "code_health", DisplayName: "Code Health", Icon: "🏥", Fields: []string{"code_health.auto_suggest", "code_health.enabled", "code_health.max_file_lines", "code_health.max_function_lines", "code_health.on_change"}},
	{Name: "git_stage", DisplayName: "Git Settings", Icon: "📂", Fields: []string{"git_stage.batch_confirm"}},
	{Name: "plan_mode", DisplayName: "Plan Mode", Icon: "📋", Fields: []string{"plan_mode.auto_retry", "plan_mode.confirm_level", "plan_mode.heavy_model", "plan_mode.light_model", "plan_mode.max_parallel_steps", "plan_mode.max_retry", "plan_mode.max_workers", "plan_mode.parallel", "plan_mode.step_timeout", "plan_mode.supervisor_model"}},
	{Name: "lsp", DisplayName: "LSP Servers", Icon: "🔧", Fields: []string{"lsp.enabled", "lsp.skip_install_prompt"}},
	{Name: "openai", DisplayName: "OpenAI", Icon: "🌟", Fields: []string{"openai.responses_api_models"}},
	{Name: "thinking", DisplayName: "Thinking", Icon: "🧠", Fields: []string{"thinking.enabled", "thinking.level"}},
	{Name: "output", DisplayName: "Output", Icon: "📤", Fields: []string{"output.max_lines"}},
	{Name: "repomap", DisplayName: "RepoMap", Icon: "🗺️", Fields: []string{"repomap.max_tokens"}},
	{Name: "web_search", DisplayName: "Web Search", Icon: "🔍", Fields: []string{"web_search.cache_enabled", "web_search.cache_size", "web_search.cache_ttl"}},
}

CategoryDefinitions はカテゴリ定義リスト

View Source
var CategoryIcons = map[string]string{
	"api_retry":       "🌐",
	"backup":          "💾",
	"bash":            "💻",
	"code_health":     "🏥",
	"command_aliases": "🔗",
	"compression":     "📦",
	"diff":            "📝",
	"git_stage":       "📂",
	"loop_detection":  "🔄",
	"lsp":             "🔧",
	"openai":          "🌟",
	"output":          "📤",
	"paste":           "📋",
	"plan_mode":       "📋",
	"prompt_cache":    "💨",
	"provider":        "🤖",
	"repomap":         "🗺️",
	"streaming":       "📺",
	"thinking":        "🧠",
	"tool_confirm":    "✅",
	"web_search":      "🔍",
}

CategoryIcons はカテゴリのアイコン

View Source
var FieldDescriptions = map[string]string{
	"api_retry.count":                  "リトライ回数",
	"api_retry.initial_delay":          "初回リトライ待機時間(秒)",
	"api_retry.max_delay":              "最大待機時間(秒)",
	"api_retry.timeout":                "タイムアウト(秒)",
	"backup.max_generations":           "保持する世代数",
	"bash.allow_inline_edit":           "インライン編集を許可(sed -i 等)",
	"bash.allow_pipe":                  "パイプを許可",
	"bash.allow_redirect":              "リダイレクトを許可",
	"bash.safe_commands":               "追加の安全コマンド(例: - \"npm run\")",
	"bash.safety_level":                "安全レベル: strict / moderate / permissive",
	"code_health.auto_suggest":         "変更時に自動提案",
	"code_health.enabled":              "有効化",
	"code_health.max_file_lines":       "ファイルの最大行数警告",
	"code_health.max_function_lines":   "関数の最大行数警告",
	"code_health.on_change":            "変更時のチェック項目",
	"compression.auto_compress":        "トークン使用率が閾値を超えたら自動圧縮",
	"compression.keep_recent":          "圧縮時に保持する直近メッセージ数",
	"compression.prefer_compact_api":   "プロバイダーのCompact APIを優先使用",
	"compression.threshold_percent":    "トークン使用率の閾値(%)",
	"compression.threshold_tokens":     "トークン数の閾値(0 = 使用しない)",
	"default_model":                    "デフォルトで使用するモデル",
	"default_provider":                 "デフォルトで使用するLLMプロバイダー",
	"diff.context_lines":               "差分表示時のコンテキスト行数",
	"git_stage.batch_confirm":          "複数ファイルをまとめて確認",
	"loop_detection.threshold":         "同じツール呼び出しの繰り返し回数でループと判定",
	"lsp.enabled":                      "LSP連携の有効/無効",
	"lsp.skip_install_prompt":          "インストール提案をスキップ",
	"openai.responses_api_models":      "Responses APIを使用するモデル",
	"output.max_lines":                 "折りたたみ前の最大表示行数",
	"paste.bracketed_paste":            "Bracketed Paste Mode を有効化(複数行ペースト対応)",
	"paste.max_bytes":                  "最大バイト数",
	"paste.max_lines":                  "最大行数",
	"paste.timeout_seconds":            "タイムアウト(秒)",
	"plan_mode.auto_retry":             "【非推奨】max_retry を使用してください",
	"plan_mode.confirm_level":          "確認レベル: all / dangerous / none",
	"plan_mode.heavy_model":            "エスカレーション用モデル(空=無効)",
	"plan_mode.light_model":            "Worker用軽量モデル(空=メインモデル)",
	"plan_mode.max_parallel_steps":     "【非推奨】max_workers を使用してください",
	"plan_mode.max_retry":              "最大リトライ回数",
	"plan_mode.max_workers":            "並列ワーカー数",
	"plan_mode.parallel":               "並列モード有効化",
	"plan_mode.step_timeout":           "ステップタイムアウト(秒)",
	"plan_mode.supervisor_model":       "Supervisor用モデル(空=メインモデル)",
	"prompt_cache.enabled":             "有効化",
	"prompt_cache.max_entries":         "最大エントリ数",
	"prompt_cache.ttl_seconds":         "キャッシュTTL(秒)",
	"provider_models":                  "プロバイダーごとのモデル設定",
	"repomap.max_tokens":               "最大トークン数(0 = 自動計算)",
	"streaming.idle_timeout_seconds":   "アイドルタイムアウト(秒)",
	"streaming.show_file_info":         "ファイル読み込み時にサイズ・行数を表示",
	"streaming.show_search_progress":   "検索時に進捗を表示",
	"streaming.stream_bash_output":     "bashコマンドの出力をリアルタイム表示",
	"thinking.enabled":                 "有効化",
	"thinking.level":                   "レベル: low / medium / high / xhigh",
	"tool_confirm.auto_approve_medium": "中程度のツール(write_file等)を自動承認",
	"tool_confirm.auto_approve_safe":   "安全なツール(read_file等)を自動承認",
	"web_search.cache_enabled":         "キャッシュを有効化(デフォルト: true)",
	"web_search.cache_size":            "最大キャッシュ数(デフォルト: 100)",
	"web_search.cache_ttl":             "キャッシュTTL秒数(デフォルト: 1800 = 30分)",
}

FieldDescriptions はフィールドの説明

View Source
var FieldTypeMap = map[string]ConfigFieldType{
	"api_retry.count":                  FieldTypeInt,
	"api_retry.initial_delay":          FieldTypeInt,
	"api_retry.max_delay":              FieldTypeInt,
	"api_retry.timeout":                FieldTypeInt,
	"backup.max_generations":           FieldTypeInt,
	"bash.allow_inline_edit":           FieldTypeBool,
	"bash.allow_pipe":                  FieldTypeBool,
	"bash.allow_redirect":              FieldTypeBool,
	"bash.safe_commands":               FieldTypeStringSlice,
	"bash.safety_level":                FieldTypeSelect,
	"code_health.auto_suggest":         FieldTypeBool,
	"code_health.enabled":              FieldTypeBool,
	"code_health.max_file_lines":       FieldTypeInt,
	"code_health.max_function_lines":   FieldTypeInt,
	"code_health.on_change":            FieldTypeStringSlice,
	"command_aliases":                  FieldTypeStringMap,
	"compression.auto_compress":        FieldTypeBool,
	"compression.keep_recent":          FieldTypeInt,
	"compression.prefer_compact_api":   FieldTypeBool,
	"compression.threshold_percent":    FieldTypeInt,
	"compression.threshold_tokens":     FieldTypeInt,
	"default_model":                    FieldTypeString,
	"default_provider":                 FieldTypeSelect,
	"diff.context_lines":               FieldTypeInt,
	"git_stage.batch_confirm":          FieldTypeBool,
	"loop_detection.threshold":         FieldTypeInt,
	"lsp.enabled":                      FieldTypeBool,
	"lsp.servers":                      FieldTypeStructMap,
	"lsp.skip_install_prompt":          FieldTypeBool,
	"openai.responses_api_models":      FieldTypeStringSlice,
	"output.max_lines":                 FieldTypeInt,
	"paste.bracketed_paste":            FieldTypeBool,
	"paste.max_bytes":                  FieldTypeInt,
	"paste.max_lines":                  FieldTypeInt,
	"paste.timeout_seconds":            FieldTypeInt,
	"plan_mode.auto_retry":             FieldTypeInt,
	"plan_mode.confirm_level":          FieldTypeSelect,
	"plan_mode.heavy_model":            FieldTypeString,
	"plan_mode.light_model":            FieldTypeString,
	"plan_mode.max_parallel_steps":     FieldTypeInt,
	"plan_mode.max_retry":              FieldTypeInt,
	"plan_mode.max_workers":            FieldTypeInt,
	"plan_mode.parallel":               FieldTypeBool,
	"plan_mode.step_timeout":           FieldTypeInt,
	"plan_mode.supervisor_model":       FieldTypeString,
	"prompt_cache.enabled":             FieldTypeBool,
	"prompt_cache.max_entries":         FieldTypeInt,
	"prompt_cache.ttl_seconds":         FieldTypeInt,
	"provider_models":                  FieldTypeStructMap,
	"repomap.max_tokens":               FieldTypeInt,
	"streaming.idle_timeout_seconds":   FieldTypeInt,
	"streaming.show_file_info":         FieldTypeBool,
	"streaming.show_search_progress":   FieldTypeBool,
	"streaming.stream_bash_output":     FieldTypeBool,
	"thinking.enabled":                 FieldTypeBool,
	"thinking.level":                   FieldTypeSelect,
	"tool_confirm.auto_approve_medium": FieldTypeBool,
	"tool_confirm.auto_approve_safe":   FieldTypeBool,
	"web_search.cache_enabled":         FieldTypeBool,
	"web_search.cache_size":            FieldTypeInt,
	"web_search.cache_ttl":             FieldTypeInt,
}

FieldTypeMap はフィールドパスから型へのマップ

View Source
var SelectOptions = map[string][]string{
	"bash.safety_level":       {"strict", "moderate", "permissive"},
	"default_provider":        {"deepseek", "claude", "openai", "gemini", "groq", "ollama"},
	"plan_mode.confirm_level": {"all", "dangerous", "none"},
	"thinking.level":          {"low", "medium", "high", "xhigh"},
}

SelectOptions は選択型フィールドの選択肢

View Source
var ValidProviders = []string{
	"deepseek",
	"openai",
	"gemini",
	"claude",
	"anthropic",
	"ollama",
	"groq",
}

ValidProviders は有効なプロバイダー名の一覧 internal/api/provider.go の NewProvider() と同期させること

Functions

func ApplyAutoFixes added in v0.31.0

func ApplyAutoFixes(cfg *Config, result ValidationResult) int

ApplyAutoFixes は自動修正可能な問題を修正

func GetFieldValue added in v0.45.0

func GetFieldValue(cfg *Config, path string) (interface{}, error)

GetFieldValue はパスを指定して設定値を取得する

func GetStringMapValue added in v0.45.0

func GetStringMapValue(cfg *Config, path string) (map[string]string, error)

GetStringMapValue はmap[string]string型のフィールド値を取得する

func GetStringSliceValue added in v0.45.0

func GetStringSliceValue(cfg *Config, path string) ([]string, error)

GetStringSliceValue は[]string型のフィールド値を取得する

func LoadConfigWithValidation added in v0.31.0

func LoadConfigWithValidation() (*Config, ValidationResult, error)

LoadConfigWithValidation は設定ファイルを読み込み、バリデーションを実行 バリデーションエラーがあっても設定は返す(警告のみ)

func MigratePlanModeConfig added in v0.46.0

func MigratePlanModeConfig(cfg *PlanModeConfig)

MigratePlanModeConfig は旧設定を新設定にマイグレーション(Phase 3) - max_parallel_steps → max_workers - auto_retry → max_retry また、デフォルト値も設定する

func PrintValidationWarnings added in v0.31.0

func PrintValidationWarnings(result ValidationResult)

PrintValidationWarnings はバリデーション警告を表示

func SaveConfig

func SaveConfig(cfg *Config) error

SaveConfig は設定ファイルを保存

func SetFieldValue added in v0.45.0

func SetFieldValue(cfg *Config, path string, value interface{}) error

SetFieldValue はパスを指定して設定値を設定する

func SetGlobalConfig added in v0.29.0

func SetGlobalConfig(cfg *Config)

SetGlobalConfig はグローバル設定を保存

func SetStringMapValue added in v0.45.0

func SetStringMapValue(cfg *Config, path string, value map[string]string) error

SetStringMapValue はmap[string]string型のフィールド値を設定する

func SetStringSliceValue added in v0.45.0

func SetStringSliceValue(cfg *Config, path string, value []string) error

SetStringSliceValue は[]string型のフィールド値を設定する

func ShowConfig added in v0.31.0

func ShowConfig(current *Config) string

ShowConfig は現在の設定とデフォルトの差分を含む表示文字列を生成

func ValidateModel

func ValidateModel(model string) bool

ValidateModel は任意のモデル名を受け付ける(後方互換のため残す) 注: v0.16.0以降、モデル名の検証は行わない

Types

type APIRetryConfig added in v0.29.0

type APIRetryConfig struct {
	Count        int `yaml:"count"`         // リトライ回数(デフォルト3)
	InitialDelay int `yaml:"initial_delay"` // 初回待機秒数(デフォルト1)
	MaxDelay     int `yaml:"max_delay"`     // 最大待機秒数(デフォルト30)
	Timeout      int `yaml:"timeout"`       // APIタイムアウト秒数(デフォルト300=5分)
}

APIRetryConfig はAPIリトライの設定

type BackupConfig added in v0.29.0

type BackupConfig struct {
	MaxGenerations int `yaml:"max_generations"` // 保持する世代数(デフォルト5)
}

BackupConfig はバックアップファイルの設定

type BashConfig added in v0.31.0

type BashConfig struct {
	SafetyLevel     string   `yaml:"safety_level"`      // strict, moderate, permissive(デフォルト: moderate)
	SafeCommands    []string `yaml:"safe_commands"`     // 追加の安全コマンド
	AllowPipe       bool     `yaml:"allow_pipe"`        // パイプを許可(デフォルト: true - moderateで有効)
	AllowRedirect   bool     `yaml:"allow_redirect"`    // リダイレクトを許可(デフォルト: false)
	AllowInlineEdit bool     `yaml:"allow_inline_edit"` // sed -i等を許可(デフォルト: false)
}

BashConfig はbashツールの設定

type CategoryDef added in v0.45.0

type CategoryDef struct {
	Name        string   // カテゴリ名
	DisplayName string   // 表示名
	Icon        string   // アイコン
	Fields      []string // フィールドパス
}

CategoryDef はカテゴリ定義

type CodeHealthConfig added in v0.31.0

type CodeHealthConfig struct {
	Enabled          bool     `yaml:"enabled"`            // コード健全性チェックを有効化(デフォルト: true)
	MaxFileLines     int      `yaml:"max_file_lines"`     // ファイル行数上限(デフォルト: 300)
	MaxFunctionLines int      `yaml:"max_function_lines"` // 関数行数上限(デフォルト: 50)
	AutoSuggest      bool     `yaml:"auto_suggest"`       // 閾値超過時に自動で提案(デフォルト: true)
	OnChange         []string `yaml:"on_change"`          // 変更時チェック項目(check_file_size, check_function_size, check_duplication)
}

CodeHealthConfig はコード健全性チェックの設定

type CompressionConfig added in v0.29.0

type CompressionConfig struct {
	AutoCompress     bool `yaml:"auto_compress"`      // 自動圧縮を有効化(デフォルト: true)
	ThresholdTokens  int  `yaml:"threshold_tokens"`   // 自動圧縮のトークン閾値(0 = 使用率ベース)
	ThresholdPercent int  `yaml:"threshold_percent"`  // 自動圧縮の使用率閾値(デフォルト: 80%)
	KeepRecent       int  `yaml:"keep_recent"`        // 保持する最新メッセージ数
	PreferCompactAPI bool `yaml:"prefer_compact_api"` // OpenAI Compact API を優先(デフォルト: true)
}

CompressionConfig は会話履歴圧縮の設定

type Config

type Config struct {
	DefaultProvider string                         `yaml:"default_provider"`
	DefaultModel    string                         `yaml:"default_model"`
	ProviderModels  map[string]ProviderModelConfig `yaml:"provider_models"`
	General         GeneralConfig                  `yaml:"general,omitempty"`
	Compression     CompressionConfig              `yaml:"compression,omitempty"`
	Backup          BackupConfig                   `yaml:"backup,omitempty"`
	LoopDetection   LoopDetectionConfig            `yaml:"loop_detection,omitempty"`
	APIRetry        APIRetryConfig                 `yaml:"api_retry,omitempty"`
	Diff            DiffConfig                     `yaml:"diff,omitempty"`
	ToolConfirm     ToolConfirmConfig              `yaml:"tool_confirm,omitempty"`
	CommandAliases  map[string]string              `yaml:"command_aliases,omitempty"` // コマンドエイリアス
	PromptCache     PromptCacheConfig              `yaml:"prompt_cache,omitempty"`
	Paste           PasteConfig                    `yaml:"paste,omitempty"`
	Streaming       StreamingConfig                `yaml:"streaming,omitempty"`
	Bash            BashConfig                     `yaml:"bash,omitempty"`
	CodeHealth      CodeHealthConfig               `yaml:"code_health,omitempty"`
	GitStage        GitStageConfig                 `yaml:"git_stage,omitempty"`
	PlanMode        PlanModeConfig                 `yaml:"plan_mode,omitempty"`
	LSP             LSPConfig                      `yaml:"lsp,omitempty"`
	OpenAI          OpenAIConfig                   `yaml:"openai,omitempty"`
	Thinking        ThinkingConfig                 `yaml:"thinking,omitempty"`
	RepoMap         RepoMapConfig                  `yaml:"repomap,omitempty"`
	Output          OutputConfig                   `yaml:"output,omitempty"`
	WebSearch       WebSearchConfig                `yaml:"web_search,omitempty"`
}

Config はXELYON CLIの設定

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig はデフォルト設定

func GetGlobalConfig added in v0.29.0

func GetGlobalConfig() *Config

GetGlobalConfig はグローバル設定を取得

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig は設定ファイルを読み込む

func (*Config) ApplyEnvironmentOverrides added in v0.29.0

func (c *Config) ApplyEnvironmentOverrides()

ApplyEnvironmentOverrides は環境変数で設定を上書き

func (*Config) ApplyFlagOverrides added in v0.29.0

func (c *Config) ApplyFlagOverrides(loopThreshold, apiRetry, apiRetryDelay, diffLines *int)

ApplyFlagOverrides はCLIフラグで設定を上書き

func (*Config) GetModelForProvider

func (c *Config) GetModelForProvider(provider string) string

GetModelForProvider はプロバイダーに対応するデフォルトモデルを取得

func (*Config) IsResponsesAPIModel added in v0.31.0

func (c *Config) IsResponsesAPIModel(model string) bool

IsResponsesAPIModel はモデルが OpenAI Responses API を使用するか判定

func (*Config) ValidateModelForProvider

func (c *Config) ValidateModelForProvider(provider, model string) bool

ValidateModelForProvider は任意のモデル名を受け付ける(後方互換のため残す) 注: v0.16.0以降、モデル名の検証は行わない

type ConfigCategory added in v0.45.0

type ConfigCategory struct {
	Name        string        // カテゴリ名
	DisplayName string        // 表示名
	Icon        string        // アイコン
	Fields      []ConfigField // フィールドリスト
}

ConfigCategory は設定カテゴリの情報

func BuildConfigRegistry added in v0.45.0

func BuildConfigRegistry(cfg *Config) []ConfigCategory

BuildConfigRegistry はConfig構造体からカテゴリリストを構築する

type ConfigDiff added in v0.31.0

type ConfigDiff struct {
	Key      string
	Current  string
	Default  string
	IsDiff   bool
	IsNested bool
}

ConfigDiff は設定の差分情報

type ConfigField added in v0.45.0

type ConfigField struct {
	Path        string          // "thinking.enabled"
	DisplayName string          // 表示名
	Description string          // 説明
	FieldType   ConfigFieldType // 型
	Options     []string        // FieldTypeSelect用の選択肢
	Category    string          // カテゴリ名
	Current     interface{}     // 現在の値
	Default     interface{}     // デフォルト値
}

ConfigField は設定フィールドの情報

type ConfigFieldType added in v0.45.0

type ConfigFieldType int

ConfigFieldType はフィールドの型

const (
	FieldTypeBool ConfigFieldType = iota
	FieldTypeInt
	FieldTypeString
	FieldTypeSelect      // 選択肢付き文字列
	FieldTypeStringSlice // []string
	FieldTypeStringMap   // map[string]string
	FieldTypeStructMap   // map[string]struct
)

func (ConfigFieldType) String added in v0.45.0

func (t ConfigFieldType) String() string

FieldTypeString は ConfigFieldType を文字列に変換する

type DiffConfig added in v0.29.0

type DiffConfig struct {
	ContextLines int `yaml:"context_lines"` // 差分表示行数(デフォルト10、0で省略なし)
}

DiffConfig は差分表示の設定

type GeneralConfig added in v0.46.0

type GeneralConfig struct {
	Language string `yaml:"language"` // 表示言語(ja, en)デフォルト: ja
}

GeneralConfig は一般設定

type GitStageConfig added in v0.31.0

type GitStageConfig struct {
	BatchConfirm bool `yaml:"batch_confirm"` // 複数ファイルのバッチ確認UI(デフォルト: true)
}

GitStageConfig はgit_addツールの設定

type LSPConfig added in v0.31.0

type LSPConfig struct {
	Enabled           bool                       `yaml:"enabled"`                       // LSP機能を有効化(デフォルト: true)
	SkipInstallPrompt bool                       `yaml:"skip_install_prompt,omitempty"` // インストール提案をスキップ
	Servers           map[string]LSPServerConfig `yaml:"servers,omitempty"`
}

LSPConfig は LSP (Language Server Protocol) 連携の設定

type LSPServerConfig added in v0.31.0

type LSPServerConfig struct {
	Command  string   `yaml:"command"`            // サーバーコマンド(例: gopls, vtsls)
	Args     []string `yaml:"args,omitempty"`     // コマンド引数
	Disabled bool     `yaml:"disabled,omitempty"` // このサーバーを無効化
}

LSPServerConfig は個別のLSPサーバー設定

type LoopDetectionConfig added in v0.29.0

type LoopDetectionConfig struct {
	Threshold int `yaml:"threshold"` // ループ検知回数(デフォルト3)
}

LoopDetectionConfig はループ検知の設定

type OpenAIConfig added in v0.31.0

type OpenAIConfig struct {
	ResponsesAPIModels []string `yaml:"responses_api_models"` // Responses API を使用するモデル
}

OpenAIConfig は OpenAI プロバイダーの設定

type OutputConfig added in v0.45.0

type OutputConfig struct {
	MaxLines int `yaml:"max_lines"` // 折りたたみ前の最大表示行数(デフォルト: 5)
}

OutputConfig はツール出力表示の設定

type PasteConfig added in v0.31.0

type PasteConfig struct {
	BracketedPaste bool `yaml:"bracketed_paste"` // Bracketed Paste Mode を有効化(デフォルト: true)
	MaxLines       int  `yaml:"max_lines"`       // 最大行数(デフォルト10000)
	MaxBytes       int  `yaml:"max_bytes"`       // 最大バイト数(デフォルト1MB)
	TimeoutSeconds int  `yaml:"timeout_seconds"` // タイムアウト秒(デフォルト60)
}

PasteConfig はペーストモードの設定

type PlanModeConfig added in v0.31.0

type PlanModeConfig struct {
	// 旧設定(後方互換性のため残す)
	MaxParallelSteps int `yaml:"max_parallel_steps,omitempty"` // 非推奨: max_workers を使用
	AutoRetry        int `yaml:"auto_retry,omitempty"`         // 非推奨: max_retry を使用

	// 並列実行設定(Phase 3)
	Parallel   bool `yaml:"parallel"`    // 並列モード有効化(デフォルト: false)
	MaxWorkers int  `yaml:"max_workers"` // 並列ワーカー数(デフォルト: 3)

	// モデル設定(Phase 3)
	SupervisorModel string `yaml:"supervisor_model"` // Supervisor用モデル(空=メインモデル)
	LightModel      string `yaml:"light_model"`      // Worker用軽量モデル(空=メインモデル)
	HeavyModel      string `yaml:"heavy_model"`      // エスカレーション用モデル(空=無効)

	// リトライ・タイムアウト(Phase 3)
	MaxRetry    int `yaml:"max_retry"`    // 自動リトライ回数(デフォルト: 10)
	StepTimeout int `yaml:"step_timeout"` // ステップタイムアウト秒(デフォルト: 600)

	// 確認レベル(Phase 3)
	ConfirmLevel string `yaml:"confirm_level"` // all / dangerous / none(デフォルト: dangerous)
}

PlanModeConfig は Plan Mode の設定

type PromptCacheConfig added in v0.31.0

type PromptCacheConfig struct {
	Enabled    bool `yaml:"enabled"`
	MaxEntries int  `yaml:"max_entries"` // 0以下の場合はデフォルト適用
	TTLSeconds int  `yaml:"ttl_seconds"` // 0の場合はデフォルト適用(デフォルトTTL)
}

PromptCacheConfig はプロンプトキャッシュの設定

目的: system prompt / repo map 等の生成コストを削減するためのキャッシュ。 現時点では in-memory キャッシュを想定(永続化なし)。

type ProviderModelConfig

type ProviderModelConfig struct {
	DefaultModel string `yaml:"default_model"`
}

ProviderModelConfig はプロバイダーごとのモデル設定

type RepoMapConfig added in v0.42.0

type RepoMapConfig struct {
	MaxTokens int `yaml:"max_tokens,omitempty"` // 0 = 自動計算(ファイル数ベース)
}

RepoMapConfig は RepoMap の設定

type StreamingConfig added in v0.31.0

type StreamingConfig struct {
	IdleTimeoutSeconds int  `yaml:"idle_timeout_seconds"` // アイドルタイムアウト秒(デフォルト30)
	ShowFileInfo       bool `yaml:"show_file_info"`       // ファイル読み込み時にサイズ表示(デフォルト: true)
	ShowSearchProgress bool `yaml:"show_search_progress"` // 検索中に進捗表示(デフォルト: true)
	StreamBashOutput   bool `yaml:"stream_bash_output"`   // bashコマンド出力をストリーミング(デフォルト: true)
}

StreamingConfig はストリーミングレスポンスの設定

type ThinkingConfig added in v0.31.0

type ThinkingConfig struct {
	Enabled bool   `yaml:"enabled"` // デフォルト: false
	Level   string `yaml:"level"`   // low/medium/high/xhigh(デフォルト: medium)
}

ThinkingConfig は Extended Thinking の設定

type ToolConfirmConfig added in v0.31.0

type ToolConfirmConfig struct {
	AutoApproveSafe   bool `yaml:"auto_approve_safe"`   // SafetyHigh(read_file等)を確認なしで実行(デフォルトtrue)
	AutoApproveMedium bool `yaml:"auto_approve_medium"` // SafetyMedium(str_replace等)を確認なしで実行(デフォルトfalse)
}

ToolConfirmConfig はツール実行確認の設定

type ValidationIssue added in v0.31.0

type ValidationIssue struct {
	Field      string // 問題のあるフィールド名
	Value      string // 現在の値
	Message    string // 問題の説明
	Suggestion string // 修正提案
	Severity   string // "error" or "warning"
	CanAutoFix bool   // 自動修正可能か
	FixedValue any    // 自動修正後の値
}

ValidationIssue はバリデーション問題を表す

type ValidationResult added in v0.31.0

type ValidationResult struct {
	Valid  bool
	Issues []ValidationIssue
}

ValidationResult はバリデーション結果を表す

func ValidateConfig added in v0.31.0

func ValidateConfig(cfg *Config) ValidationResult

ValidateConfig は設定ファイルのバリデーションを行う

func (ValidationResult) HasErrors added in v0.31.0

func (r ValidationResult) HasErrors() bool

HasErrors は致命的なエラーがあるかチェック

func (ValidationResult) HasWarnings added in v0.31.0

func (r ValidationResult) HasWarnings() bool

HasWarnings は警告があるかチェック

type WebSearchConfig added in v0.46.0

type WebSearchConfig struct {
	CacheEnabled bool `yaml:"cache_enabled"` // キャッシュを有効化(デフォルト: true)
	CacheTTL     int  `yaml:"cache_ttl"`     // キャッシュTTL秒数(デフォルト: 1800 = 30分)
	CacheSize    int  `yaml:"cache_size"`    // 最大キャッシュ数(デフォルト: 100)
}

WebSearchConfig はWeb検索キャッシュの設定

Jump to

Keyboard shortcuts

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