Просмотр исходного кода

docs: add interactive fiction branch workflow

Ma 7 месяцев назад
Родитель
Сommit
e7d86d593b
2 измененных файлов с 56 добавлено и 2 удалено
  1. 28 1
      README.en.md
  2. 28 1
      README.md

+ 28 - 1
README.en.md

@@ -343,10 +343,33 @@ inkos agent "Create a progression fantasy about a mage who can only use one spel
 
 ## CLI Reference
 
+### Interactive Fiction V1
+
+InkOS now supports an `interactive-tree` narrative mode:
+
+- chapters are still written through the normal `write next` flow
+- each completed chapter generates 2-4 reader-facing branch choices
+- the selected branch continues writing
+- unselected branches remain recoverable in `story/interactive/branch-tree.json`
+
+Minimal flow:
+
+```bash
+inkos book create --title "Branch Book" --genre other --platform tomato --narrative-mode interactive-tree
+inkos write next my-book
+inkos branch choices my-book
+inkos branch choose my-book <choice-id>
+inkos write next my-book
+inkos branch tree my-book
+inkos branch switch my-book <node-id>
+```
+
+`interactive-tree` v1 is chapter-end branching only for now. Free-form player actions are out of scope, and `export` / `review` still operate on the active branch by default.
+
 | Command | Description |
 |---------|-------------|
 | `inkos init [name]` | Initialize project (omit name to init current directory) |
-| `inkos book create` | Create a new book (`--genre`, `--chapter-words`, `--target-chapters`, `--brief <file>`, `--lang en/zh`) |
+| `inkos book create` | Create a new book (`--genre`, `--chapter-words`, `--target-chapters`, `--brief <file>`, `--lang en/zh`, `--narrative-mode linear/interactive-tree`) |
 | `inkos book update [id]` | Update book settings (`--chapter-words`, `--target-chapters`, `--status`, `--lang`) |
 | `inkos book list` | List all books |
 | `inkos book delete <id>` | Delete a book and all its data (`--force` to skip confirmation) |
@@ -362,6 +385,10 @@ inkos agent "Create a progression fantasy about a mage who can only use one spel
 | `inkos review list [id]` | Review drafts |
 | `inkos review approve-all [id]` | Batch approve |
 | `inkos status [id]` | Project status |
+| `inkos branch tree [id]` | Show the interactive branch tree |
+| `inkos branch choices [id]` | Show pending choices on the active branch |
+| `inkos branch choose [id] <choice-id>` | Choose one pending branch option |
+| `inkos branch switch [id] <node-id>` | Switch to an existing branch and restore its snapshot |
 | `inkos export [id]` | Export book (`--format txt/md/epub`, `--output <path>`, `--approved-only`) |
 | `inkos fanfic init` | Create a fanfic book from source material (`--from`, `--mode canon/au/ooc/cp`) |
 | `inkos config set-global` | Set global LLM config (~/.inkos/.env) |

+ 28 - 1
README.md

@@ -331,10 +331,33 @@ inkos agent "先扫描市场趋势,然后根据结果创建一本新书"
 
 ## 命令参考
 
+### Interactive Fiction V1
+
+InkOS 现在支持 `interactive-tree` 叙事模式:
+
+- 章节仍然按正常 `write next` 生成
+- 每章结束后会自动生成 2-4 个读者选项
+- 选中的分支继续写下一章
+- 未选分支会保存在 `story/interactive/branch-tree.json`,后续可切回
+
+最小流程:
+
+```bash
+inkos book create --title "分支书" --genre other --platform tomato --narrative-mode interactive-tree
+inkos write next my-book
+inkos branch choices my-book
+inkos branch choose my-book <choice-id>
+inkos write next my-book
+inkos branch tree my-book
+inkos branch switch my-book <node-id>
+```
+
+`interactive-tree` v1 当前只做章节末分支,不支持自由输入动作;`export` / `review` 默认仍只看当前 active branch。
+
 | 命令 | 说明 |
 |------|------|
 | `inkos init [name]` | 初始化项目(省略 name 在当前目录初始化) |
-| `inkos book create` | 创建新书(`--genre`、`--platform`、`--chapter-words`、`--target-chapters`、`--brief <file>` 传入创作简报) |
+| `inkos book create` | 创建新书(`--genre`、`--platform`、`--chapter-words`、`--target-chapters`、`--brief <file>`、`--narrative-mode linear/interactive-tree`) |
 | `inkos book update [id]` | 修改书设置(`--chapter-words`、`--target-chapters`、`--status`) |
 | `inkos book list` | 列出所有书籍 |
 | `inkos book delete <id>` | 删除书籍及全部数据(`--force` 跳过确认) |
@@ -350,6 +373,10 @@ inkos agent "先扫描市场趋势,然后根据结果创建一本新书"
 | `inkos review list [id]` | 审阅草稿 |
 | `inkos review approve-all [id]` | 批量通过 |
 | `inkos status [id]` | 项目状态 |
+| `inkos branch tree [id]` | 查看互动分支树 |
+| `inkos branch choices [id]` | 查看当前 active branch 的待选项 |
+| `inkos branch choose [id] <choice-id>` | 选择一个待选分支 |
+| `inkos branch switch [id] <node-id>` | 切换到已有分支并恢复对应快照 |
 | `inkos export [id]` | 导出书籍(`--format txt/md/epub`、`--output <path>`、`--approved-only`) |
 | `inkos radar scan` | 扫描平台趋势 |
 | `inkos fanfic init` | 从原作素材创建同人书(`--from`、`--mode canon/au/ooc/cp`) |