@apprun/shiqu 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -0
- package/README.md +67 -4
- package/data/export-fonts/NotoSansCJKsc-Regular.otf +0 -0
- package/data/export-fonts/OFL.txt +92 -0
- package/data/export-fonts/README.md +8 -0
- package/dist/client/assets/{es-BsDtWQCI.js → es-DlNSYSrl.js} +1 -1
- package/dist/client/assets/index-BBpP1F_U.js +17 -0
- package/dist/client/assets/index-BOFTbC7e.css +1 -0
- package/dist/client/assets/reader-pdf-Dcx6AQ3i.js +4 -0
- package/dist/client/assets/reader-png-B6Cj2Di0.js +1 -0
- package/dist/client/assets/reader-zip-hDWZbXX9.js +16 -0
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +5229 -2329
- package/drizzle/0011_publication_defaults.sql +5 -0
- package/drizzle/0012_generation_authorization.sql +111 -0
- package/drizzle/0013_reader_state_transitions.sql +132 -0
- package/drizzle/0014_reader_input_identity.sql +2 -0
- package/drizzle/0015_image_fault_checkpoints.sql +28 -0
- package/drizzle/0016_legacy_input_faults.sql +2 -0
- package/drizzle/0017_command_receipt_links.sql +51 -0
- package/package.json +10 -1
- package/skills/shiqu/SKILL.md +72 -0
- package/dist/client/assets/index-BXhJYqND.js +0 -15
- package/dist/client/assets/index-CTBPjFtm.css +0 -1
- package/dist/client/assets/reader-pdf-DrQyHCbD.js +0 -4
- package/dist/client/assets/reader-png-Btyp3Ok6.js +0 -1
- package/dist/client/assets/reader-zip-BSWjbJfH.js +0 -5
package/NOTICE
CHANGED
|
@@ -17,6 +17,9 @@ upstream contributors are credited in the catalog and original downloads.
|
|
|
17
17
|
Project Gutenberg downloads retain their own accompanying notices and terms.
|
|
18
18
|
|
|
19
19
|
Third-party dependency license texts and notices remain applicable. The
|
|
20
|
+
CLI offline exporter bundles Noto Sans CJK SC under the SIL Open Font License;
|
|
21
|
+
see data/export-fonts/OFL.txt and data/export-fonts/README.md.
|
|
22
|
+
The
|
|
20
23
|
Standard desktop edition also includes the Node.js distribution's LICENSE
|
|
21
24
|
alongside the bundled Node executable.
|
|
22
25
|
|
package/README.md
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Turn Chinese classics into your own illustrated storybooks. Read in your browser, generate with a logged-in Codex CLI, OpenAI API, or Gemini, and keep stories, images, and reading progress on your computer.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Choose how to use Shiqu
|
|
6
6
|
|
|
7
|
-
**Choose the desktop app for
|
|
7
|
+
**Choose the desktop app for graphical use, the Codex skill to delegate tasks in natural language, or the CLI for direct commands and scripted startup.**
|
|
8
8
|
|
|
9
9
|
| Your situation | Recommended entry point |
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| You want graphical settings, library and queue management, and no separate Node installation | Desktop app: includes Node 24 and service controls |
|
|
12
|
+
| You want Codex to create, edit, export, or maintain stories without a server | Install the Shiqu skill and invoke `$shiqu`; requires Node 24 |
|
|
12
13
|
| You already have Node 24 and want one-command startup without installing a desktop app | CLI: `npx @apprun/shiqu`; keep the terminal running and press Ctrl+C to stop |
|
|
13
14
|
| You want generation and reading access to continue after closing the control window | Desktop app: stays in the system tray until you stop the service or quit the app |
|
|
14
15
|
| You need startup parameters, environment overrides, or non-interactive operation | CLI: prepare provider configuration and a library path in advance |
|
|
@@ -16,7 +17,7 @@ Turn Chinese classics into your own illustrated storybooks. Read in your browser
|
|
|
16
17
|
| You want phone access on the same Wi-Fi | Both entries: CLI prints phone QR codes on startup; desktop shows them in its control window |
|
|
17
18
|
| You need built-in internet tunnel controls | Desktop app: requires a separate cloudflared installation. CLI has no built-in internet tunnel |
|
|
18
19
|
|
|
19
|
-
**Shared features:** Both entry points provide the same browser interface for story creation, production and acceptance requirements, generation queues, pause/resume, reading, library organization, and PDF / PNG / ZIP export. The desktop window adds library, queue, settings, and service controls;
|
|
20
|
+
**Shared features:** Both entry points provide the same browser interface for story creation, production and acceptance requirements, generation queues, pause/resume, reading, library organization, and PDF / PNG / ZIP export. The desktop window adds library, queue, settings, and service controls; interactive reading and story creation happen in the browser. The Codex skill uses CLI subcommands for production, editing, library maintenance, and offline exports without a running service. Both support OpenAI API, Gemini, and read-only mode. Codex generation is supported on macOS / Linux and requires a separately installed, logged-in Codex CLI; the Shiqu CLI and Codex CLI are different tools.
|
|
20
21
|
|
|
21
22
|
**Shared settings and data:** Under the same local user account, both entry points reuse saved provider settings and API keys. With the same library directory, they share stories, images, and reading progress. Neither requires the other to be running.
|
|
22
23
|
|
|
@@ -28,6 +29,62 @@ Turn Chinese classics into your own illustrated storybooks. Read in your browser
|
|
|
28
29
|
|
|
29
30
|
**Only one service can run against a library at a time, even on different ports.** Switching entry points needs no data copy. Choosing another directory opens another library; it does not move or merge data. Back up before upgrading or downgrading, as older versions may not read newer settings or data. See the [full user guide](https://github.com/yysun/shiqu/blob/main/.docs/user-guide.md).
|
|
30
31
|
|
|
32
|
+
## Use Shiqu through Codex
|
|
33
|
+
|
|
34
|
+
Install the bundled skill once, then ask Codex to perform Shiqu tasks in natural language. The skill defines data contracts, business rules, and acceptance criteria. Codex can write task-specific programs for filtering, comparison, reports, and batch orchestration; saved-state changes, generation, review, and exports use Shiqu's existing production implementation.
|
|
35
|
+
|
|
36
|
+
See the [prompt-only Use as SKILL guide](https://github.com/yysun/shiqu/blob/main/.docs/use-as-skill.md) for copyable requests covering setup, provider/model configuration, creation and editing, exports, batch tasks, recovery, and diagnostics.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx @apprun/shiqu skill install --scope global
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Global installation copies the skill to `~/.agents/skills/shiqu/SKILL.md` for use across projects. For one project, run `skill install --scope project` in that directory; it writes `.agents/skills/shiqu/SKILL.md` there. Both scopes copy independent files, reject symlinks and different existing instructions, and require an explicit scope. Installing a skill does not start a server, initialize or move a library, or globally install the CLI executable.
|
|
43
|
+
|
|
44
|
+
In Codex, invoke the skill with a request such as:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
$shiqu Find a story about kindness and misunderstanding in Zhuangzi.
|
|
48
|
+
Use Chinese ink painting and balanced narrative detail. Show candidates and a production plan first;
|
|
49
|
+
wait for my confirmation before generating illustrations, then export an offline preview and public ZIP.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Specify the library, output directory, and author credit in your request. Codex queries the selected CLI version's help and chooses operations from saved state. Simple tasks can call the CLI directly; generated programs use argument arrays and JSON input without modifying SQLite or reimplementing generation or exports. Shiqu uses its saved generation provider and credentials. Library commands automatically create the directory and initialize the database on first access using the same startup/migration path as desktop and server; no separate init step is required. Configure a provider first if needed. Stop any service using the same library before running headless commands. Only explicit run performs inference; edits, inspection, preview and export do not start background generation.
|
|
53
|
+
|
|
54
|
+
`skill show` prints the instructions without installing them. If a new skill does not appear in Codex, restart Codex. The copied skill does not pin the CLI runtime: use `npx @apprun/shiqu@VERSION` when a fixed version is required. Use `skill check` to report npm release updates (cached for 24 hours), `skill check --auto-update on|off` to save your preference, and a fixed-version `skill update --scope global|project` to copy that CLI package’s bundled skill. Automatic updates are off by default: Codex applies the returned pinned command only after opt-in, without overriding explicit or project-pinned versions. Installation state records version and content hash; local edits, unknown copies, unsupported state and downgrades are refused. Legacy copies can be registered by reinstalling their matching package only when their contents match. Offline checks retain the existing version. No background updater is installed.
|
|
55
|
+
|
|
56
|
+
### Direct headless commands
|
|
57
|
+
|
|
58
|
+
With no subcommand, Shiqu starts the existing browser service. Subcommands operate directly on the production workflow without HTTP, desktop, or frontend:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx @apprun/shiqu help --json
|
|
62
|
+
npx @apprun/shiqu stories list --data-dir /private/shiqu-library
|
|
63
|
+
npx @apprun/shiqu run STORY_ID --until reviewed --data-dir /private/shiqu-library
|
|
64
|
+
npx @apprun/shiqu preview STORY_ID --data-dir /private/shiqu-library --output /private/preview.html
|
|
65
|
+
npx @apprun/shiqu export STORY_ID --data-dir /private/shiqu-library --format zip --output /private/story.zip
|
|
66
|
+
npx @apprun/shiqu skill show
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Use `help --json` for command inputs and effects. Subcommands return one JSON receipt on stdout, logs on stderr, and nonzero exit codes on errors. The exception is skill show, which prints Markdown unless --json is supplied. Only explicit run invokes inference, only for the specified story. Saving, editing, confirmation, inspection and export do not start background generation. Read reason/session before continuing; pauses/faults require explicit control/recovery. Intake mutations require explicit `--generation N` or input.generation from stories get. Retry/override require explicit faultId. Reuse the same request UUID and original generation/token/faultId and input for mutation replay; edits require the token from `stories revisions ID`.
|
|
70
|
+
|
|
71
|
+
Creation follows create → search → run until candidates → choose → run until prepared → confirm → run until reviewed or completed. Follow returned IDs and states. Complete ZIP/PDF/PNG exports require the current version and all images. Public ZIP is the default; internal prompts require `--include-prompts`. Unsigned export requires `--allow-unsigned`. Preview is escaped, self-contained HTML. Outputs must be new paths. Config reuses saved settings; keys go through input files/stdin, never argv.
|
|
72
|
+
|
|
73
|
+
`init` remains optional for explicit early initialization. Database creation follows --data-dir, SHIQU_DATA_DIR, saved location, then the default library; it does not configure a provider or start generation. Corrupt databases fail instead of being rebuilt. Backup requires an existing database. Help, catalogs, skill installation and diagnostic export do not create a library; restore still requires a new target directory.
|
|
74
|
+
|
|
75
|
+
To choose a database folder explicitly:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx @apprun/shiqu init --data-dir /absolute/path/my-library
|
|
79
|
+
npx @apprun/shiqu stories list --data-dir /absolute/path/my-library
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The argument is a directory: Shiqu creates it if needed and stores `shiqu.sqlite` and `media/` there. Existing data is retained. The command returns the resolved absolute path. This does not change the saved desktop/CLI default; reuse --data-dir or set SHIQU_DATA_DIR for later commands.
|
|
83
|
+
|
|
84
|
+
### Library maintenance
|
|
85
|
+
|
|
86
|
+
Maintenance is shared with desktop libraries: `shiqu --backup <new-directory>`, `shiqu --verify-backup <backup>`, `shiqu --restore <backup> --data-dir <new-library>`, and `shiqu --diagnostics <new-json-file>`. Stop all services before backup; diagnostics can be exported while running. Restore never overwrites an existing directory or starts generation. Backups include private story/media data, not the separate provider credentials. Existing libraries receive a verified sibling `library-backups/pre-upgrade-*` snapshot before new migrations; keep these private and restore with a matching application version. Diagnostic exports contain bounded allowlisted metadata, not prompts, keys, story text or raw provider responses.
|
|
87
|
+
|
|
31
88
|
## Run
|
|
32
89
|
|
|
33
90
|
Requires **Node 24** (recommended: 24.22.1) and its bundled npm / npx. No separate pnpm installation is needed:
|
|
@@ -86,10 +143,14 @@ No `.env` is loaded automatically. Existing shell variables beat the selected fi
|
|
|
86
143
|
2. After the original and a verified summary are ready, choose an art style and **brief / balanced / detailed** narrative detail. The frame estimate is not a fixed count: the model plans from the original, and review can add, remove, or replace frames before drawing.
|
|
87
144
|
3. Set production requirements for the adaptation and, optionally, acceptance requirements (one per line, up to 20). Start production explicitly. Review gives a verdict and evidence for each criterion; actionable failures enter repair, while conflicts or criteria that cannot be judged from the written storyboard stop drawing. Inspect the reason and revise the requirements rather than repeatedly resuming.
|
|
88
145
|
4. Production continues in the background after confirmation. Pause/resume controls are shared across windows. Automatic repair stops after 20 rounds or no effective change; inspect the saved issues, continue repair, or edit and save for a fresh review. Explicitly skipping issues is recorded and does not mean acceptance passed.
|
|
89
|
-
5. Read on your computer or phone. Rename a story independently without regenerating it. Once every illustration is ready, export PDF, a PNG overview, or a ZIP containing story JSON, storyboard Markdown,
|
|
146
|
+
5. Read on your computer or phone. Rename a story independently without regenerating it. Once every illustration is ready, export PDF, a PNG overview, or a ZIP containing story JSON, storyboard Markdown, source text, full-resolution WebP images, and saved prompt records. Exports do not make generation requests.
|
|
90
147
|
|
|
91
148
|
The production and acceptance editors let you inspect current system-rule previews, copy recorded actual prompts, and view saved acceptance results. Previews include unsaved edits and are not execution history; inherited records identify their source version, and missing historical records are not fabricated. Changing only acceptance requirements preserves the storyboard and reusable images for a new review; subsequent repair may still invalidate affected images. Written-storyboard acceptance is not a visual inspection of generated artwork. Prompt records may contain source text and custom requirements; check them before sharing.
|
|
92
149
|
|
|
150
|
+
Set default production credits, a public work link/contact, source licensing, and reuse conditions under **我的 → 署名与转载**, or edit one story under **故事设置**. New stories copy the defaults; each export also resolves blank fields against the latest defaults without rewriting the saved story. Explicit story fields win. Unsigned downloads require confirmation, including repeated downloads; a failed defaults read stops export rather than using stale information. WebP signature size is adjustable from 12–48 original-image pixels, defaulting to 24px; PDF/PNG layout and clean source images remain unchanged.
|
|
151
|
+
|
|
152
|
+
ZIPs include `提示词.md`, `提示词.json`, and `系统提示词.md`. Identical recorded system rules are stored once and referenced from individual calls; distinct historical rules and actual inputs are retained. The archive also preserves credits, AI disclosure, public WebP XMP, and image hashes for integrity checks, not proof of ownership. **Review the entire ZIP before sharing or submitting it:** prompt inputs and custom requirements are included by default. Reference images are represented by saved paths, not bundled files. Deduplication does not guarantee every text file fits a reading site's 1 MiB limit.
|
|
153
|
+
|
|
93
154
|
Use the star button on an illustrated page to select **one reference image per book**, separate from the bookmark for story favorites. Later image requests for that book, including a new story's first frame, prefer the star; without it, later frames use their own story's first image. Replacing or removing the star does not redraw saved images or change requests already in flight.
|
|
94
155
|
|
|
95
156
|
See the [full creation and reading guide](https://github.com/yysun/shiqu/blob/main/.docs/user-guide.md#制作与阅读故事). Generation uses your configured provider's quota or API billing; quality and completeness still need human review.
|
|
@@ -129,6 +190,8 @@ Older CLI releases used `shiqu/library` rather than `com.shiqu.desktop/library`
|
|
|
129
190
|
|
|
130
191
|
Version 0.6.0 migrates legacy summary fields and adds book-reference storage without regenerating existing stories. Back up the entire stopped library before upgrading, refresh old browser tabs, and keep CLI and desktop versions matched. Older binaries may not read the upgraded schema; restore a pre-upgrade backup when rolling back.
|
|
131
192
|
|
|
193
|
+
Version 0.6.5 adds default publication settings without rewriting existing stories or images. Stop all services using the library and back it up before upgrading; refresh browser tabs afterward. ZIP exports now include saved prompts and custom requirements by default, so check the contents again before sharing. Missing historical prompt records are not reconstructed.
|
|
194
|
+
|
|
132
195
|
The CLI listens on `0.0.0.0` by default and prints LAN URLs and phone QR codes when a network interface is available. Every connected device shares the library and generation permissions; use a trusted LAN. Use `--host 127.0.0.1` (or `SHIQU_BIND_IP=127.0.0.1`) for local-only access without phone QR codes. Keep the computer awake while reading from a phone. This CLI does not provide the desktop app's internet tunnel or native control window.
|
|
133
196
|
|
|
134
197
|
## Sources and license
|
|
Binary file
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
This Font Software is licensed under the SIL Open Font License,
|
|
2
|
+
Version 1.1.
|
|
3
|
+
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
-----------------------------------------------------------
|
|
8
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
9
|
+
-----------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
PREAMBLE
|
|
12
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
13
|
+
development of collaborative font projects, to support the font
|
|
14
|
+
creation efforts of academic and linguistic communities, and to
|
|
15
|
+
provide a free and open framework in which fonts may be shared and
|
|
16
|
+
improved in partnership with others.
|
|
17
|
+
|
|
18
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
19
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
20
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
21
|
+
redistributed and/or sold with any software provided that any reserved
|
|
22
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
23
|
+
however, cannot be released under any other type of license. The
|
|
24
|
+
requirement for fonts to remain under this license does not apply to
|
|
25
|
+
any document created using the fonts or their derivatives.
|
|
26
|
+
|
|
27
|
+
DEFINITIONS
|
|
28
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
29
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
30
|
+
include source files, build scripts and documentation.
|
|
31
|
+
|
|
32
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
33
|
+
copyright statement(s).
|
|
34
|
+
|
|
35
|
+
"Original Version" refers to the collection of Font Software
|
|
36
|
+
components as distributed by the Copyright Holder(s).
|
|
37
|
+
|
|
38
|
+
"Modified Version" refers to any derivative made by adding to,
|
|
39
|
+
deleting, or substituting -- in part or in whole -- any of the
|
|
40
|
+
components of the Original Version, by changing formats or by porting
|
|
41
|
+
the Font Software to a new environment.
|
|
42
|
+
|
|
43
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
44
|
+
writer or other person who contributed to the Font Software.
|
|
45
|
+
|
|
46
|
+
PERMISSION & CONDITIONS
|
|
47
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
48
|
+
a copy of the Font Software, to use, study, copy, merge, embed,
|
|
49
|
+
modify, redistribute, and sell modified and unmodified copies of the
|
|
50
|
+
Font Software, subject to the following conditions:
|
|
51
|
+
|
|
52
|
+
1) Neither the Font Software nor any of its individual components, in
|
|
53
|
+
Original or Modified Versions, may be sold by itself.
|
|
54
|
+
|
|
55
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
56
|
+
redistributed and/or sold with any software, provided that each copy
|
|
57
|
+
contains the above copyright notice and this license. These can be
|
|
58
|
+
included either as stand-alone text files, human-readable headers or
|
|
59
|
+
in the appropriate machine-readable metadata fields within text or
|
|
60
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
61
|
+
|
|
62
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
63
|
+
Name(s) unless explicit written permission is granted by the
|
|
64
|
+
corresponding Copyright Holder. This restriction only applies to the
|
|
65
|
+
primary font name as presented to the users.
|
|
66
|
+
|
|
67
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
68
|
+
Software shall not be used to promote, endorse or advertise any
|
|
69
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
70
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
71
|
+
permission.
|
|
72
|
+
|
|
73
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
74
|
+
must be distributed entirely under this license, and must not be
|
|
75
|
+
distributed under any other license. The requirement for fonts to
|
|
76
|
+
remain under this license does not apply to any document created using
|
|
77
|
+
the Font Software.
|
|
78
|
+
|
|
79
|
+
TERMINATION
|
|
80
|
+
This license becomes null and void if any of the above conditions are
|
|
81
|
+
not met.
|
|
82
|
+
|
|
83
|
+
DISCLAIMER
|
|
84
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
85
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
86
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
87
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
88
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
89
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
90
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
91
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
92
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Offline export font
|
|
2
|
+
|
|
3
|
+
`NotoSansCJKsc-Regular.otf` is the Noto CJK Simplified Chinese regular font from
|
|
4
|
+
https://github.com/notofonts/noto-cjk/tree/main/Sans/OTF/SimplifiedChinese.
|
|
5
|
+
Its SIL Open Font License is retained in `OFL.txt`.
|
|
6
|
+
|
|
7
|
+
The CLI registers this bundled font for Chinese export text so offline ZIP watermarks,
|
|
8
|
+
PDF and PNG do not depend on an operating system's installed CJK fonts.
|