Skip to content
dsh.fish
Bundle

dsh-novel-craft

小说创作插件:五维角色卡 + 状态包跨章一致性 + 写作规范注入 + 余额/消耗/峰谷监控

Source
winston-hoo
stars
1 stars
License
MIT
Updated
Updated 5 days ago

Readme

# dsh-novel-craft — 小说创作插件(DeepSeek Harness)

基于 DeepSeek Harness(dsh)的小说创作插件:**结构化管理角色/世界观 → 状态包跨章一致性 → 按写作规范驱动写稿 → 自动沉淀稿库 + 余额/消耗/峰谷监控**。

写作规范与长篇状态管理借鉴 [story-craft](https://github.com/deepseek-ai) 的方法论;余额/消耗/峰谷定价对齐 [DeepSeek-Balance-Whale-Widget](https://github.com/MeteorNOX/DeepSeek-Balance-Whale-Widget)。

## 功能

| 能力 | 工具 |
|---|---|
| 建项目 | `novel_create_project` |
| 建/改角色卡(五维模板 + S/A/B/C 分级) | `novel_upsert_character` |
| 角色摘要 / 单卡全文 | `novel_list_characters` · `novel_get_character` |
| **状态包注入**(写作规范 + 事实 + 伏笔 + 角色状态 + 钩子 + 剧情线) | `novel_get_state` |
| **状态回写**(`state/` 五文件) | `novel_update_state` |
| 写/追加章节 + 自动字数索引 | `novel_write_chapter` |
| 余额 + 峰谷时段 | `novel_balance` |
| 今日消耗 + 台账 | `novel_usage` |

写作时自动注入反 AI 味规范(13 类禁用模式)与体裁风格取向;每次回合消耗按峰谷定价自动累计。

## 安装

```bash
dsh plugin --profile headless add github:<你的GitHub>/dsh-novel-craft
```

> 仅依赖 dsh 宿主的 peer 依赖(cordis/schemastery/dsh-tools/dsh-session),无需额外安装包。

## 使用(示例)

```bash
# 设模型 key(余额/消耗需要)
dsh plugin --profile headless ... # 或直接在环境配置 DEEPSEEK_API_KEY

dsh --profile headless "用 novel_create_project 新建《多赢人生》(都市),再按状态包流程写第1章"
```

建议每章一个任务:`get_state →(按需 get_character)→ write_chapter → update_state`,状态包让第 N 章与第 1 章保持一致,单章成本恒定。

## 稿库结构

```
<outDir>/(缺省 ~/.dsh/novel)
├── project.json
├── characters/<roleId>.md
├── chapters/{0xx.md, index.json}
├── state/{established-facts.md, foreshadows.json, character-state.md, next-hook.md, arc-status.md}
└── usage.json   # 消耗台账(峰谷定价)
```

## 定价与峰谷(对齐 DeepSeek 官方)

- 高峰:工作日 9:00–12:00 / 14:00–18:00(北京);2026-08-23 起周末全天谷价。
- `flash` 系:输入未命中 1.5(谷)/3.0(峰)元-百万 token;命中 0.05/0.1;输出 4.5/9.0。`v4-pro` 为其 3 倍。
- 改价时编辑 `src/usage.ts` 顶部常量。

## 开发

```bash
pnpm install
pnpm run build     # tsc → lib/
```

## 许可

MIT © 2026 Winston

Install

dsh plugin --profile web add github:winston-hoo/dsh-novel-craft

Profile: web

  • This package builds from source on install. pnpm will ask you to allow its build script — that is permission to run the package’s code on your machine, outside the agent sandbox. Only allow sources you trust.
  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source