Files
Genarrative/server-rs/packages/module-story/README.md

31 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# module-story 独立模块 package 占位说明
日期:`2026-04-20`
## 1. package 职责
`module-story` 是故事主循环模块 package后续负责
1. `story_session``story_event` 等故事会话状态模型
2. story action 主循环与状态推进规则
3. `currentStory`、story state、兼容视图模型的模块级拼装
4.`apps/api-server` 的 story facade 与 SSE 输出对接
5.`apps/spacetime-module` 的 story 表、reducer、view 聚合对接
## 2. 当前阶段说明
当前提交仅完成目录占位,不提前进入 reducer、view 与 SSE 兼容实现。
后续与本 package 直接相关的任务包括:
1. 设计 `story_session``story_event`
2. 设计 `resolve_story_action``continue_story``begin_story_session`
3. 对齐 `RuntimeStoryActionResponse``RuntimeStoryOptionView`
4. 落地 `/api/runtime/story/*` 兼容链路
## 3. 边界约束
1. `module-story` 负责故事状态真相与主循环规则,不把外部 LLM、OSS、短信、微信等副作用塞进模块内部。
2. 流式文本输出与 HTTP 协议兼容由 `apps/api-server` 暴露,但阶段状态与故事真相必须回写到 `apps/spacetime-module` 聚合的状态模型中。
3. 跨模块联动通过明确的 reducer 与模块边界协作,不回到单大 service 直接改整包 JSON 的旧实现方式。