[PR #1704] [MERGED] feat: Story Writer, a co-writing book for long stories and fanfiction (0.1.0) #1700

Closed
opened 2026-10-27 06:05:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1704
Author: @SpicyMarinara
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/story-writer


📝 Commits (9)

  • c96ef1c feat(story-writer): add artwork and the shared story model (#1703)
  • 4a49524 feat(story-writer): a co-writing book for long stories and fanfiction (0.1.0)
  • a24ed32 Merge branch 'staging' into feat/story-writer
  • ac86044 fix(story-writer): review fixes for saving, prompts, reading and layout
  • 28cd613 fix(story-writer): retry saves on 408, 409 and 429 instead of dropping them
  • b5e829e chore(story-writer): record the Engine commit the package is built against
  • 736b35c fix(story-writer): address Dottore's review
  • 718c553 fix(story-writer): find a banned Latin word next to CJK text
  • 4d3d5fc Merge remote-tracking branch 'origin/staging' into feat/story-writer

📊 Changes

65 files changed (+13495 additions, -5 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+6 -0)
📝 README.md (+2 -1)
➕ artifacts/story-writer-0.1.0.zip (+0 -0)
📝 artwork/agent-covers/art-direction.json (+6 -0)
➕ artwork/agent-covers/story-writer.png (+0 -0)
➕ artwork/sources/story-writer-imagegen.png (+0 -0)
➕ artwork/sources/story-writer-imagegen.prompt.txt (+129 -0)
📝 catalog/catalog.json (+105 -0)
📝 catalog/notes.json (+10 -0)
📝 catalog/v2/catalog.json (+105 -0)
📝 catalog/v2/notes.json (+10 -0)
📝 catalog/v3/catalog.json (+105 -0)
📝 catalog/v3/notes.json (+10 -0)
📝 package.json (+2 -1)
➕ packages/story-writer/CHANGELOG.md (+12 -0)
➕ packages/story-writer/README.md (+215 -0)
➕ packages/story-writer/agents.json (+22 -0)
➕ packages/story-writer/client.js (+1514 -0)
➕ packages/story-writer/locales/en.json (+17 -0)
➕ packages/story-writer/manifest.json (+95 -0)

...and 45 more files

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1703

Engine side: Pasta-Devs/Marinara-Engine#8341 (capability API 1.386), which must merge first.

Why this change

  • People want the model to write fanfiction and other long texts for them, with their only input being guiding notes. Chat modes are built around turns and bubbles, which make a long, chaptered story awkward. Story Writer is a separate co-writing experience for this, with its own settings and its own prompt.

What changed

  • New package story-writer 0.1.0: a Story Writer tab in Home, with a book icon. It opens a full-page co-writing book.
  • Look:
    • an open antique book on a dark wooden desk, or an e-book reader;
    • light or dark mode, or follow the app;
    • your choice of font, color and size;
    • Markdown, including italics, bold and *** scene breaks.
  • Writing: pick a connection, the characters, personas and lorebooks, and describe the story. Write next chapter streams the chapter onto the page, or shows it all at once with streaming off.
    • The book turns its pages with a flip animation as text fills them; the e-book slides sideways.
    • Arrows, keys, swipes and the table of contents move through pages and chapters.
  • Editing: click anywhere to edit, including the empty first page, to start the story or a new chapter yourself. Write then continues it.
  • Sidebar: opens from an arrow tab on the left or right edge and is styled to match the theme. It holds:
    • your stories;
    • story details: overview, fandom, genre, rating, relationships, warnings, tags, author style, narration style, language and story notes;
    • cast and world;
    • writing: connection with an Edit connection button, chapter length, story length target, chapter titles, continue message (Continue.), prompt (the requested default) and banned phrases (ozone, jaws working, Elara);
    • author tools: chapter summaries, "keep the last N chapters in full", auto-summarize, and a timeline the model follows, which it can fill or update after each chapter;
    • appearance.
  • Author's note: a sticky note in the top left or right corner rolls out to hold the instructions for the next chapter. Like Roleplay's Author's Notes, it is injected as a user message at a depth. The default 0 puts it right before the continue message.
  • What the model is sent:
    • one system prompt with the prompt, details, overview, activated lorebook entries (from the Engine's own scanner), characters, personas, notes, timeline, summaries of older chapters, length and pacing, banned phrases, language and formatting;
    • then the chapters as assistant messages, each after the user's request;
    • then the continue message.
  • Stories: every story saves itself on the Engine server. Start new ones, duplicate or delete them, return to any of them from Your stories, and download them as Markdown or plain text. Save now, or Ctrl/Cmd+S, flushes pending saves.
  • Buttons:
    • Stop;
    • Continue the last chapter;
    • Rewrite it, after a confirm;
    • Finish chapter, for a draft that is done;
    • fullscreen;
    • a word count with target progress.
  • Phones: portrait shows a single page; landscape shows the two-page spread with an upright button bar.
  • Catalog and docs: in the normal catalog lanes (42 packages), with README rows and counts, catalog guidance, cover art, CHANGELOG and a user guide (packages/story-writer/README.md).

Package and security impact

  • Affected package IDs: story-writer (new).
  • Engine compatibility impact: needs Engine capability API 1.386 (openConnection on the Home browser view, and debugMode on /api/generate/raw), with Engine >= 2.5.1 < 4.0.0. Engines without 1.386 do not install it.
  • New or changed permissions/entrypoints: routes, storage and ui, with a client entrypoint and a server entrypoint.
    • Server: about 13 KB. Story documents only, through api.runtime.persistence.documents, under /api/story-writer. Inputs are normalized and size-limited, ids are validated, and chapter ownership is checked.
    • Client: about 200 KB, light DOM. It bundles only lucide-react. Its CSS is scoped to marinara-capability-story-writer. Its Markdown renderer escapes all HTML before adding markup. It never writes the Engine's browser storage.
    • Generation: goes through the Engine's existing /api/generate/raw with the user's selected connection. The package never sees credentials.
  • Restart, storage, update, or uninstall impact:
    • restartRequired: true, because the package adds routes.
    • Stories live in the Engine's capability_documents. Uninstall keeps them, as with other packages.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Run by the agent against Engine branch feat/story-writer-host (#8341):

  • npm run check, node scripts/typecheck-packages.mjs story-writer, node scripts/test-catalog-lanes.mjs, node scripts/validate-package-locales.mjs, node scripts/validate-package-locale-keys.mjs, node scripts/validate-catalog.mjs, node scripts/tests/catalog-release-notes.regression.mjs and git diff --check all pass. A rebuild of story-writer reproduces the committed outputs byte for byte.
  • npx tsx tests/story-writer-{store,prompt,markdown,reader-layout}.regression.ts: 39 tests pass. They cover the server store, prompt assembly including author's-note depth and size caps, Markdown escaping and round trips, and reader geometry.
  • node scripts/run-package-browser-tests.mjs story-writer tests/package-story-writer.e2e.ts passes on desktop and phone, with generation mocked at /api/generate/raw. It covers:
    • typing on the empty page through a failed create and a failed save;
    • the note at depth 0 in the request;
    • a streamed chapter spanning pages, and the page arrows;
    • dark mode and the e-book theme;
    • the library, a Markdown download, new and old stories;
    • Edit connection returning to the tab;
    • portrait and landscape layouts, including that the note never covers the Write button.
  • A six-lens adversarial review (persistence, generation, reader, security, requirements, host contract) found 19 issues, all confirmed and fixed in this PR. Local CodeRabbit: see the latest PR comment.

To verify by hand in a real Engine with a real connection:

  • Manually verify installing Story Writer from Agents → Download Agents on Engine staging with #8341, restarting, and opening Home → Story Writer.
  • Manually verify writing a few chapters with a real model, streaming on and off, and that Stop keeps what was written as a draft.
  • Manually verify that the page-flip animation looks right on desktop, and on a real phone in portrait (one page) and landscape (two pages).
  • Manually verify that editing anywhere, starting a chapter yourself, and Ctrl/Cmd+S all save, then reload and check that the text is still there.
  • Manually verify Edit connection opens the editor and closing it returns to Story Writer.
  • Manually verify summaries, Fill with AI for the timeline, and a story length target with a real model.
  • Manually verify uninstall keeps your stories, and reinstalling shows them again.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

The user guide is packages/story-writer/README.md. The Engine reference entry and the 1.386 developer docs are in #8341, with translations tracked in Pasta-Devs/Marinara-Engine#8342.

UI evidence (if applicable)

Screenshots come from the agent's Playwright run (desktop at 1440×900, Pixel 7): the open book, dark mode, the e-book, the sticky note with depth, the library, and phone portrait and landscape.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1704 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/story-writer` --- ### 📝 Commits (9) - [`c96ef1c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c96ef1c62e689d60c8d97ce46ada59fb24ebe895) feat(story-writer): add artwork and the shared story model (#1703) - [`4a49524`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4a49524529521b9a11f445c0c896af5f7509a639) feat(story-writer): a co-writing book for long stories and fanfiction (0.1.0) - [`a24ed32`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a24ed32004b7443733b00145b9c08762407d6bb5) Merge branch 'staging' into feat/story-writer - [`ac86044`](https://github.com/Pasta-Devs/Marinara-Agents/commit/ac860442a5397c76194fff814fa0607dc00f5867) fix(story-writer): review fixes for saving, prompts, reading and layout - [`28cd613`](https://github.com/Pasta-Devs/Marinara-Agents/commit/28cd613bbfcf1f55982867963e1468650595edb5) fix(story-writer): retry saves on 408, 409 and 429 instead of dropping them - [`b5e829e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b5e829ecab056714cb3e1c9b156653d6220c68d2) chore(story-writer): record the Engine commit the package is built against - [`736b35c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/736b35cfc2504d5af0c05df61c910f877c4a36ca) fix(story-writer): address Dottore's review - [`718c553`](https://github.com/Pasta-Devs/Marinara-Agents/commit/718c55325549eefa39ea5d1b96c755be628c22b0) fix(story-writer): find a banned Latin word next to CJK text - [`4d3d5fc`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4d3d5fc3181099fa6afec9909a447196d741599d) Merge remote-tracking branch 'origin/staging' into feat/story-writer ### 📊 Changes **65 files changed** (+13495 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+6 -0) 📝 `README.md` (+2 -1) ➕ `artifacts/story-writer-0.1.0.zip` (+0 -0) 📝 `artwork/agent-covers/art-direction.json` (+6 -0) ➕ `artwork/agent-covers/story-writer.png` (+0 -0) ➕ `artwork/sources/story-writer-imagegen.png` (+0 -0) ➕ `artwork/sources/story-writer-imagegen.prompt.txt` (+129 -0) 📝 `catalog/catalog.json` (+105 -0) 📝 `catalog/notes.json` (+10 -0) 📝 `catalog/v2/catalog.json` (+105 -0) 📝 `catalog/v2/notes.json` (+10 -0) 📝 `catalog/v3/catalog.json` (+105 -0) 📝 `catalog/v3/notes.json` (+10 -0) 📝 `package.json` (+2 -1) ➕ `packages/story-writer/CHANGELOG.md` (+12 -0) ➕ `packages/story-writer/README.md` (+215 -0) ➕ `packages/story-writer/agents.json` (+22 -0) ➕ `packages/story-writer/client.js` (+1514 -0) ➕ `packages/story-writer/locales/en.json` (+17 -0) ➕ `packages/story-writer/manifest.json` (+95 -0) _...and 45 more files_ </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1703 Engine side: Pasta-Devs/Marinara-Engine#8341 (capability API 1.386), which must merge first. ## Why this change - People want the model to write fanfiction and other long texts for them, with their only input being guiding notes. Chat modes are built around turns and bubbles, which make a long, chaptered story awkward. Story Writer is a separate co-writing experience for this, with its own settings and its own prompt. ## What changed - **New package `story-writer` 0.1.0:** a **Story Writer** tab in Home, with a book icon. It opens a full-page co-writing book. - **Look:** - an open antique book on a dark wooden desk, or an e-book reader; - light or dark mode, or follow the app; - your choice of font, color and size; - Markdown, including *italics*, **bold** and `***` scene breaks. - **Writing:** pick a connection, the characters, personas and lorebooks, and describe the story. **Write next chapter** streams the chapter onto the page, or shows it all at once with streaming off. - The book turns its pages with a flip animation as text fills them; the e-book slides sideways. - Arrows, keys, swipes and the table of contents move through pages and chapters. - **Editing:** click anywhere to edit, including the empty first page, to start the story or a new chapter yourself. **Write** then continues it. - **Sidebar:** opens from an arrow tab on the left or right edge and is styled to match the theme. It holds: - your stories; - story details: overview, fandom, genre, rating, relationships, warnings, tags, author style, narration style, language and story notes; - cast and world; - writing: connection with an **Edit connection** button, chapter length, story length target, chapter titles, continue message (`Continue.`), prompt (the requested default) and banned phrases (`ozone, jaws working, Elara`); - author tools: chapter summaries, "keep the last N chapters in full", auto-summarize, and a timeline the model follows, which it can fill or update after each chapter; - appearance. - **Author's note:** a sticky note in the top left or right corner rolls out to hold the instructions for the next chapter. Like Roleplay's Author's Notes, it is injected as a user message at a **depth**. The default 0 puts it right before the continue message. - **What the model is sent:** - one system prompt with the prompt, details, overview, activated lorebook entries (from the Engine's own scanner), characters, personas, notes, timeline, summaries of older chapters, length and pacing, banned phrases, language and formatting; - then the chapters as assistant messages, each after the user's request; - then the continue message. - **Stories:** every story saves itself on the Engine server. Start new ones, duplicate or delete them, return to any of them from **Your stories**, and download them as Markdown or plain text. **Save now**, or Ctrl/Cmd+S, flushes pending saves. - **Buttons:** - Stop; - Continue the last chapter; - Rewrite it, after a confirm; - Finish chapter, for a draft that is done; - fullscreen; - a word count with target progress. - **Phones:** portrait shows a single page; landscape shows the two-page spread with an upright button bar. - **Catalog and docs:** in the normal catalog lanes (42 packages), with README rows and counts, catalog guidance, cover art, CHANGELOG and a user guide (`packages/story-writer/README.md`). ## Package and security impact - Affected package IDs: `story-writer` (new). - Engine compatibility impact: needs Engine capability API **1.386** (`openConnection` on the Home browser view, and `debugMode` on `/api/generate/raw`), with Engine `>= 2.5.1 < 4.0.0`. Engines without 1.386 do not install it. - New or changed permissions/entrypoints: `routes`, `storage` and `ui`, with a client entrypoint and a server entrypoint. - **Server:** about 13 KB. Story documents only, through `api.runtime.persistence.documents`, under `/api/story-writer`. Inputs are normalized and size-limited, ids are validated, and chapter ownership is checked. - **Client:** about 200 KB, light DOM. It bundles only lucide-react. Its CSS is scoped to `marinara-capability-story-writer`. Its Markdown renderer escapes all HTML before adding markup. It never writes the Engine's browser storage. - **Generation:** goes through the Engine's existing `/api/generate/raw` with the user's selected connection. The package never sees credentials. - Restart, storage, update, or uninstall impact: - `restartRequired: true`, because the package adds routes. - Stories live in the Engine's `capability_documents`. Uninstall keeps them, as with other packages. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Run by the agent against Engine branch `feat/story-writer-host` (#8341): - `npm run check`, `node scripts/typecheck-packages.mjs story-writer`, `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-package-locales.mjs`, `node scripts/validate-package-locale-keys.mjs`, `node scripts/validate-catalog.mjs`, `node scripts/tests/catalog-release-notes.regression.mjs` and `git diff --check` all pass. A rebuild of `story-writer` reproduces the committed outputs byte for byte. - `npx tsx tests/story-writer-{store,prompt,markdown,reader-layout}.regression.ts`: 39 tests pass. They cover the server store, prompt assembly including author's-note depth and size caps, Markdown escaping and round trips, and reader geometry. - `node scripts/run-package-browser-tests.mjs story-writer tests/package-story-writer.e2e.ts` passes on desktop and phone, with generation mocked at `/api/generate/raw`. It covers: - typing on the empty page through a failed create and a failed save; - the note at depth 0 in the request; - a streamed chapter spanning pages, and the page arrows; - dark mode and the e-book theme; - the library, a Markdown download, new and old stories; - Edit connection returning to the tab; - portrait and landscape layouts, including that the note never covers the Write button. - A six-lens adversarial review (persistence, generation, reader, security, requirements, host contract) found 19 issues, all confirmed and fixed in this PR. Local CodeRabbit: see the latest PR comment. To verify by hand in a real Engine with a real connection: - Manually verify installing **Story Writer** from **Agents → Download Agents** on Engine staging with #8341, restarting, and opening **Home → Story Writer**. - Manually verify writing a few chapters with a real model, streaming on and off, and that **Stop** keeps what was written as a draft. - Manually verify that the page-flip animation looks right on desktop, and on a real phone in portrait (one page) and landscape (two pages). - Manually verify that editing anywhere, starting a chapter yourself, and Ctrl/Cmd+S all save, then reload and check that the text is still there. - Manually verify **Edit connection** opens the editor and closing it returns to Story Writer. - Manually verify summaries, **Fill with AI** for the timeline, and a story length target with a real model. - Manually verify uninstall keeps your stories, and reinstalling shows them again. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation The user guide is `packages/story-writer/README.md`. The Engine reference entry and the 1.386 developer docs are in #8341, with translations tracked in Pasta-Devs/Marinara-Engine#8342. ## UI evidence (if applicable) Screenshots come from the agent's Playwright run (desktop at 1440×900, Pixel 7): the open book, dark mode, the e-book, the sticky note with depth, the library, and phone portrait and landscape. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-27 06:05:57 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1700
No description provided.