startup

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = fmt.Errorf("startup mode not implemented")

ErrNotImplemented 标记占位策略尚未落地。

Functions

This section is empty.

Types

type CoCreateSession

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

CoCreateSession 承载共创模式的非 UI 状态。

func NewCoCreateSession

func NewCoCreateSession(initial string) *CoCreateSession

func (*CoCreateSession) AppendUser

func (s *CoCreateSession) AppendUser(text string)

func (*CoCreateSession) ApplyDelta

func (s *CoCreateSession) ApplyDelta(kind, text string)

ApplyDelta 接收流式累积;kind="thinking" 写入推理流,"reply" 写入回复预览。 两路分别累积,UI 可分块染色显示,让用户在 thinking 阶段也看到 LLM 在工作。

func (*CoCreateSession) ApplyReply

func (s *CoCreateSession) ApplyReply(reply host.CoCreateReply)

func (*CoCreateSession) BuildPlan

func (s *CoCreateSession) BuildPlan() (Plan, error)

func (*CoCreateSession) CanStart

func (s *CoCreateSession) CanStart() bool

func (*CoCreateSession) DraftPrompt

func (s *CoCreateSession) DraftPrompt() string

func (*CoCreateSession) History

func (s *CoCreateSession) History() []host.CoCreateMessage

func (*CoCreateSession) InitialInput

func (s *CoCreateSession) InitialInput() string

func (*CoCreateSession) Ready

func (s *CoCreateSession) Ready() bool

func (*CoCreateSession) StreamReply

func (s *CoCreateSession) StreamReply() string

func (*CoCreateSession) StreamThinking added in v0.3.1

func (s *CoCreateSession) StreamThinking() string

func (*CoCreateSession) Suggestions added in v0.3.1

func (s *CoCreateSession) Suggestions() []string

type Mode

type Mode string

Mode 表示进入 Engine 之前的启动策略类型。

const (
	// ModeQuick 直接以用户输入作为创作起点。
	ModeQuick Mode = "quick"
	// ModeCoCreate 先做多轮澄清,再产出创作草稿进入 Engine。
	ModeCoCreate Mode = "cocreate"
	// ModeContinueFromNovel 基于已有小说内容装配上下文后续写。
	ModeContinueFromNovel Mode = "continue_from_novel"
)

type Plan

type Plan struct {
	Mode        Mode
	DisplayName string
	RawPrompt   string // 用户原始创作要求(未包装);供用户规则归一化使用,resume 模式为空
	ResumeOnly  bool
}

Plan 描述启动策略层产出的结果。 宿主入口不应自己拼接正式启动 prompt,而应消费 Plan 再驱动 Engine。

func PrepareContinueFromNovel

func PrepareContinueFromNovel(req Request) (Plan, error)

PrepareContinueFromNovel 是“根据已有小说续写”的统一预留落点。 TUI/headless 未来都应先把输入整理到 Request,再从这里产出可进入 Engine 的 Plan。

func PrepareQuick

func PrepareQuick(req Request) (Plan, error)

PrepareQuick 将直接输入整理为可进入 Engine 的快速启动计划。

type Request

type Request struct {
	Mode        Mode
	UserPrompt  string
	NovelPath   string
	OutputDir   string
	Interactive bool
}

Request 描述入口层提交给启动策略层的原始输入。 宿主入口先收集用户输入,再由 startup 把它整理为可进入 Engine 的计划。

Jump to

Keyboard shortcuts

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