@gongfpp/dsh-novel-fish 1.0.0 → 1.1.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/README.md +42 -14
- package/docs/community-markets.md +18 -1
- package/docs/compatibility-101.md +41 -0
- package/docs/ebook-tests.md +99 -0
- package/docs/evidence/reading-demo-110.png +0 -0
- package/docs/evidence/reading-two-expansions-110.gif +0 -0
- package/docs/evidence/reading-two-expansions-110.json +89 -0
- package/docs/evidence/samples-110-capture.json +49 -0
- package/docs/evidence/settings-110.png +0 -0
- package/docs/marketplace.md +4 -4
- package/docs/release.md +25 -0
- package/index.json +24 -0
- package/lib/client.js +523 -95
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +10 -9
- package/samples/ebooks/LICENSE.md +355 -0
- package/samples/ebooks/NOTICE.md +33 -0
- package/samples/ebooks/aq-zheng-zhuan-wikisource.md +998 -0
- package/samples/ebooks/million-pound-bank-note-pg61522.txt +6970 -0
- package/samples/ebooks/sources.json +58 -0
- package/scripts/build.mjs +1 -0
- package/scripts/check-host-contracts.mjs +3 -2
- package/scripts/make-readme-gif.mjs +69 -0
- package/scripts/test-browser-samples.mjs +665 -0
- package/scripts/test-candidate-books.mjs +71 -0
- package/scripts/test-ebook-corpus.mjs +161 -0
- package/src/bundled-books.js +42 -0
- package/src/chat-adapter.js +34 -9
- package/src/client.js +8 -2
- package/src/novel-content.js +8 -0
- package/src/persistence.js +144 -3
- package/src/pg-notice.js +19 -0
- package/src/segments.js +115 -65
- package/src/settings.js +32 -8
- package/src/store.js +61 -3
- package/test/bundled-library.test.js +526 -0
- package/test/chat-adapter.test.js +87 -2
- package/test/client.test.js +49 -7
- package/test/ebooks.test.js +192 -0
- package/test/pg-notice.test.js +109 -0
- package/test/release.test.js +21 -7
- package/test/segments.test.js +136 -2
- package/test/settings.test.js +42 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"verifiedOn": "2026-11-06",
|
|
3
|
+
"books": [
|
|
4
|
+
{
|
|
5
|
+
"id": "million-pound-bank-note",
|
|
6
|
+
"title": "百万英镑及其他新故事(英文)",
|
|
7
|
+
"author": "Mark Twain(马克·吐温,1835–1910)",
|
|
8
|
+
"format": "txt",
|
|
9
|
+
"file": "million-pound-bank-note-pg61522.txt",
|
|
10
|
+
"source": "https://www.gutenberg.org/ebooks/61522",
|
|
11
|
+
"download": "https://www.gutenberg.org/cache/epub/61522/pg61522.txt",
|
|
12
|
+
"bytes": 394538,
|
|
13
|
+
"sha256": "4f36f8ce3837afd6c28a23684153a946e39c8970a27486d36f6f4c64b92bb0d2",
|
|
14
|
+
"license": "Project Gutenberg License;1893 英文原作公版",
|
|
15
|
+
"edition": "Unmodified original download of the 1893 collection The £1,000,000 bank-note, and other new stories. Contains the full title story and eight other stories; not a standalone title-story edition.",
|
|
16
|
+
"redistribution": {
|
|
17
|
+
"status": "permitted-with-conditions",
|
|
18
|
+
"packageByDefault": true,
|
|
19
|
+
"license": "Project Gutenberg License, complete text retained in original TXT and LICENSE.md",
|
|
20
|
+
"licenseUrl": "https://www.gutenberg.org/policy/license.html",
|
|
21
|
+
"authorDeathYear": 1910,
|
|
22
|
+
"publicDomainBasis": "1893 English original, not a modern translation. PG lists public domain in the USA; author died in 1910. Check destination laws; not a worldwide legal warranty.",
|
|
23
|
+
"conditions": "Retain all PG header, credits, complete license and prominent §1.E.1 notice with immediate full-license access. Fee-bearing redistribution requires additional PG terms. Not MIT and not endorsed by PG."
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "aq-zheng-zhuan",
|
|
28
|
+
"title": "阿Q正传",
|
|
29
|
+
"author": "鲁迅(1881–1936)",
|
|
30
|
+
"format": "md",
|
|
31
|
+
"file": "aq-zheng-zhuan-wikisource.md",
|
|
32
|
+
"source": "https://zh.wikisource.org/wiki/阿Q正傳",
|
|
33
|
+
"download": "https://ws-export.wmcloud.org/?lang=zh&format=txt&page=%E9%98%BFQ%E6%AD%A3%E5%82%B3",
|
|
34
|
+
"bytes": 68170,
|
|
35
|
+
"sha256": "228f5e9504caecc97460e815461df7ac60de80ea311f289f7de23760c69c9643",
|
|
36
|
+
"license": "原作公版;数字导出声明 CC BY-SA 3.0 / GFDL,原样保留",
|
|
37
|
+
"edition": "Local Markdown derivative of the official Wikisource TXT export, 2026-11-06: only a Markdown title heading was prefixed; the complete original export remains byte-for-byte unchanged after the heading. Original Chinese (traditional characters), complete nine chapters from 第一章 序 to 第九章 大團圓, followed by source copyright notices, digital-edition license and all contributor credits. No modern translation or added commentary.",
|
|
38
|
+
"redistribution": {
|
|
39
|
+
"status": "permitted-with-conditions",
|
|
40
|
+
"packageByDefault": true,
|
|
41
|
+
"license": "Wikisource export states CC BY-SA 3.0 Unported or GFDL; retain the original notices and contributor list. Current source-site terms may additionally apply.",
|
|
42
|
+
"licenseUrl": "https://creativecommons.org/licenses/by-sa/3.0/",
|
|
43
|
+
"sourceSiteLicenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/",
|
|
44
|
+
"authorDeathYear": 1936,
|
|
45
|
+
"publicDomainBasis": "Original serialized 1921-12-04 through 1922-02-12, author died 1936. Source explicitly marks original public domain in China/Taiwan and the USA. This is not permission to copy protected modern commentary or translations; destination law still applies.",
|
|
46
|
+
"attribution": "魯迅; Wikisource contributors, complete contributor list retained at end of Markdown. Source/history: https://zh.wikisource.org/w/index.php?title=阿Q正傳&action=history .",
|
|
47
|
+
"conditions": "Keep full exported attribution, source and license links, applicable copyright notices and ShareAlike requirements; no DRM or additional restrictions. Only a Markdown heading added; full unchanged source export retained as the Markdown suffix, recoverable by removing the documented prefix. Not relicensed MIT."
|
|
48
|
+
},
|
|
49
|
+
"derivation": {
|
|
50
|
+
"originalFormat": "txt",
|
|
51
|
+
"originalBytes": 68156,
|
|
52
|
+
"originalSha256": "15a60f2d6e105c0869c4a11516eaba0d6726e6df68a91c40836dad51c1016b51",
|
|
53
|
+
"prefix": "# 阿Q正傳\n\n",
|
|
54
|
+
"modifications": "Prefixed one Markdown title heading only. Remove that UTF-8 prefix to recover the complete original official TXT export byte-for-byte; no text, source notices, licenses or contributor credits removed."
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
package/scripts/build.mjs
CHANGED
|
@@ -72,7 +72,8 @@ try {
|
|
|
72
72
|
url: 'http://host-contract.invalid/', runScripts: 'outside-only', pretendToBeVisual: true, virtualConsole,
|
|
73
73
|
})
|
|
74
74
|
Object.assign(dom.window, {
|
|
75
|
-
TextEncoder, TextDecoder,
|
|
75
|
+
TextEncoder, TextDecoder, URL, Blob, setImmediate, clearImmediate,
|
|
76
|
+
indexedDB: new IDBFactory(), IDBKeyRange,
|
|
76
77
|
fetch: () => { throw new Error('Network is forbidden in host-contract probe') },
|
|
77
78
|
console: { ...console, error: error => { if (error?.message !== 'web app: missing #root') errors.push(String(error)) } },
|
|
78
79
|
})
|
|
@@ -129,7 +130,7 @@ try {
|
|
|
129
130
|
assert.ok(core.factory('conversation.chat.reasoning.content'))
|
|
130
131
|
const originalBody = core.entriesOfSlot('conversation.chat.reasoning.body')[0]
|
|
131
132
|
const plugin = await build({ entryPoints: [join(project, 'src/client.js')], bundle: true, write: false,
|
|
132
|
-
format: 'iife', logLevel: 'silent' })
|
|
133
|
+
loader: { '.epub': 'base64', '.txt': 'base64', '.md': 'text' }, format: 'iife', logLevel: 'silent' })
|
|
133
134
|
capture(plugin.outputFiles[0].text, 'novel-client-source.js').apply(ctx)
|
|
134
135
|
const body = core.entriesOfSlot('conversation.chat.reasoning.body')[0]
|
|
135
136
|
assert.notEqual(body, originalBody, 'Plugin body must shadow, not replace/delete, host body')
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Convert verified native window captures, not a simulated page, into a paced GIF.
|
|
2
|
+
// Usage: node scripts/make-readme-gif.mjs /path/to/native-captures
|
|
3
|
+
// Requires ffmpeg on PATH. Raw captures stay outside the published evidence.
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
6
|
+
import { resolve, relative } from 'node:path';
|
|
7
|
+
import { spawnSync } from 'node:child_process';
|
|
8
|
+
|
|
9
|
+
const captures = process.argv[2];
|
|
10
|
+
if (!captures) throw new Error('Pass the directory containing native window captures.');
|
|
11
|
+
const root = resolve(import.meta.dirname, '..');
|
|
12
|
+
const work = resolve(root, 'dist/readme-gif');
|
|
13
|
+
const output = resolve(root, 'docs/evidence/reading-two-expansions-110.gif');
|
|
14
|
+
const frames = [
|
|
15
|
+
[41, 2, 'Both thoughts collapsed'],
|
|
16
|
+
[43, 1.2, 'First thought expanded; original reasoning precedes novel'],
|
|
17
|
+
[45, 0.7, 'Scroll within the actual conversation'],
|
|
18
|
+
[47, 0.5, 'Adjust viewport without altering content'],
|
|
19
|
+
[49, 5, 'First thought and first novel passage readable'],
|
|
20
|
+
[51, 1.5, 'First thought collapsed'],
|
|
21
|
+
[53, 2, 'Second distinct thought expanded; next novel passage'],
|
|
22
|
+
[55, 5, 'Scroll to read the second passage'],
|
|
23
|
+
[59, 2, 'Second thought collapsed'],
|
|
24
|
+
];
|
|
25
|
+
const sha256 = bytes => createHash('sha256').update(bytes).digest('hex');
|
|
26
|
+
await mkdir(work, { recursive: true });
|
|
27
|
+
const provenance = [];
|
|
28
|
+
const entries = [];
|
|
29
|
+
for (const [id, seconds, action] of frames) {
|
|
30
|
+
const file = resolve(captures, `${id}-root_result_content_0.png`);
|
|
31
|
+
const bytes = await readFile(file);
|
|
32
|
+
if (bytes.toString('hex', 0, 8) !== '89504e470d0a1a0a' ||
|
|
33
|
+
bytes.readUInt32BE(16) !== 1567 || bytes.readUInt32BE(20) !== 983) {
|
|
34
|
+
throw new Error(`Unexpected native capture dimensions: ${id}`);
|
|
35
|
+
}
|
|
36
|
+
const escape = value => value.replaceAll("'", "'\\''");
|
|
37
|
+
entries.push(`file '${escape(file)}'\nduration ${seconds}`);
|
|
38
|
+
provenance.push({ capture: id, sha256: sha256(bytes), seconds, action });
|
|
39
|
+
}
|
|
40
|
+
const last = resolve(captures, `${frames.at(-1)[0]}-root_result_content_0.png`);
|
|
41
|
+
entries.push(`file '${last.replaceAll("'", "'\\''")}'`);
|
|
42
|
+
const list = resolve(work, 'frames.ffconcat');
|
|
43
|
+
await writeFile(list, `ffconcat version 1.0\n${entries.join('\n')}\n`);
|
|
44
|
+
// Opaque removal of unrelated workspace/session names, quota, account and avatar.
|
|
45
|
+
// The logo, navigation, current project/session, conversation and composer remain.
|
|
46
|
+
const filter = '[0:v]drawbox=x=0:y=541:w=298:h=442:color=0xF8F9FA:t=fill,' +
|
|
47
|
+
'crop=1567:856:0:94,split[a][b];[a]palettegen=stats_mode=full[p];' +
|
|
48
|
+
'[b][p]paletteuse=dither=none';
|
|
49
|
+
const result = spawnSync('ffmpeg', ['-hide_banner', '-loglevel', 'error', '-y',
|
|
50
|
+
'-f', 'concat', '-safe', '0', '-i', list, '-filter_complex', filter,
|
|
51
|
+
'-fps_mode', 'vfr', '-loop', '0', output], { encoding: 'utf8' });
|
|
52
|
+
if (result.status !== 0) throw new Error(result.stderr || 'ffmpeg failed');
|
|
53
|
+
const gif = await readFile(output);
|
|
54
|
+
const bundle = await readFile(resolve(root, 'lib/client.js'));
|
|
55
|
+
const record = {
|
|
56
|
+
capturedOn: '2026-11-07', host: 'DSH Web 0.2.2-alpha.2',
|
|
57
|
+
source: 'Actual running DSH GUI, native Cua window captures; not a mock Host.',
|
|
58
|
+
method: 'Paced native before/after window frames; not continuous desktop video. No interpolated or fabricated UI frames.',
|
|
59
|
+
interaction: 'Expand first thought, scroll, collapse; expand a different thought, scroll, collapse. No model messages sent.',
|
|
60
|
+
book: 'Existing user-imported AQ TXT, 98 segments, intentionally preserved by migration. New bundled AQ MD is independently tested.',
|
|
61
|
+
crop: { x: 0, y: 94, width: 1567, height: 856 },
|
|
62
|
+
redaction: { x: 0, y: 541, width: 298, height: 442, scope: 'Original capture pixels; opaque mask over unrelated sidebar sessions, quota and account.' },
|
|
63
|
+
unchanged: 'No rewriting of the reasoning, novel, plugin controls, logo or current project/session.',
|
|
64
|
+
frames: provenance,
|
|
65
|
+
output: { file: relative(root, output), bytes: gif.length, sha256: sha256(gif), width: 1567, height: 856 },
|
|
66
|
+
testedBundle: { bytes: bundle.length, sha256: sha256(bundle) },
|
|
67
|
+
};
|
|
68
|
+
await writeFile(resolve(root, 'docs/evidence/reading-two-expansions-110.json'), `${JSON.stringify(record, null, 2)}\n`);
|
|
69
|
+
console.log(JSON.stringify(record, null, 2));
|