domain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ReviewInterval = 5

ReviewInterval 全局审阅间隔(每 N 章触发一次)。

Variables

This section is empty.

Functions

func CanTransitionFlow added in v0.0.2

func CanTransitionFlow(from, to FlowState) bool

CanTransitionFlow 判断 FlowState 是否允许迁移。

func CanTransitionPhase added in v0.0.2

func CanTransitionPhase(from, to Phase) bool

CanTransitionPhase 判断 Phase 是否允许迁移。 规则保持简单:允许同态迁移、允许前进,不允许回退。

func ExtractNovelNameFromPremise added in v0.1.0

func ExtractNovelNameFromPremise(premise string) string

ExtractNovelNameFromPremise 只按第一条非空行提取书名。 约定 premise 第一行固定为:# 书名

func NextSkeletonArc added in v0.0.2

func NextSkeletonArc(volumes []VolumeOutline, afterVol, afterArc int) (vol, arc int)

NextSkeletonArc 从指定卷/弧之后查找下一个未展开的骨架弧。 未找到返回 (0, 0)。

func ShouldArcReview

func ShouldArcReview(isArcEnd, isVolumeEnd bool, volume, arc int) (bool, string)

ShouldArcReview 长篇模式下判断是否需要弧级/卷级评审。

func ShouldReview

func ShouldReview(completedCount int) (bool, string)

ShouldReview 根据已完成章节数判断是否需要全局审阅(短篇/中篇模式)。

func TotalChapters

func TotalChapters(volumes []VolumeOutline) int

TotalChapters 计算分层大纲中已展开的实际章节数。 骨架弧(未展开)不计入,因为其 EstimatedChapters 只是预估值, 会随弧展开和新卷创建不断变化。

func ValidateFlowTransition added in v0.0.2

func ValidateFlowTransition(from, to FlowState) error

ValidateFlowTransition 校验 FlowState 迁移是否合法。

func ValidatePhaseTransition added in v0.0.2

func ValidatePhaseTransition(from, to Phase) error

ValidatePhaseTransition 校验 Phase 迁移是否合法。

func WordCount

func WordCount(content string) int

WordCount 按 rune 计算字数。

Types

type ArcOutline

type ArcOutline struct {
	Index             int            `json:"index"` // 卷内弧序号
	Title             string         `json:"title"`
	Goal              string         `json:"goal"`                         // 弧目标(起承转合)
	EstimatedChapters int            `json:"estimated_chapters,omitempty"` // 骨架弧的预估章数(展开后清零)
	Chapters          []OutlineEntry `json:"chapters"`
}

ArcOutline 弧级大纲。

func (*ArcOutline) IsExpanded added in v0.0.2

func (a *ArcOutline) IsExpanded() bool

IsExpanded 判断弧是否已展开(有详细章节)。

type ArcSummary

type ArcSummary struct {
	Volume    int      `json:"volume"`
	Arc       int      `json:"arc"`
	Title     string   `json:"title"`
	Summary   string   `json:"summary"`
	KeyEvents []string `json:"key_events"`
}

ArcSummary 弧级摘要,弧结束时由 Editor 生成。

type ChapterContract added in v0.0.3

type ChapterContract struct {
	RequiredBeats    []string `json:"required_beats,omitempty"`    // 本章必须落地的推进项
	ForbiddenMoves   []string `json:"forbidden_moves,omitempty"`   // 本章明确不能发生的推进
	ContinuityChecks []string `json:"continuity_checks,omitempty"` // 本章需特别核对的连续性点
	EvaluationFocus  []string `json:"evaluation_focus,omitempty"`  // Editor 需要重点检查的点
	EmotionTarget    string   `json:"emotion_target,omitempty"`    // 可选:本章希望读者主要感受到的情绪
	PayoffPoints     []string `json:"payoff_points,omitempty"`     // 可选:关键章希望回应的情节点/兑现点
	HookGoal         string   `json:"hook_goal,omitempty"`         // 可选:章末钩子希望驱动的追读欲望
}

ChapterContract 是 Writer 和 Editor 共享的章节验收契约。 它定义本章必须完成的推进项、禁止越界项以及审阅关注点。

type ChapterPlan

type ChapterPlan struct {
	Chapter    int             `json:"chapter"`
	Title      string          `json:"title"`
	Goal       string          `json:"goal"`
	Conflict   string          `json:"conflict"`
	Hook       string          `json:"hook"`
	EmotionArc string          `json:"emotion_arc,omitempty"`
	Notes      string          `json:"notes,omitempty"` // Agent 的自由备忘
	Contract   ChapterContract `json:"contract,omitempty"`
}

ChapterPlan 章节写作构思,Writer 自主生成。 不再强制场景拆分,Agent 自己决定如何组织内容。

type ChapterSummary

type ChapterSummary struct {
	Chapter    int      `json:"chapter"`
	Summary    string   `json:"summary"`
	Characters []string `json:"characters"`
	KeyEvents  []string `json:"key_events"`
}

ChapterSummary 章节摘要,供后续章节的上下文窗口使用。

type Character

type Character struct {
	Name        string   `json:"name"`
	Aliases     []string `json:"aliases,omitempty"` // 别名/称号/绰号(如"废物少年"、"炎哥")
	Role        string   `json:"role"`
	Description string   `json:"description"`
	Arc         string   `json:"arc"`
	Traits      []string `json:"traits"`
	Tier        string   `json:"tier,omitempty"` // core / important / secondary / decorative(默认 important)
}

Character 角色档案。

type CharacterSnapshot

type CharacterSnapshot struct {
	Volume     int    `json:"volume"`
	Arc        int    `json:"arc"`
	Name       string `json:"name"`
	Status     string `json:"status"`
	Power      string `json:"power,omitempty"`
	Motivation string `json:"motivation"`
	Relations  string `json:"relations,omitempty"`
}

CharacterSnapshot 角色状态快照,弧边界时记录。

type CharacterVoice added in v0.0.2

type CharacterVoice struct {
	Name  string   `json:"name"`
	Rules []string `json:"rules"` // 2-3 条语言特征规则,每条 ≤30 字
}

CharacterVoice 单个角色的对话风格规则。

type Checkpoint added in v0.1.0

type Checkpoint struct {
	Seq        int64     `json:"seq"`
	Scope      Scope     `json:"scope"`
	Step       string    `json:"step"`
	Artifact   string    `json:"artifact,omitempty"`
	Digest     string    `json:"digest,omitempty"`
	OccurredAt time.Time `json:"occurred_at"`
}

Checkpoint 记录某个 step 成功完成的事实。 由工具在原子落盘后追加到 JSONL,是恢复和观察的唯一事实来源。

type CommitResult

type CommitResult struct {
	Chapter        int              `json:"chapter"`
	Committed      bool             `json:"committed"`
	WordCount      int              `json:"word_count"`
	NextChapter    int              `json:"next_chapter"`
	ReviewRequired bool             `json:"review_required"`
	ReviewReason   string           `json:"review_reason,omitempty"`
	HookType       string           `json:"hook_type,omitempty"`
	DominantStrand string           `json:"dominant_strand,omitempty"`
	Feedback       *OutlineFeedback `json:"feedback,omitempty"`
	// 长篇分层信号
	ArcEnd         bool `json:"arc_end,omitempty"`
	VolumeEnd      bool `json:"volume_end,omitempty"`
	IsFinalVolume  bool `json:"is_final_volume,omitempty"` // 当前卷为最终卷
	Volume         int  `json:"volume,omitempty"`
	Arc            int  `json:"arc,omitempty"`
	NeedsExpansion bool `json:"needs_expansion,omitempty"`  // 下一弧是骨架,需要展开章节
	NeedsNewVolume bool `json:"needs_new_volume,omitempty"` // 需要 Architect 创建下一卷
	NextVolume     int  `json:"next_volume,omitempty"`      // 下一弧/卷序号
	NextArc        int  `json:"next_arc,omitempty"`         // 下一弧序号
	// 系统提示:工具检测到的确定性指令,Coordinator 必须遵守
	SystemHints []string `json:"system_hints,omitempty"`
}

CommitResult 是 commit_chapter 工具的结构化返回值。 Coordinator 读取 SystemHints 中的 [系统] 前缀提示做下一步决策。

type CommitStage added in v0.0.3

type CommitStage string

CommitStage 表示章节提交 Saga 的当前阶段。

const (
	CommitStageStarted        CommitStage = "started"
	CommitStageStateApplied   CommitStage = "state_applied"
	CommitStageProgressMarked CommitStage = "progress_marked"
	CommitStageSignalSaved    CommitStage = "signal_saved"
)

type ConsistencyIssue

type ConsistencyIssue struct {
	Type        string `json:"type"`     // consistency / character / pacing / continuity / foreshadow / hook / aesthetic
	Severity    string `json:"severity"` // critical / error / warning
	Description string `json:"description"`
	Evidence    string `json:"evidence,omitempty"` // 证据:原文片段、具体情节或状态数据
	Suggestion  string `json:"suggestion,omitempty"`
}

ConsistencyIssue 一致性问题。

type ContextBuildEvidence added in v0.1.0

type ContextBuildEvidence struct {
	Agent              string   `json:"agent,omitempty"`
	Chapter            int      `json:"chapter,omitempty"`
	Mode               string   `json:"mode,omitempty"` // chapter / architect
	SummaryWindow      int      `json:"summary_window,omitempty"`
	TimelineWindow     int      `json:"timeline_window,omitempty"`
	LayeredSummaries   bool     `json:"layered_summaries,omitempty"`
	HasCurrentOutline  bool     `json:"has_current_outline,omitempty"`
	HasNextOutline     bool     `json:"has_next_outline,omitempty"`
	HasChapterPlan     bool     `json:"has_chapter_plan,omitempty"`
	HasChapterContract bool     `json:"has_chapter_contract,omitempty"`
	RecentSummaryCount int      `json:"recent_summary_count,omitempty"`
	TimelineCount      int      `json:"timeline_count,omitempty"`
	ForeshadowCount    int      `json:"foreshadow_count,omitempty"`
	RelationshipCount  int      `json:"relationship_count,omitempty"`
	StateChangeCount   int      `json:"state_change_count,omitempty"`
	StoryThreadCount   int      `json:"story_thread_count,omitempty"`
	ReviewLessonCount  int      `json:"review_lesson_count,omitempty"`
	WarnSections       []string `json:"warn_sections,omitempty"`
	TrimmedSections    []string `json:"trimmed_sections,omitempty"`
}

ContextBuildEvidence 记录一次 novel_context 实际注入了哪些关键上下文。 只保存结构化摘要,不保存长文本,便于诊断 prompt / context 设计问题。

type ContextProfile

type ContextProfile struct {
	SummaryWindow  int  // 加载最近 N 章摘要
	TimelineWindow int  // 加载最近 N 章时间线
	Layered        bool // true = 启用分层摘要加载(卷摘要+弧摘要+章摘要)
}

ContextProfile 上下文加载策略,根据总章节数自适应。

func NewContextProfile

func NewContextProfile(totalChapters int) ContextProfile

NewContextProfile 根据总章节数计算上下文策略。

type ContextRewriteStep added in v0.1.0

type ContextRewriteStep struct {
	Name         string `json:"name"`
	Applied      bool   `json:"applied"`
	TokensBefore int    `json:"tokens_before"`
	TokensAfter  int    `json:"tokens_after"`
}

ContextRewriteStep 记录压缩管线中单个策略的执行情况。

type ControlIntent added in v0.1.0

type ControlIntent struct {
	ID        string               `json:"id"`
	Kind      ControlIntentKind    `json:"kind"`
	Priority  RuntimeQueuePriority `json:"priority"`
	Summary   string               `json:"summary,omitempty"`
	Message   string               `json:"message,omitempty"`
	Prompt    string               `json:"prompt,omitempty"`
	TaskKind  string               `json:"task_kind,omitempty"`
	TaskTitle string               `json:"task_title,omitempty"`
	TaskInput string               `json:"task_input,omitempty"`
	CreatedAt time.Time            `json:"created_at"`
	Payload   map[string]string    `json:"payload,omitempty"`
}

ControlIntent 是持久化控制队列中的一项。

type ControlIntentKind added in v0.1.0

type ControlIntentKind string

ControlIntentKind 表示控制队列中的指令类型。

const (
	ControlIntentResumePrompt ControlIntentKind = "resume_prompt"
	ControlIntentSteerMessage ControlIntentKind = "steer_message"
)

type DimensionScore

type DimensionScore struct {
	Dimension string `json:"dimension"`         // consistency / character / pacing / continuity / foreshadow / hook / aesthetic
	Score     int    `json:"score"`             // 0-100
	Verdict   string `json:"verdict"`           // pass / warning / fail
	Comment   string `json:"comment,omitempty"` // 该维度的简要结论
}

DimensionScore 单维度评审评分。

type FlowState

type FlowState string

FlowState 当前活动流程类型,用于 checkpoint 恢复。

const (
	FlowWriting   FlowState = "writing"
	FlowReviewing FlowState = "reviewing"
	FlowRewriting FlowState = "rewriting"
	FlowPolishing FlowState = "polishing"
	FlowSteering  FlowState = "steering"
)

type ForeshadowEntry

type ForeshadowEntry struct {
	ID          string `json:"id"`
	Description string `json:"description"`
	PlantedAt   int    `json:"planted_at"`
	Status      string `json:"status"` // planted / advanced / resolved
	ResolvedAt  int    `json:"resolved_at,omitempty"`
}

ForeshadowEntry 伏笔条目。

type ForeshadowUpdate

type ForeshadowUpdate struct {
	ID          string `json:"id"`
	Action      string `json:"action"` // plant / advance / resolve
	Description string `json:"description,omitempty"`
}

ForeshadowUpdate 伏笔增量操作。

type MemoryPolicy added in v0.0.3

type MemoryPolicy struct {
	Mode                string `json:"mode,omitempty"`
	SummaryWindow       int    `json:"summary_window,omitempty"`
	TimelineWindow      int    `json:"timeline_window,omitempty"`
	LayeredSummaries    bool   `json:"layered_summaries,omitempty"`
	SummaryStrategy     string `json:"summary_strategy,omitempty"`
	WorkingRefresh      string `json:"working_refresh,omitempty"`
	EpisodicRefresh     string `json:"episodic_refresh,omitempty"`
	PlanningRefresh     string `json:"planning_refresh,omitempty"`
	FoundationRefresh   string `json:"foundation_refresh,omitempty"`
	PlanningFocus       string `json:"planning_focus,omitempty"`
	FoundationFocus     string `json:"foundation_focus,omitempty"`
	PreviousTailChars   int    `json:"previous_tail_chars,omitempty"`
	ChapterPlanEnabled  bool   `json:"chapter_plan_enabled,omitempty"`
	RelatedLookup       bool   `json:"related_chapter_lookup,omitempty"`
	CurrentOutlineBound bool   `json:"current_outline_bound,omitempty"`
	TotalChapters       int    `json:"total_chapters,omitempty"`
	HandoffPreferred    bool   `json:"handoff_preferred,omitempty"`
	ReadOnlyThreshold   int    `json:"read_only_threshold,omitempty"`
}

MemoryPolicy 表示运行时共享的记忆使用策略。 它既用于上下文输出,也用于宿主层的 handoff / reminder 决策。

func NewArchitectMemoryPolicy added in v0.0.3

func NewArchitectMemoryPolicy() MemoryPolicy

NewArchitectMemoryPolicy 返回规划阶段使用的记忆策略。

func NewChapterMemoryPolicy added in v0.0.3

func NewChapterMemoryPolicy(progress *Progress, profile ContextProfile, currentOutlineBound bool) MemoryPolicy

NewChapterMemoryPolicy 根据进度与上下文策略生成章节运行时记忆策略。

type Novel

type Novel struct {
	Name          string `json:"name"`
	TotalChapters int    `json:"total_chapters"`
}

Novel 小说元信息。

type OutlineEntry

type OutlineEntry struct {
	Chapter   int      `json:"chapter"`
	Title     string   `json:"title"`
	CoreEvent string   `json:"core_event"`
	Hook      string   `json:"hook"`
	Scenes    []string `json:"scenes"`
}

OutlineEntry 大纲条目,对应一章。

func FlattenOutline

func FlattenOutline(volumes []VolumeOutline) []OutlineEntry

FlattenOutline 将分层大纲展开为扁平章节列表,保持全局章节号连续。

type OutlineFeedback

type OutlineFeedback struct {
	Deviation  string `json:"deviation"`  // 偏离描述
	Suggestion string `json:"suggestion"` // 调整建议
}

OutlineFeedback Writer 对大纲的反馈,提交章节时可选。

type PendingCommit added in v0.0.3

type PendingCommit struct {
	Chapter        int           `json:"chapter"`
	Stage          CommitStage   `json:"stage"`
	Summary        string        `json:"summary,omitempty"`
	HookType       string        `json:"hook_type,omitempty"`
	DominantStrand string        `json:"dominant_strand,omitempty"`
	Result         *CommitResult `json:"result,omitempty"`
	StartedAt      string        `json:"started_at,omitempty"`
	UpdatedAt      string        `json:"updated_at,omitempty"`
}

PendingCommit 记录章节提交中断时的恢复信息。

type Phase

type Phase string

Phase 表示小说创作阶段。

const (
	PhaseInit     Phase = "init"
	PhasePremise  Phase = "premise"
	PhaseOutline  Phase = "outline"
	PhaseWriting  Phase = "writing"
	PhaseComplete Phase = "complete"
)

type PlanningTier

type PlanningTier string

PlanningTier 表示作品规划的长度级别。

const (
	PlanningTierShort PlanningTier = "short"
	PlanningTierMid   PlanningTier = "mid"
	PlanningTierLong  PlanningTier = "long"
)

type Progress

type Progress struct {
	NovelName         string      `json:"novel_name"`
	Phase             Phase       `json:"phase"`
	CurrentChapter    int         `json:"current_chapter"`
	TotalChapters     int         `json:"total_chapters"`
	CompletedChapters []int       `json:"completed_chapters"`
	TotalWordCount    int         `json:"total_word_count"`
	ChapterWordCounts map[int]int `json:"chapter_word_counts,omitempty"` // 每章字数,支持重写时修正总字数
	InProgressChapter int         `json:"in_progress_chapter,omitempty"` // 正在写作的章节(场景级恢复)
	CompletedScenes   []int       `json:"completed_scenes,omitempty"`    // 当前章节已完成的场景编号
	Flow              FlowState   `json:"flow,omitempty"`                // 当前流程
	PendingRewrites   []int       `json:"pending_rewrites,omitempty"`    // 待重写章节队列
	RewriteReason     string      `json:"rewrite_reason,omitempty"`      // 重写原因
	StrandHistory     []string    `json:"strand_history,omitempty"`      // 按章节顺序记录 dominant_strand
	HookHistory       []string    `json:"hook_history,omitempty"`        // 按章节顺序记录 hook_type
	// 长篇分层追踪(仅长篇模式使用,短篇/中篇为零值)
	CurrentVolume int  `json:"current_volume,omitempty"`
	CurrentArc    int  `json:"current_arc,omitempty"`
	Layered       bool `json:"layered,omitempty"`
}

Progress 进度追踪,持久化到 meta/progress.json。

func (*Progress) IsResumable

func (p *Progress) IsResumable() bool

IsResumable 判断是否可以从断点恢复。

func (*Progress) NextChapter

func (p *Progress) NextChapter() int

NextChapter 返回下一个要写的章节号。

type RecallItem added in v0.1.0

type RecallItem struct {
	Kind    string `json:"kind"`
	Key     string `json:"key,omitempty"`
	Chapter int    `json:"chapter,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Summary string `json:"summary,omitempty"`
}

RecallItem 是按当前任务选择性召回的长期信息。 它不替代正式工件,只负责把当前轮真正相关的少量历史信息回注给模型。

type RelatedChapter added in v0.0.2

type RelatedChapter struct {
	Chapter int    `json:"chapter"`
	Reason  string `json:"reason"`
}

RelatedChapter 推荐回读的相关章节。

type RelationshipEntry

type RelationshipEntry struct {
	CharacterA string `json:"character_a"`
	CharacterB string `json:"character_b"`
	Relation   string `json:"relation"`
	Chapter    int    `json:"chapter"`
}

RelationshipEntry 人物关系条目。

type ReviewEntry

type ReviewEntry struct {
	Chapter          int                `json:"chapter"`
	Scope            string             `json:"scope"` // chapter / global / arc
	Issues           []ConsistencyIssue `json:"issues"`
	Dimensions       []DimensionScore   `json:"dimensions,omitempty"`      // 分维度评分
	ContractStatus   string             `json:"contract_status,omitempty"` // met / partial / missed
	ContractMisses   []string           `json:"contract_misses,omitempty"` // 未达成的 contract 条目
	ContractNotes    string             `json:"contract_notes,omitempty"`  // 对 contract 履行情况的简述
	Verdict          string             `json:"verdict"`                   // accept / polish / rewrite
	Summary          string             `json:"summary"`
	AffectedChapters []int              `json:"affected_chapters,omitempty"` // 需要重写/打磨的章节号
}

ReviewEntry Editor 的审阅条目。

func (*ReviewEntry) CriticalCount

func (r *ReviewEntry) CriticalCount() int

CriticalCount 返回 critical 级别问题数量。

func (*ReviewEntry) Dimension added in v0.0.3

func (r *ReviewEntry) Dimension(name string) *DimensionScore

Dimension 返回指定维度的评分;不存在则返回 nil。

func (*ReviewEntry) ErrorCount

func (r *ReviewEntry) ErrorCount() int

ErrorCount 返回 error 级别问题数量。

type ReviewOutcomeEvidence added in v0.1.0

type ReviewOutcomeEvidence struct {
	Chapter            int      `json:"chapter"`
	Verdict            string   `json:"verdict"`
	ContractStatus     string   `json:"contract_status,omitempty"`
	AffectedChapters   []int    `json:"affected_chapters,omitempty"`
	LowDimensions      []string `json:"low_dimensions,omitempty"`
	FailedDimensions   []string `json:"failed_dimensions,omitempty"`
	CriticalIssueTypes []string `json:"critical_issue_types,omitempty"`
	TopReasonCodes     []string `json:"top_reason_codes,omitempty"`
}

ReviewOutcomeEvidence 是对 Editor 评审结果的轻量结构化归纳。

type RunMeta

type RunMeta struct {
	StartedAt    string       `json:"started_at"`
	Provider     string       `json:"provider,omitempty"`
	Style        string       `json:"style"`
	Model        string       `json:"model"`
	PlanningTier PlanningTier `json:"planning_tier,omitempty"`
	SteerHistory []SteerEntry `json:"steer_history,omitempty"`
	PendingSteer string       `json:"pending_steer,omitempty"` // 未完成的 Steer 指令,中断恢复时重新注入
}

RunMeta 运行元信息,持久化到 meta/run.json。

type RuntimeContextBoundary added in v0.1.0

type RuntimeContextBoundary struct {
	Agent          string               `json:"agent,omitempty"`
	Kind           string               `json:"kind"` // projected / compacted / recovered
	Reason         string               `json:"reason,omitempty"`
	Strategy       string               `json:"strategy,omitempty"`
	Committed      bool                 `json:"committed,omitempty"`
	TokensBefore   int                  `json:"tokens_before,omitempty"`
	TokensAfter    int                  `json:"tokens_after,omitempty"`
	MessagesBefore int                  `json:"messages_before,omitempty"`
	MessagesAfter  int                  `json:"messages_after,omitempty"`
	CompactedCount int                  `json:"compacted_count,omitempty"`
	KeptCount      int                  `json:"kept_count,omitempty"`
	SplitTurn      bool                 `json:"split_turn,omitempty"`
	Incremental    bool                 `json:"incremental,omitempty"`
	SummaryRunes   int                  `json:"summary_runes,omitempty"`
	Steps          []ContextRewriteStep `json:"steps,omitempty"`
}

RuntimeContextBoundary 是上下文正式边界/投影视图的显式记录。 它补充 UIEvent,便于恢复、审计和后续识别“这次是否已提交到 baseline”。

type RuntimeQueueItem added in v0.1.0

type RuntimeQueueItem struct {
	Seq      int64                `json:"seq"`
	Time     time.Time            `json:"time"`
	Kind     RuntimeQueueKind     `json:"kind"`
	Priority RuntimeQueuePriority `json:"priority"`
	TaskID   string               `json:"task_id,omitempty"`
	Agent    string               `json:"agent,omitempty"`
	Category string               `json:"category,omitempty"`
	Summary  string               `json:"summary,omitempty"`
	Payload  any                  `json:"payload,omitempty"`
}

RuntimeQueueItem 是统一运行时队列的持久化记录。

type RuntimeQueueKind added in v0.1.0

type RuntimeQueueKind string

RuntimeQueueKind 表示运行时队列项类型。

const (
	RuntimeQueueUIEvent     RuntimeQueueKind = "ui_event"
	RuntimeQueueStreamDelta RuntimeQueueKind = "stream_delta"
	RuntimeQueueStreamClear RuntimeQueueKind = "stream_clear"
	RuntimeQueueContextEdge RuntimeQueueKind = "context_boundary"
	RuntimeQueueControl     RuntimeQueueKind = "control"
	RuntimeQueueEvidence    RuntimeQueueKind = "evidence"
)

type RuntimeQueuePriority added in v0.1.0

type RuntimeQueuePriority string

RuntimeQueuePriority 表示运行时队列优先级。

const (
	RuntimePriorityInterrupt  RuntimeQueuePriority = "interrupt"
	RuntimePriorityControl    RuntimeQueuePriority = "control"
	RuntimePriorityBackground RuntimeQueuePriority = "background"
)

type RuntimeTaskLogEntry added in v0.1.0

type RuntimeTaskLogEntry struct {
	Time    time.Time `json:"time"`
	TaskID  string    `json:"task_id,omitempty"`
	Agent   string    `json:"agent,omitempty"`
	Event   string    `json:"event"`
	Tool    string    `json:"tool,omitempty"`
	Summary string    `json:"summary,omitempty"`
	Payload any       `json:"payload,omitempty"`
}

RuntimeTaskLogEntry 是单任务运行日志的持久化记录。

type Scope added in v0.1.0

type Scope struct {
	Kind    ScopeKind `json:"kind"`
	Chapter int       `json:"chapter,omitempty"`
	Volume  int       `json:"volume,omitempty"`
	Arc     int       `json:"arc,omitempty"`
}

Scope 定位一条 checkpoint 所属的创作范围。

func ArcScope added in v0.1.0

func ArcScope(volume, arc int) Scope

ArcScope 构造一个弧级 Scope。

func ChapterScope added in v0.1.0

func ChapterScope(chapter int) Scope

ChapterScope 构造一个章节级 Scope。

func GlobalScope added in v0.1.0

func GlobalScope() Scope

GlobalScope 构造一个全局 Scope。

func VolumeScope added in v0.1.0

func VolumeScope(volume int) Scope

VolumeScope 构造一个卷级 Scope。

func (Scope) Matches added in v0.1.0

func (s Scope) Matches(other Scope) bool

Matches 判断两个 Scope 是否相同。

func (Scope) String added in v0.1.0

func (s Scope) String() string

type ScopeKind added in v0.1.0

type ScopeKind string

ScopeKind 标识 checkpoint 的作用域类型。

const (
	ScopeChapter ScopeKind = "chapter"
	ScopeArc     ScopeKind = "arc"
	ScopeVolume  ScopeKind = "volume"
	ScopeGlobal  ScopeKind = "global"
)

type StateChange

type StateChange struct {
	Chapter  int    `json:"chapter"`
	Entity   string `json:"entity"`              // 角色名或实体名
	Field    string `json:"field"`               // 变化属性:realm/location/status/power/relation 等
	OldValue string `json:"old_value,omitempty"` // 变化前(首次出现可空)
	NewValue string `json:"new_value"`           // 变化后
	Reason   string `json:"reason,omitempty"`    // 变化原因
}

StateChange 角色/实体状态变化记录。

type SteerEntry

type SteerEntry struct {
	Input     string `json:"input"`
	Timestamp string `json:"timestamp"`
}

SteerEntry 用户干预记录。

type StoryCompass added in v0.0.2

type StoryCompass struct {
	EndingDirection string   `json:"ending_direction"`          // 终局方向(主题性描述)
	OpenThreads     []string `json:"open_threads,omitempty"`    // 活跃长线(需收束才能结局)
	EstimatedScale  string   `json:"estimated_scale,omitempty"` // 模糊规模(如"预计 4-6 卷")
	LastUpdated     int      `json:"last_updated,omitempty"`    // 更新时的已完成章节数
}

StoryCompass 终局方向指南针,替代固定的骨架卷列表。 Architect 在每次卷边界时可更新,允许故事方向随创作演化。

type TimelineEvent

type TimelineEvent struct {
	Chapter    int      `json:"chapter"`
	Time       string   `json:"time"`
	Event      string   `json:"event"`
	Characters []string `json:"characters,omitempty"`
}

TimelineEvent 时间线事件。

type VolumeOutline

type VolumeOutline struct {
	Index int          `json:"index"`
	Title string       `json:"title"`
	Theme string       `json:"theme"`           // 本卷核心冲突/主题
	Final bool         `json:"final,omitempty"` // 标记为最终卷
	Arcs  []ArcOutline `json:"arcs"`
}

VolumeOutline 卷级大纲(长篇分层模式)。

func (*VolumeOutline) IsExpanded added in v0.0.2

func (v *VolumeOutline) IsExpanded() bool

IsExpanded 判断卷是否已展开(有弧级结构)。

type VolumeSummary

type VolumeSummary struct {
	Volume    int      `json:"volume"`
	Title     string   `json:"title"`
	Summary   string   `json:"summary"`
	KeyEvents []string `json:"key_events"`
}

VolumeSummary 卷级摘要,卷结束时生成。

type WorldRule

type WorldRule struct {
	Category string `json:"category"` // magic / technology / geography / society / other
	Rule     string `json:"rule"`     // 规则描述
	Boundary string `json:"boundary"` // 不可违反的边界
}

WorldRule 世界观规则条目。

type WritingStyleRules added in v0.0.2

type WritingStyleRules struct {
	Volume    int              `json:"volume"`
	Arc       int              `json:"arc"`
	Prose     []string         `json:"prose"`      // 3-5 条叙述风格规则,每条 ≤50 字
	Dialogue  []CharacterVoice `json:"dialogue"`   // 角色对话风格规则
	Taboos    []string         `json:"taboos"`     // 禁忌清单
	UpdatedAt string           `json:"updated_at"` // ISO8601 时间戳
}

WritingStyleRules 从已写章节中提炼的写作规则,弧边界时由 Editor 生成。 取代原文片段(style_anchors / voice_samples),用规则替代搬运原文。

Jump to

Keyboard shortcuts

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