ui

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: 18 Imported by: 0

Documentation

Overview

Package ui は質問表示 UI を提供する

Index

Constants

View Source
const DefaultMaxVisibleLines = 5

DefaultMaxVisibleLines はデフォルトの最大表示行数

Variables

View Source
var (
	// 基本色
	Cyan    = color.New(color.FgCyan)    // 情報・ヘッダー
	Yellow  = color.New(color.FgYellow)  // 警告・プロンプト
	Green   = color.New(color.FgGreen)   // 成功・追加
	Red     = color.New(color.FgRed)     // エラー・削除
	White   = color.New(color.FgWhite)   // 通常テキスト
	Blue    = color.New(color.FgBlue)    // リンク・参照
	Magenta = color.New(color.FgMagenta) // 特殊・ハイライト

	// Bold variants
	BoldCyan   = color.New(color.FgCyan, color.Bold)
	BoldYellow = color.New(color.FgYellow, color.Bold)
	BoldGreen  = color.New(color.FgGreen, color.Bold)
	BoldRed    = color.New(color.FgRed, color.Bold)
	BoldWhite  = color.New(color.FgWhite, color.Bold)

	// 特殊用途
	Dim   = color.New(color.Faint) // 薄い表示(コンテキスト行など)
	Bold  = color.New(color.Bold)  // 太字
	Faint = color.New(color.Faint) // 薄い表示
)

共通色定義 全パッケージで一貫した色使いを実現するための定義

View Source
var (
	Info    = Cyan     // 情報メッセージ
	Success = Green    // 成功メッセージ
	Warning = Yellow   // 警告メッセージ
	Error   = Red      // エラーメッセージ
	Prompt  = Yellow   // ユーザー入力プロンプト
	Header  = BoldCyan // セクションヘッダー
)

用途別エイリアス(セマンティックカラー)

View Source
var DefaultBoxStyle = BoxStyle{
	TopLeft:     "┌",
	TopRight:    "┐",
	BottomLeft:  "└",
	BottomRight: "┘",
	Horizontal:  "─",
	Vertical:    "│",
	LeftT:       "├",
	RightT:      "┤",
}

DefaultBoxStyle は標準のボックススタイル

View Source
var DefaultDiffOptions = DiffOptions{
	ContextLines:  3,
	ShowLineNums:  true,
	InlineMode:    true,
	MaxTotalLines: 50,
}

DefaultDiffOptions はデフォルトの差分表示オプション

View Source
var ErrInterrupted = errors.New("interrupted")

ErrInterrupted is returned when user presses Ctrl+C

Functions

func CollapseOutput added in v0.45.0

func CollapseOutput(output string, maxLines int) string

CollapseOutput は長い出力を折りたたみ表示する maxLines が 0 の場合は設定から取得

func CollapseOutputWithPrefix added in v0.45.0

func CollapseOutputWithPrefix(output string, prefix string, maxLines int) string

CollapseOutputWithPrefix は出力を折りたたみ、各行にプレフィックスを付ける Claude Code 風の表示用

func ConfirmPromptBox added in v0.31.0

func ConfirmPromptBox(message string)

ConfirmPromptBox は確認プロンプト用のボックスを表示

func ConfirmSelector added in v0.45.0

func ConfirmSelector(message string) (string, error)

ConfirmSelector は確認用の3択セレクター(Yes/No/Comment)

func CountRunes added in v0.45.0

func CountRunes(s string) int

CountRunes は文字列のルーン数を返す(バイト数ではなく文字数)

func Debug added in v0.43.0

func Debug(format string, args ...interface{})

Debug logs a debug message (only when XELYON_DEBUG=1)

func ErrorLog added in v0.43.0

func ErrorLog(format string, args ...interface{})

ErrorLog logs an error message

func ErrorLogWithoutEmoji added in v0.43.0

func ErrorLogWithoutEmoji(format string, args ...interface{})

ErrorLogWithoutEmoji logs an error message without prefix

func Fatal added in v0.43.0

func Fatal(format string, args ...interface{})

Fatal logs an error message and exits with code 1

func Fatalf added in v0.43.0

func Fatalf(format string, args ...interface{})

Fatalf logs an error message to stderr and exits with code 1

func FormatPlanFooter added in v0.45.0

func FormatPlanFooter() string

FormatPlanFooter は計画フッターを表示用に整形

func FormatPlanHeader added in v0.45.0

func FormatPlanHeader(title string) string

FormatPlanHeader は計画ヘッダーを表示用に整形

func FormatStepProgress added in v0.45.0

func FormatStepProgress(stepID int, total int, description string, status string) string

FormatStepProgress はステップ進捗を表示用に整形

func FormatToolOutput added in v0.45.0

func FormatToolOutput(output string, maxLines int) string

FormatToolOutput はツール出力をフォーマット(折りたたみ付き) Claude Code 風の表示:

⎿  line1
   line2
   ... +N lines

func GetMaxVisibleLines added in v0.45.0

func GetMaxVisibleLines() int

GetMaxVisibleLines は設定から最大表示行数を取得

func InferAction added in v0.45.0

func InferAction(tool string) string

InferAction はツール名からアクションを推測

func InfoLog added in v0.43.0

func InfoLog(format string, args ...interface{})

InfoLog logs an info message

func IsMultilineMarker added in v0.29.0

func IsMultilineMarker(input string) bool

IsMultilineMarker checks if the input is a multiline marker

func KeyValueTable added in v0.45.0

func KeyValueTable(pairs ...string) string

KeyValueTable はキー・バリュー形式のシンプルなテーブルを作成

func PadCenter added in v0.45.0

func PadCenter(s string, width int) string

PadCenter は文字列を中央揃え(表示幅ベース)

func PadLeft added in v0.45.0

func PadLeft(s string, width int) string

PadLeft は文字列を左パディング(表示幅ベース)

func PadRight added in v0.45.0

func PadRight(s string, width int) string

PadRight は文字列を右パディング(表示幅ベース)

func SetGlobalReader added in v0.45.0

func SetGlobalReader(r *MultilineReader)

SetGlobalReader sets the global MultilineReader for shared access

func SetGlobalSpinner added in v0.45.0

func SetGlobalSpinner(s *Spinner)

SetGlobalSpinner はグローバルスピナーを設定

func SetLogLevel added in v0.43.0

func SetLogLevel(level LogLevel)

SetLogLevel sets the current logging level

func ShowColoredDiff added in v0.31.0

func ShowColoredDiff(oldStr, newStr string, opts *DiffOptions)

ShowColoredDiff は色付きの差分を表示 oldStr: 変更前のテキスト newStr: 変更後のテキスト opts: 表示オプション(nilならデフォルト使用)

func ShowUnifiedDiff added in v0.31.0

func ShowUnifiedDiff(diffOutput string)

ShowUnifiedDiff はUnified Diff形式で色付き表示

func SimpleDivider added in v0.31.0

func SimpleDivider(width int)

SimpleDivider はシンプルな区切り線を表示

func SimpleTable added in v0.45.0

func SimpleTable(headers []string, rows [][]string) string

SimpleTable はヘッダー付きのシンプルなテーブルを作成

func StopGlobalSpinner added in v0.45.0

func StopGlobalSpinner()

StopGlobalSpinner はグローバルスピナーを停止

func StringWidth added in v0.45.0

func StringWidth(s string) int

StringWidth は文字列の表示幅を計算(外部公開版)

func SuccessLog added in v0.43.0

func SuccessLog(format string, args ...interface{})

SuccessLog logs a success message

func SuccessLogWithEmoji added in v0.43.0

func SuccessLogWithEmoji(emoji, format string, args ...interface{})

SuccessLogWithEmoji logs a success message with custom emoji

func ToolConfirmBox added in v0.31.0

func ToolConfirmBox(toolName string, details []string)

ToolConfirmBox はツール確認用のボックスを表示

func TrimBracketedPasteMarkers added in v0.29.0

func TrimBracketedPasteMarkers(input string) string

TrimBracketedPasteMarkers removes bracketed paste markers from input (both forms)

func TruncateWidth added in v0.45.0

func TruncateWidth(s string, maxWidth int) string

TruncateWidth は文字列を指定幅で切り詰め(表示幅ベース)

func Warn added in v0.43.0

func Warn(format string, args ...interface{})

Warn logs a warning message

func WarnWithoutEmoji added in v0.43.0

func WarnWithoutEmoji(format string, args ...interface{})

WarnWithoutEmoji logs a warning message without prefix

Types

type BoxStyle added in v0.31.0

type BoxStyle struct {
	TopLeft     string
	TopRight    string
	BottomLeft  string
	BottomRight string
	Horizontal  string
	Vertical    string
	LeftT       string
	RightT      string
}

BoxStyle はボックスの罫線スタイル

type ColorFunc added in v0.45.0

type ColorFunc func(format string, a ...interface{})

ColorFunc は色付け関数の型

type ConfigMenu added in v0.45.0

type ConfigMenu struct {
	Config     *config.Config
	Categories []config.ConfigCategory
}

ConfigMenu は対話式設定メニュー

func NewConfigMenu added in v0.45.0

func NewConfigMenu(cfg *config.Config, categories []config.ConfigCategory) *ConfigMenu

NewConfigMenu は新しいConfigMenuを作成

func (*ConfigMenu) EditField added in v0.45.0

func (m *ConfigMenu) EditField(field *config.ConfigField) (interface{}, bool, error)

EditField はフィールドを編集する

func (*ConfigMenu) Run added in v0.45.0

func (m *ConfigMenu) Run() (*config.ConfigCategory, error)

Run はメインメニューを表示し、選択されたカテゴリを返す

func (*ConfigMenu) ShowFieldList added in v0.45.0

func (m *ConfigMenu) ShowFieldList(cat *config.ConfigCategory) (*config.ConfigField, error)

ShowFieldList はカテゴリ内のフィールドリストを表示

type DiffOptions added in v0.31.0

type DiffOptions struct {
	ContextLines  int  // 差分前後の表示行数
	ShowLineNums  bool // 行番号を表示するか
	InlineMode    bool // インラインモード(追加・削除を連続表示)
	MaxTotalLines int  // 最大表示行数(0=無制限)
}

DiffOptions は差分表示のオプション

type FileChangeSummary added in v0.45.0

type FileChangeSummary struct {
	FilePath     string
	Action       string // "created", "modified", "deleted"
	LinesAdded   int
	LinesRemoved int
}

FileChangeSummary はファイル変更の概要

type LogLevel added in v0.43.0

type LogLevel int

LogLevel represents the severity of a log message

const (
	LogDebug LogLevel = iota
	LogInfo
	LogWarn
	LogError
)

func GetLogLevel added in v0.43.0

func GetLogLevel() LogLevel

GetLogLevel returns the current logging level

type MultiProgress added in v0.43.0

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

MultiProgress は複数タスクの進捗を管理・表示

func NewMultiProgress added in v0.43.0

func NewMultiProgress() *MultiProgress

NewMultiProgress は新しいMultiProgressを作成

func NewMultiProgressWithWriter added in v0.43.0

func NewMultiProgressWithWriter(w io.Writer) *MultiProgress

NewMultiProgressWithWriter は出力先を指定してMultiProgressを作成

func (*MultiProgress) AddTask added in v0.43.0

func (mp *MultiProgress) AddTask(id int, message string)

AddTask はタスクを追加

func (*MultiProgress) Clear added in v0.43.0

func (mp *MultiProgress) Clear()

Clear は全タスクをクリア

func (*MultiProgress) Done added in v0.43.0

func (mp *MultiProgress) Done(id int)

Done はタスクを完了にマーク

func (*MultiProgress) Fail added in v0.43.0

func (mp *MultiProgress) Fail(id int, err string)

Fail はタスクをエラーにマーク

func (*MultiProgress) GetTask added in v0.43.0

func (mp *MultiProgress) GetTask(id int) *Task

GetTask はIDでタスクを取得

func (*MultiProgress) IsAllDone added in v0.43.0

func (mp *MultiProgress) IsAllDone() bool

IsAllDone は全タスクが完了したかチェック

func (*MultiProgress) Render added in v0.43.0

func (mp *MultiProgress) Render()

Render は全タスクの状態を表示

func (*MultiProgress) Start added in v0.43.0

func (mp *MultiProgress) Start(id int)

Start はタスクを実行中にマーク

func (*MultiProgress) StartRendering added in v0.43.0

func (mp *MultiProgress) StartRendering()

StartRendering はバックグラウンドで定期的に再描画を開始

func (*MultiProgress) StopRendering added in v0.43.0

func (mp *MultiProgress) StopRendering()

StopRendering は再描画を停止し、最終状態を表示

type MultilineReader added in v0.29.0

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

MultilineReader handles multiline input with bracketed paste mode and ``` markers

func GetGlobalReader added in v0.45.0

func GetGlobalReader() *MultilineReader

GetGlobalReader returns the global MultilineReader

func NewMultilineReader added in v0.29.0

func NewMultilineReader(r io.Reader) *MultilineReader

NewMultilineReader creates a new multiline reader

func (*MultilineReader) DisableBracketedPaste added in v0.29.0

func (m *MultilineReader) DisableBracketedPaste()

DisableBracketedPaste disables bracketed paste mode This sends the escape sequence to the terminal to disable the mode

func (*MultilineReader) EnableBracketedPaste added in v0.29.0

func (m *MultilineReader) EnableBracketedPaste()

EnableBracketedPaste enables bracketed paste mode This sends the escape sequence to the terminal to enable the mode Windows Terminal skips multiline paste warning when this mode is active

func (*MultilineReader) FlushInput added in v0.31.0

func (m *MultilineReader) FlushInput()

FlushInput discards any buffered input data This should be called after AI output completes to ignore keypresses during output

func (*MultilineReader) GetBufioReader added in v0.45.0

func (m *MultilineReader) GetBufioReader() *bufio.Reader

GetBufioReader returns the internal bufio.Reader for direct access

func (*MultilineReader) IsBracketedPasteEnabled added in v0.45.0

func (m *MultilineReader) IsBracketedPasteEnabled() bool

IsBracketedPasteEnabled returns whether bracketed paste mode is enabled

func (*MultilineReader) ReadInput added in v0.29.0

func (m *MultilineReader) ReadInput(prompt string) (string, error)

ReadInput reads user input, supporting: 1. Bracketed paste mode (multiline paste detection) 2. ``` markers for explicit multiline mode 3. Single line input (default) All bracketed paste markers are automatically stripped from input

func (*MultilineReader) ReadSimpleLine added in v0.45.0

func (m *MultilineReader) ReadSimpleLine() (string, error)

ReadSimpleLine reads a line without raw mode (for simple prompts like selector) This temporarily disables bracketed paste mode to avoid goroutine conflicts

func (*MultilineReader) Reader added in v0.31.0

func (m *MultilineReader) Reader() *bufio.Reader

Reader returns the underlying bufio.Reader for sharing with other input handlers

type Pager

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

Pager は長い出力をページング表示

func NewPager

func NewPager() *Pager

NewPager は新しいPagerを作成

func (*Pager) Display

func (p *Pager) Display(content string)

Display はコンテンツをページング表示

type PasteMode added in v0.31.0

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

PasteMode captures multiline input for environments where bracketed paste mode is unreliable. It is also reusable from other input contexts (e.g., comment input during confirmations).

End conditions: - empty line x2 - "END" or "/end" - Ctrl+D (EOF)

Cancel: - "/cancel" or "/c" (content is discarded)

Limits: - max lines / max bytes - idle timeout

Note: This does NOT read from the OS clipboard. It is an interactive capture mode.

func NewPasteMode added in v0.31.0

func NewPasteMode(cfg config.PasteConfig) *PasteMode

func (*PasteMode) Capture added in v0.31.0

func (p *PasteMode) Capture(in io.Reader, out io.Writer) (content string, cancelled bool, err error)

Capture reads multiline input from in and writes prompts/help to out. Returns captured content, cancelled=true when user cancelled, and error when I/O fails. Deprecated: Use CaptureWithReader for better buffer sharing.

func (*PasteMode) CaptureWithReader added in v0.31.0

func (p *PasteMode) CaptureWithReader(reader *bufio.Reader, out io.Writer) (content string, cancelled bool, err error)

CaptureWithReader reads multiline input using an existing bufio.Reader. This avoids buffer conflicts when sharing stdin with other readers. Returns captured content, cancelled=true when user cancelled, and error when I/O fails.

type PlanDisplay added in v0.45.0

type PlanDisplay struct {
	Title   string
	Summary string
	Steps   []PlanStep
}

PlanDisplay は計画表示用の構造体

func NewPlanDisplay added in v0.45.0

func NewPlanDisplay(title string) *PlanDisplay

NewPlanDisplay は新しい PlanDisplay を作成

func (*PlanDisplay) AddStep added in v0.45.0

func (p *PlanDisplay) AddStep(id int, description string, tools []string, files []string) *PlanDisplay

AddStep はステップを追加

func (*PlanDisplay) Render added in v0.45.0

func (p *PlanDisplay) Render() string

Render は計画を整形して表示

func (*PlanDisplay) SetSummary added in v0.45.0

func (p *PlanDisplay) SetSummary(summary string) *PlanDisplay

SetSummary は概要を設定

type PlanStep added in v0.45.0

type PlanStep struct {
	ID          int
	Description string
	Tools       []string
	Files       []string // 対象ファイル
	Status      string   // "pending", "running", "completed", "failed"
}

PlanStep は計画のステップ情報(UI表示用)

type Progress added in v0.43.0

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

Progress はプログレスバーを表示

func NewProgress added in v0.43.0

func NewProgress(total int, message string) *Progress

NewProgress は新しいProgressを作成 total: 全体の数(0 の場合は不確定モード) message: 表示するメッセージ

func NewProgressWithWriter added in v0.43.0

func NewProgressWithWriter(total int, message string, w io.Writer) *Progress

NewProgressWithWriter は出力先を指定してProgressを作成

func (*Progress) Complete added in v0.43.0

func (p *Progress) Complete()

Complete はプログレスバーを100%にして停止

func (*Progress) GetCurrent added in v0.43.0

func (p *Progress) GetCurrent() int

GetCurrent は現在の進捗を取得

func (*Progress) Increment added in v0.43.0

func (p *Progress) Increment()

Increment は進捗を1増加

func (*Progress) SetMessage added in v0.43.0

func (p *Progress) SetMessage(message string)

SetMessage はメッセージを更新

func (*Progress) SetTotal added in v0.43.0

func (p *Progress) SetTotal(total int)

SetTotal は総数を更新

func (*Progress) Start added in v0.43.0

func (p *Progress) Start()

Start はプログレスバーの表示を開始

func (*Progress) Stop added in v0.43.0

func (p *Progress) Stop()

Stop はプログレスバーを停止して行をクリア

func (*Progress) Update added in v0.43.0

func (p *Progress) Update(current int)

Update は現在の進捗を設定

type Questionnaire added in v0.46.0

type Questionnaire struct {
	Question     string   // 質問文
	QuestionType string   // single_choice, multi_choice, free_text
	Options      []string // 選択肢(choice系の場合)
	Default      string   // デフォルト値
}

Questionnaire はユーザーへの質問を表示・回答収集する

func (*Questionnaire) Ask added in v0.46.0

Ask は質問を表示し、回答を収集

type QuestionnaireAnswer added in v0.46.0

type QuestionnaireAnswer struct {
	Value      string   // 単一回答
	Values     []string // 複数回答(multi_choice用)
	IsMultiple bool     // 複数回答かどうか
}

QuestionnaireAnswer は質問への回答

type SelectOption added in v0.45.0

type SelectOption struct {
	Label       string // 表示ラベル(例: "Yes")
	Description string // 説明文(例: "Execute the proposed change")
	Value       string // 戻り値(例: "yes")
}

SelectOption は選択肢の情報

type Selector added in v0.45.0

type Selector struct {
	Message string         // 質問メッセージ
	Options []SelectOption // 選択肢
}

Selector は選択UI(数字キー + Enter方式)

func NewSelector added in v0.45.0

func NewSelector(message string, options []SelectOption) *Selector

NewSelector は新しいSelectorを作成

func (*Selector) Run added in v0.45.0

func (s *Selector) Run() (string, error)

Run は選択UIを表示し、選択結果を返す

type Spinner

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

Spinner はターミナルでアニメーションを表示

func NewSpinner

func NewSpinner() *Spinner

NewSpinner は新しいSpinnerを作成

func NewSpinnerWithWriter added in v0.31.0

func NewSpinnerWithWriter(w io.Writer) *Spinner

NewSpinnerWithWriter は出力先を指定してSpinnerを作成 run_test などで stdout 出力(コマンド結果)と混ざらないよう、stderr を指定する用途を想定。

func (*Spinner) ClearStatus added in v0.43.0

func (s *Spinner) ClearStatus()

ClearStatus はステータスメッセージをクリア

func (*Spinner) GetStatus added in v0.43.0

func (s *Spinner) GetStatus() string

GetStatus は現在のステータスメッセージを取得

func (*Spinner) SetStatus added in v0.43.0

func (s *Spinner) SetStatus(status string)

SetStatus はスピナーに追加のステータスメッセージを設定 例: "⠋ Thinking (5s) - Analyzing main.go"

func (*Spinner) Start

func (s *Spinner) Start(message string)

Start はスピナーアニメーションを開始

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop はスピナーを停止して行をクリア

type StringMapEditor added in v0.45.0

type StringMapEditor struct {
	Path    string
	Current map[string]string
}

StringMapEditor は map[string]string 型の編集UI

func NewStringMapEditor added in v0.45.0

func NewStringMapEditor(path string, current map[string]string) *StringMapEditor

NewStringMapEditor は新しいStringMapEditorを作成

func (*StringMapEditor) Run added in v0.45.0

func (e *StringMapEditor) Run() (map[string]string, bool, error)

Run は map[string]string 編集UIを表示し、編集結果を返す

type StringSliceEditor added in v0.45.0

type StringSliceEditor struct {
	Path    string
	Current []string
}

StringSliceEditor は []string 型の編集UI

func NewStringSliceEditor added in v0.45.0

func NewStringSliceEditor(path string, current []string) *StringSliceEditor

NewStringSliceEditor は新しいStringSliceEditorを作成

func (*StringSliceEditor) Run added in v0.45.0

func (e *StringSliceEditor) Run() ([]string, bool, error)

Run は []string 編集UIを表示し、編集結果を返す

type StructMapEditor added in v0.45.0

type StructMapEditor struct {
	Path      string
	FieldType config.ConfigFieldType
}

StructMapEditor は map[string]struct 型の編集UI ProviderModels や LSP Servers などに使用

func NewStructMapEditor added in v0.45.0

func NewStructMapEditor(path string, fieldType config.ConfigFieldType) *StructMapEditor

NewStructMapEditor は新しいStructMapEditorを作成

func (*StructMapEditor) Run added in v0.45.0

func (e *StructMapEditor) Run(cfg *config.Config) (bool, error)

Run は struct map 編集UIを表示 注: この実装はシンプル化のため、provider_models と lsp.servers に特化

type SummaryStats added in v0.45.0

type SummaryStats struct {
	FilesChanged      int
	TotalLinesAdded   int
	TotalLinesRemoved int
	CommitHash        string // 最新コミットハッシュ(あれば)
}

SummaryStats は統計情報

type Table added in v0.45.0

type Table struct {
	Headers []string   // ヘッダー行(オプション)
	Rows    [][]string // データ行
	// contains filtered or unexported fields
}

Table はテーブル表示用の構造体

func NewTable added in v0.45.0

func NewTable() *Table

NewTable は新しいテーブルを作成

func (*Table) AddRow added in v0.45.0

func (t *Table) AddRow(cells ...string) *Table

AddRow は行を追加

func (*Table) Render added in v0.45.0

func (t *Table) Render() string

Render はテーブルを罫線付きで描画して文字列を返す

func (*Table) RenderCompact added in v0.45.0

func (t *Table) RenderCompact() string

RenderCompact はコンパクト形式(行間の区切り線なし)で描画

func (*Table) SetColumnColors added in v0.45.0

func (t *Table) SetColumnColors(colors ...*ColorFunc) *Table

SetColumnColors は列ごとの色を設定

func (*Table) SetHeaders added in v0.45.0

func (t *Table) SetHeaders(headers ...string) *Table

SetHeaders はヘッダーを設定

type Task added in v0.43.0

type Task struct {
	ID        int
	Message   string
	Status    TaskStatus
	StartTime time.Time
	EndTime   time.Time
	Error     string
}

Task は個別のタスク情報を保持

type TaskStatus added in v0.43.0

type TaskStatus string

TaskStatus はタスクの状態を表す

const (
	TaskPending TaskStatus = "pending"
	TaskRunning TaskStatus = "running"
	TaskDone    TaskStatus = "done"
	TaskError   TaskStatus = "error"
)

type TaskSummary added in v0.45.0

type TaskSummary struct {
	Changes     []FileChangeSummary // ファイル変更一覧
	TestsPassed *bool               // テスト成功フラグ(nil = 未実行)
	Stats       SummaryStats        // 統計情報
}

TaskSummary はタスク完了時のサマリー表示用

func NewTaskSummary added in v0.45.0

func NewTaskSummary() *TaskSummary

NewTaskSummary は新しい TaskSummary を作成

func (*TaskSummary) AddChange added in v0.45.0

func (ts *TaskSummary) AddChange(filePath, action string, linesAdded, linesRemoved int) *TaskSummary

AddChange はファイル変更を追加

func (*TaskSummary) Calculate added in v0.45.0

func (ts *TaskSummary) Calculate() *TaskSummary

Calculate は統計情報を計算

func (*TaskSummary) Render added in v0.45.0

func (ts *TaskSummary) Render() string

Render はサマリーを表示用文字列に変換

func (*TaskSummary) SetTestResult added in v0.45.0

func (ts *TaskSummary) SetTestResult(passed bool) *TaskSummary

SetTestResult はテスト結果を設定

Jump to

Keyboard shortcuts

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