Documentation
¶
Index ¶
- func BuildStartPrompt(prompt string) string
- func ReplayDeltaText(item domain.RuntimeQueueItem) string
- type AgentContextSnapshot
- type AgentSnapshot
- type CoCreateMessage
- type CoCreateReply
- type Event
- type Host
- func (h *Host) Abort() bool
- func (h *Host) AskUser() *tools.AskUserTool
- func (h *Host) Close()
- func (h *Host) CoCreateStream(ctx context.Context, history []CoCreateMessage, onReply func(string)) (CoCreateReply, error)
- func (h *Host) ConfiguredModels(provider string) []string
- func (h *Host) ConfiguredProviders() []string
- func (h *Host) Continue(text string) error
- func (h *Host) CurrentModelSelection(role string) (string, string, bool)
- func (h *Host) Dir() string
- func (h *Host) Done() <-chan struct{}
- func (h *Host) Events() <-chan Event
- func (h *Host) ReplayQueue(afterSeq int64) ([]domain.RuntimeQueueItem, error)
- func (h *Host) Resume() (string, error)
- func (h *Host) Snapshot() UISnapshot
- func (h *Host) Start(prompt string) error
- func (h *Host) StartPrepared(promptText string) error
- func (h *Host) Steer(text string)
- func (h *Host) Stream() <-chan string
- func (h *Host) StreamClear() <-chan struct{}
- func (h *Host) SwitchModel(role, provider, model string) error
- type OutlineSnapshot
- type TaskSnapshot
- type UISnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildStartPrompt ¶
BuildStartPrompt 将用户需求包装为 Coordinator 的启动 prompt。
func ReplayDeltaText ¶
func ReplayDeltaText(item domain.RuntimeQueueItem) string
ReplayDeltaText 从运行时队列项中提取可回放的流式文本。
Types ¶
type AgentContextSnapshot ¶
type AgentContextSnapshot struct {
Tokens int
ContextWindow int
Percent float64
Scope string
Strategy string
ActiveMessages int
SummaryMessages int
CompactedCount int
KeptCount int
}
AgentContextSnapshot 是 Agent 上下文使用情况。
type AgentSnapshot ¶
type AgentSnapshot struct {
Name string
State string
TaskID string
TaskKind string
Summary string
Tool string
Turn int
Context AgentContextSnapshot
RecentProjection AgentContextSnapshot
UpdatedAt time.Time
}
AgentSnapshot 是 Agent 状态的展示投影。
type CoCreateMessage ¶
CoCreateMessage 是共创对话的消息。
type CoCreateReply ¶
CoCreateReply 是共创对话的 LLM 回复。
type Event ¶
type Event struct {
Time time.Time
Category string // TOOL / SYSTEM / REVIEW / CHECK / ERROR / AGENT
Summary string
Level string // info / warn / error / success
}
Event 是 TUI 消费的结构化事件。
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host 是运行时薄外壳。 职责:启动/恢复/干预注入/事件投影/模型管理。 不做任何调度决策,不做空闲续跑。
func (*Host) AskUser ¶
func (h *Host) AskUser() *tools.AskUserTool
func (*Host) CoCreateStream ¶
func (h *Host) CoCreateStream(ctx context.Context, history []CoCreateMessage, onReply func(string)) (CoCreateReply, error)
func (*Host) ConfiguredModels ¶
func (*Host) ConfiguredProviders ¶
func (*Host) CurrentModelSelection ¶
func (*Host) ReplayQueue ¶
func (h *Host) ReplayQueue(afterSeq int64) ([]domain.RuntimeQueueItem, error)
func (*Host) Snapshot ¶
func (h *Host) Snapshot() UISnapshot
func (*Host) StartPrepared ¶
StartPrepared 使用已编排完成的启动 prompt 开始创作。
func (*Host) StreamClear ¶
func (h *Host) StreamClear() <-chan struct{}
func (*Host) SwitchModel ¶
type OutlineSnapshot ¶
OutlineSnapshot 是大纲条目的展示摘要。
type TaskSnapshot ¶
type TaskSnapshot struct {
ID string
Kind string
Owner string
Title string
Status string
Chapter int
Volume int
Arc int
Summary string
Tool string
OutputRef string
UpdatedAt time.Time
}
TaskSnapshot 是任务状态的展示投影(从事件流投影,非事实层)。
type UISnapshot ¶
type UISnapshot struct {
Provider string
NovelName string
ModelName string
Style string
RuntimeState string // idle / running / pausing / paused / completed
StatusLabel string
Phase string
Flow string
CurrentChapter int
TotalChapters int
CompletedCount int
TotalWordCount int
InProgressChapter int
PendingRewrites []int
RewriteReason string
PendingSteer string
RecoveryLabel string
IsRunning bool
Agents []AgentSnapshot
Tasks []TaskSnapshot
// 上下文
ContextTokens int
ContextWindow int
ContextPercent float64
ContextScope string
ContextStrategy string
ProjectionTokens int
ProjectionWindow int
ProjectionPercent float64
ProjectionStrategy string
ProjectionCompacted int
ProjectionKept int
ContextActiveMessages int
ContextSummaryCount int
ContextCompactedCount int
ContextKeptCount int
// 基础设定
Premise string
Outline []OutlineSnapshot
Characters []string
Layered bool
CurrentVolumeArc string
NextVolumeTitle string
CompassDirection string
CompassScale string
// 详情
LastCommitSummary string
LastReviewSummary string
LastCheckpointName string
RecentSummaries []string
}
UISnapshot 是 TUI 渲染所需的聚合状态快照。
Click to show internal directories.
Click to hide internal directories.