dsh-cait 1.0.3 → 1.0.5
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/CHANGELOG.md +410 -352
- package/LICENSE +201 -201
- package/README.ja.md +55 -14
- package/README.md +466 -423
- package/README.zh-CN.md +429 -390
- package/client/components.js +2408 -2377
- package/client/helpers.js +103 -103
- package/client/locales.js +751 -730
- package/client/rpc.js +93 -93
- package/client/styles.js +258 -258
- package/client.js +3608 -3556
- package/icon.svg +8 -8
- package/index.js +45 -45
- package/lib/api.js +223 -223
- package/lib/docx.js +392 -389
- package/lib/epub.js +355 -0
- package/lib/errors.js +8 -8
- package/lib/formats.js +972 -917
- package/lib/glossary.js +178 -178
- package/lib/html.js +271 -0
- package/lib/import-export.js +650 -605
- package/lib/libraries.js +183 -183
- package/lib/markdown.js +28 -28
- package/lib/mt.js +152 -152
- package/lib/persistence.js +341 -321
- package/lib/pptx.js +89 -89
- package/lib/preprocess.js +65 -0
- package/lib/segmenter.js +84 -84
- package/lib/similarity.js +113 -113
- package/lib/store-utils.js +342 -339
- package/lib/store.js +746 -734
- package/lib/tm.js +160 -160
- package/lib/tmx.js +85 -85
- package/lib/tools.js +472 -472
- package/lib/xlsx.js +218 -218
- package/lib/xml.js +31 -31
- package/locale/en.json +11 -11
- package/locale/zh.json +11 -11
- package/package.json +83 -83
- package/scripts/build-client.mjs +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,352 +1,410 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to CAIT are documented here. The project follows
|
|
4
|
-
[Semantic Versioning](https://semver.org/) and the format is based on
|
|
5
|
-
[Keep a Changelog](https://keepachangelog.com/).
|
|
6
|
-
|
|
7
|
-
## [1.0.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Added
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- The
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
###
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- `
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- `
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
`
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
- Settings
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
and
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
-
|
|
209
|
-
|
|
210
|
-
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
|
|
222
|
-
- `
|
|
223
|
-
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
-
|
|
232
|
-
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
-
|
|
247
|
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
-
|
|
261
|
-
|
|
262
|
-
-
|
|
263
|
-
|
|
264
|
-
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
-
|
|
271
|
-
|
|
272
|
-
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
-
|
|
281
|
-
|
|
282
|
-
-
|
|
283
|
-
|
|
284
|
-
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
-
|
|
292
|
-
|
|
293
|
-
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
|
|
329
|
-
-
|
|
330
|
-
|
|
331
|
-
-
|
|
332
|
-
|
|
333
|
-
-
|
|
334
|
-
|
|
335
|
-
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to CAIT are documented here. The project follows
|
|
4
|
+
[Semantic Versioning](https://semver.org/) and the format is based on
|
|
5
|
+
[Keep a Changelog](https://keepachangelog.com/).
|
|
6
|
+
|
|
7
|
+
## [1.0.5] - 2026-11-06
|
|
8
|
+
|
|
9
|
+
EPUB support, an import preprocessing stage, and format hardening.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- EPUB 3 import and export. Import walks the OPF spine, turns XHTML text blocks
|
|
14
|
+
into segments, and keeps inline tags as placeholder tokens; export patches the
|
|
15
|
+
translations back into the retained source package, preserving chapters,
|
|
16
|
+
styles, images, and navigation. Documents created from plain text export as a
|
|
17
|
+
fresh EPUB 3 package. DRM, fixed-layout, and scripted EPUBs are out of scope.
|
|
18
|
+
- Import preprocessing: whitespace normalization, invisible/control character
|
|
19
|
+
stripping, and blank-line collapsing before segmentation. Each step has a
|
|
20
|
+
settings toggle, applies to file imports and `createDocument`, and is stored
|
|
21
|
+
with the other settings.
|
|
22
|
+
- A shared HTML/XHTML run scanner (`lib/html.js`) used by both HTML and EPUB, so
|
|
23
|
+
headings and inline markup survive import and are patched back on export.
|
|
24
|
+
- CSV delimiter detection (comma, semicolon, tab, pipe) and richer RTF escapes
|
|
25
|
+
(`\cell`, `\row`, `\page`, `\sect`, symbol characters).
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- PDF import is explicitly out of scope. All three READMEs explain why PDF is a
|
|
30
|
+
poor fit for AI-assisted translation and recommend converting it with pandoc,
|
|
31
|
+
Acrobat, or LibreOffice first.
|
|
32
|
+
- The supported-formats table, project layout, roadmap, and “Known limits”
|
|
33
|
+
sections now describe EPUB, preprocessing, and the PDF policy.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- Settings persistence now stores `uiLang` and the preprocessing flags instead of
|
|
38
|
+
falling back to defaults on reload.
|
|
39
|
+
- The EPUB `mimetype` entry is written uncompressed, as the OCF specification
|
|
40
|
+
requires, and every other entry stays deflated.
|
|
41
|
+
- HTML import no longer flattens headings and inline markup into blank-line
|
|
42
|
+
paragraphs.
|
|
43
|
+
|
|
44
|
+
### Development
|
|
45
|
+
|
|
46
|
+
- New `_dev/test-epub.mjs` and `_dev/test-preprocess.mjs` suites; the full suite
|
|
47
|
+
count is 15.
|
|
48
|
+
|
|
49
|
+
## [1.0.4] - 2026-11-05
|
|
50
|
+
|
|
51
|
+
Provenance publishing.
|
|
52
|
+
|
|
53
|
+
### Added
|
|
54
|
+
|
|
55
|
+
- `README.md`, `README.zh-CN.md` and `README.ja.md` carry the live npm badge, so
|
|
56
|
+
the package page and the repository show the published version.
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
|
|
60
|
+
- Releases from this version on are produced by `.github/workflows/publish.yml`,
|
|
61
|
+
which attaches npm provenance and validates the GitHub trusted publisher.
|
|
62
|
+
`npm publish` from a local checkout still works and still asks for an OTP.
|
|
63
|
+
|
|
64
|
+
## [1.0.3] - 2026-11-05
|
|
65
|
+
|
|
66
|
+
npm distribution.
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- The package can now be installed from the npm registry:
|
|
71
|
+
`plugin_manager install_bundle target: dsh-cait` in DSH Desktop, or
|
|
72
|
+
`dsh plugin --profile <name> add dsh-cait`. Pin a release with
|
|
73
|
+
`dsh-cait@1.0.3`; the GitHub and local-checkout routes still work.
|
|
74
|
+
- `engines.dsh` (`>=0.2.2-rc.1`), so the plugin manager refuses an older host
|
|
75
|
+
with a compatibility report instead of a broken mount.
|
|
76
|
+
- `publishConfig.access: public`, an `author` field, and the `dsh-plugin` /
|
|
77
|
+
`cordis` keywords for the registry listing.
|
|
78
|
+
- `prepublishOnly` rebuilds the client bundle and syntax-checks it, so a
|
|
79
|
+
release cannot ship a stale `client.js`.
|
|
80
|
+
- `.github/workflows/publish.yml` publishes a GitHub release through npm
|
|
81
|
+
Trusted Publishing with `--provenance`; it checks the tag against
|
|
82
|
+
`package.json`, runs the whole test suite, and never stores an npm token.
|
|
83
|
+
- `@deepseek-ai/schemastery` is a `devDependency` as well as a peer dependency,
|
|
84
|
+
so a fresh checkout can run the tests.
|
|
85
|
+
|
|
86
|
+
### Changed
|
|
87
|
+
|
|
88
|
+
- `README.ja.md` ships in the package (`files`).
|
|
89
|
+
- The README install section leads with the npm route and keeps the GitHub and
|
|
90
|
+
local-checkout routes as alternatives.
|
|
91
|
+
- The repository no longer tracks `node_modules/`; packed tarballs are ignored.
|
|
92
|
+
|
|
93
|
+
### Removed
|
|
94
|
+
|
|
95
|
+
- `"private": true`, which blocked `npm publish`.
|
|
96
|
+
|
|
97
|
+
## [1.0.2] - 2026-11-04
|
|
98
|
+
|
|
99
|
+
Interface-language fix.
|
|
100
|
+
|
|
101
|
+
### Added
|
|
102
|
+
|
|
103
|
+
- Japanese README (`README.ja.md`), linked from the language switcher of all
|
|
104
|
+
three READMEs and listed in the project layout.
|
|
105
|
+
|
|
106
|
+
### Fixed
|
|
107
|
+
|
|
108
|
+
- **Follow DSH language** now follows the DSH locale instead of staying on
|
|
109
|
+
English. The client plugin declared only `slots` in its inject list, so
|
|
110
|
+
Cordis rejected the `ctx.locale` access with a throw that the registration
|
|
111
|
+
`try`/`catch` swallowed: the DSH-bound translator stayed `null`, every lookup
|
|
112
|
+
fell through to the English dictionary, and a Simplified-Chinese DSH looked
|
|
113
|
+
English. `locale` is now a declared dependency.
|
|
114
|
+
- `auto` resolves the locale service snapshot itself (`zh-CN` → `zh`,
|
|
115
|
+
`ja-JP` → `ja`, `en-US` → `en`) before consulting the DSH-bound translator,
|
|
116
|
+
so a locale tag without a registered fallback chain no longer degrades to
|
|
117
|
+
English. The export `resolveUiLang` covers this mapping.
|
|
118
|
+
- The workbench and the sidebar label subscribe to DSH locale changes, so
|
|
119
|
+
switching the DSH language while `auto` is selected re-renders CAIT
|
|
120
|
+
immediately instead of requiring a reload.
|
|
121
|
+
|
|
122
|
+
## [1.0.1] - 2026-11-04
|
|
123
|
+
|
|
124
|
+
UI languages and license metadata.
|
|
125
|
+
|
|
126
|
+
### Added
|
|
127
|
+
|
|
128
|
+
- Japanese (`ja`) UI dictionary. The workbench now ships three interface
|
|
129
|
+
languages: Simplified Chinese, English, and Japanese.
|
|
130
|
+
- **Settings → Interface → Interface language**, with *Follow DSH language*
|
|
131
|
+
(default), 简体中文, English, and 日本語. The choice is stored as
|
|
132
|
+
`settings.uiLang` in the CAIT store, applies to the workbench and the sidebar
|
|
133
|
+
label immediately, and only affects the CAIT interface — document source and
|
|
134
|
+
target languages are untouched.
|
|
135
|
+
- `NOTICE`, the attribution supplement for Apache-2.0 (section 4(d)), and an
|
|
136
|
+
explicit `license` field in `package.json`.
|
|
137
|
+
|
|
138
|
+
### Changed
|
|
139
|
+
|
|
140
|
+
- `LICENSE` appendix copyright line now reads `Copyright 2026 Jovi Lecca`.
|
|
141
|
+
- Version bumped to `1.0.1` (`package.json`, `CAIT_VERSION`, and the exported
|
|
142
|
+
document metadata move together).
|
|
143
|
+
- Verified against DSH `0.2.2-rc.1`; the README badges and development notes use
|
|
144
|
+
that version.
|
|
145
|
+
|
|
146
|
+
### Fixed
|
|
147
|
+
|
|
148
|
+
- `saveSettings` rejects an unsupported interface language with
|
|
149
|
+
`INVALID_UI_LANG` instead of silently storing it.
|
|
150
|
+
|
|
151
|
+
## [1.0.0] - 2026-11-04
|
|
152
|
+
|
|
153
|
+
First public release. CAIT was developed as `0.1.0` and renumbered to `1.0.0`
|
|
154
|
+
for the first GitHub release.
|
|
155
|
+
|
|
156
|
+
The npm package and Cordis entry are named `dsh-cait`; the UI entry, data
|
|
157
|
+
directory (`$DSH_HOME/cait`), and API route (`/cait/api`) keep the CAIT name.
|
|
158
|
+
|
|
159
|
+
### Highlights
|
|
160
|
+
|
|
161
|
+
- A complete CAT workbench inside DeepSeek Harness: sidebar entry, main panel,
|
|
162
|
+
segment list/editor, TM/glossary/MT side panel, and export flow.
|
|
163
|
+
- Seven agent tools that share the exact store used by the UI.
|
|
164
|
+
- Multiple TM and glossary libraries with mounted-only lookup and default write
|
|
165
|
+
targets.
|
|
166
|
+
- Format-preserving DOCX and PPTX export, plus a broad text, subtitle,
|
|
167
|
+
localization, and Office format matrix.
|
|
168
|
+
- Persistence with atomic snapshots, corrupt-file recovery, strict confirm
|
|
169
|
+
writes, and revision polling between agents and the open workbench.
|
|
170
|
+
|
|
171
|
+
### Added
|
|
172
|
+
|
|
173
|
+
#### Plugin and UI
|
|
174
|
+
|
|
175
|
+
- Host + Client bundle structure (`index.js`, `client.js`, `cordis.patch.yml`,
|
|
176
|
+
`package.json`, locale metadata, icon).
|
|
177
|
+
- New two-bubble A/文 icon: a bilingual speech-bubble pair that reads as
|
|
178
|
+
source/target, used both for the package icon and the DSH sidebar mark.
|
|
179
|
+
- Left-sidebar entry `cait` and main panel `cait`; all styling uses DSH
|
|
180
|
+
`--dsw-alias-*` theme tokens.
|
|
181
|
+
- English and Chinese UI dictionaries; plugin metadata locales.
|
|
182
|
+
- Workbench with document tabs, segment rail, source highlighting, glossary
|
|
183
|
+
chips, target editor, confirm/next/previous/draft actions, progress, and
|
|
184
|
+
responsive density scaling from 1× to 1.8×.
|
|
185
|
+
- Document tabs with close, reopen, new-page import, duplicate-import reuse,
|
|
186
|
+
and a recent-document cleanup dialog for one or all closed documents.
|
|
187
|
+
- Settings modal for source/target languages, fuzzy threshold, TM result limit,
|
|
188
|
+
MT route/model/temperature, and library mounts.
|
|
189
|
+
- Lightweight **库 / Libraries** modal to create, mount, and choose default TM
|
|
190
|
+
and glossary libraries.
|
|
191
|
+
- Visual save-failure/stale banner and a two-second revision poll so
|
|
192
|
+
agent-triggered document switches and confirmations appear in an open
|
|
193
|
+
workbench without discarding a dirty draft.
|
|
194
|
+
|
|
195
|
+
#### Translation memory and glossary
|
|
196
|
+
|
|
197
|
+
- Multiple TM libraries with id, name, mount state, default write library, and
|
|
198
|
+
per-library deduplication.
|
|
199
|
+
- Graded TM matching: `exact`, independent `near_exact` (ignores digits,
|
|
200
|
+
punctuation, and whitespace), `high_fuzzy >= 0.85`,
|
|
201
|
+
`medium_fuzzy 0.75–0.85`, `low_fuzzy < 0.75` above the configurable floor.
|
|
202
|
+
- Lexical fuzzy scoring: character-bigram Dice (72%) + token Jaccard (28%);
|
|
203
|
+
Latin words and CJK characters are tokenized separately.
|
|
204
|
+
- Multiple glossary libraries, source-language filtering, live highlighting,
|
|
205
|
+
click-to-insert terms, case-sensitive terms, CSV/TSV import, and notes.
|
|
206
|
+
- Mounted-only lookups in the UI and tools; unmounted write targets are rejected
|
|
207
|
+
with `TM_NOT_MOUNTED` / `GLOSSARY_NOT_MOUNTED`.
|
|
208
|
+
- Clear operations default to mounted libraries, accept explicit mounted ids, and
|
|
209
|
+
require `all: true` plus `confirm: true` to clear every library.
|
|
210
|
+
- Canonical language tags via `Intl.getCanonicalLocales` (`EN` → `en`,
|
|
211
|
+
`ZH_cn` → `zh-CN`).
|
|
212
|
+
|
|
213
|
+
#### Agent tools
|
|
214
|
+
|
|
215
|
+
- `cat_get_segment` — current segment, TM matches, glossary hits.
|
|
216
|
+
- `cat_submit_translation` — confirm target, optional mounted `targetTmId`,
|
|
217
|
+
write to TM, advance.
|
|
218
|
+
- `cat_lookup_tm` — mounted-library graded lookup.
|
|
219
|
+
- `cat_lookup_glossary` — mounted glossary query with language/case handling.
|
|
220
|
+
- `cat_list_documents` — document list and progress.
|
|
221
|
+
- `cat_switch_document` — switch active document.
|
|
222
|
+
- `cat_suggest_mt` — MT through the selected DSH route, or explicit offline
|
|
223
|
+
glossary-substitution fallback.
|
|
224
|
+
|
|
225
|
+
#### MT
|
|
226
|
+
|
|
227
|
+
- MT provider-route selector built from `ctx.llm.listProviders()` and
|
|
228
|
+
`ctx.llm.listModels()`, optionally filtered by `ctx.loader.entries()`.
|
|
229
|
+
- Calls through `ctx.llm.stream()`; concatenates `text-delta` chunks only.
|
|
230
|
+
- No CAIT-managed `baseUrl` or API key; DSH resolves credentials.
|
|
231
|
+
- Explicit offline fallback labelled **术语替换(离线) / Glossary substitution
|
|
232
|
+
(offline)** (internal id `mock`) when no route/model is available.
|
|
233
|
+
- Host-only detailed logging of stream failures; clients receive the generic
|
|
234
|
+
`MT_PROVIDER_FAILED`.
|
|
235
|
+
|
|
236
|
+
#### Persistence and configuration
|
|
237
|
+
|
|
238
|
+
- Schemastery `dataDir` config; default `$DSH_HOME/cait` or `~/.dsh/cait`.
|
|
239
|
+
- Versioned JSON snapshot (`version: 2`) containing documents, segments, open-tab
|
|
240
|
+
ids, TM, glossary, libraries, mounts, and non-secret settings.
|
|
241
|
+
- Atomic temp-file + rename writes; strict confirm writes that roll back on disk
|
|
242
|
+
failure and return `PERSISTENCE_FAILED` (503); best-effort structural writes
|
|
243
|
+
with a visible storage-error banner.
|
|
244
|
+
- Corrupt/unknown-version snapshots are backed up as
|
|
245
|
+
`store.json.corrupt-<timestamp>` and replaced with empty state.
|
|
246
|
+
- v1 → v2 migration to default TM/glossary libraries.
|
|
247
|
+
- DOCX and PPTX source sidecars under `sources/<document-id>.*` for
|
|
248
|
+
format-preserving export; sidecars are removed when the document is deleted.
|
|
249
|
+
- Open tabs and `activeDocId` persist; draft text and per-document cursor do not.
|
|
250
|
+
- Duplicate import guard based on SHA-256 of languages, source, format, and
|
|
251
|
+
exchange metadata.
|
|
252
|
+
|
|
253
|
+
#### Formats
|
|
254
|
+
|
|
255
|
+
- TXT, Markdown, DOCX body text, TMX 1.4, CSV, SRT, WebVTT, PO, XLIFF 1.2,
|
|
256
|
+
basic XLIFF 2.0, basic SDLXLIFF, HTML, JSON string paths, XLSX, PPTX, and RTF
|
|
257
|
+
import.
|
|
258
|
+
- Target-only TXT/Markdown/HTML/RTF/SRT/WebVTT export; bilingual
|
|
259
|
+
Markdown/CSV/TMX; document exports for PO, XLIFF, XLSX, and PPTX;
|
|
260
|
+
current-document JSON; structure-preserving JSON; DOCX source-package export.
|
|
261
|
+
- CSV column mapping by header name or 1-based number.
|
|
262
|
+
- SRT/VTT cue timing/settings/identifier metadata; semantic inline tags retained;
|
|
263
|
+
invalid ranges rejected; untimed cues follow the previous cue end + 2 s.
|
|
264
|
+
- PO contexts, plural forms, translator comments, and obsolete `#~` entries.
|
|
265
|
+
- XLIFF inline placeholders converted to `{n}` tokens and expanded back on
|
|
266
|
+
export; confirmation rejects dropped tokens with `PLACEHOLDER_MISMATCH`.
|
|
267
|
+
- DOCX export patches translated text into the original package, preserving
|
|
268
|
+
paragraph/run properties, styles, numbering, images, headers, tables, and
|
|
269
|
+
layout.
|
|
270
|
+
- PPTX export patches translated body text into the retained source package,
|
|
271
|
+
preserving slides, masters, shapes, images, and layout.
|
|
272
|
+
- XLSX two-column Source/Target workbook import/export.
|
|
273
|
+
- JSON original-template preservation through `formatMeta.jsonTemplate`.
|
|
274
|
+
|
|
275
|
+
#### API and security
|
|
276
|
+
|
|
277
|
+
- Same-origin JSON bridge at `GET /cait/api/health` and
|
|
278
|
+
`POST /cait/api/rpc`.
|
|
279
|
+
- `ctx.connection.requestRejection` browser/Origin check.
|
|
280
|
+
- 32 MB body limit (`413 BODY_TOO_LARGE`), JSON content-type check, and
|
|
281
|
+
allow-listed handlers.
|
|
282
|
+
- `clearTM` / `clearGlossary` require `confirm: true` (`409
|
|
283
|
+
CONFIRMATION_REQUIRED` otherwise).
|
|
284
|
+
- No API key in the browser, snapshot, RPC response, or logs.
|
|
285
|
+
|
|
286
|
+
### Changed
|
|
287
|
+
|
|
288
|
+
- Renamed the UI fallback from “mock” to **术语替换(离线) / Glossary
|
|
289
|
+
substitution (offline)** while keeping internal ids compatible.
|
|
290
|
+
- Replaced CAIT-managed OpenAI-compatible HTTP calls with DSH provider routes.
|
|
291
|
+
- Split the 1,718-line `lib/store.js` into a `CatStore` facade plus
|
|
292
|
+
`libraries.js`, `tm.js`, `glossary.js`, `persistence.js`,
|
|
293
|
+
`import-export.js`, `store-utils.js`, and `errors.js`.
|
|
294
|
+
- Split the Web UI into `client/helpers.js`, `rpc.js`, `styles.js`,
|
|
295
|
+
`components.js`, `locales.js`, and `entry.js`; `client.js` is now generated by
|
|
296
|
+
`scripts/build-client.mjs`.
|
|
297
|
+
- JSON export was renamed from a purported “project backup” to
|
|
298
|
+
`*.document.json` (current document only); structured JSON export is a
|
|
299
|
+
separate `json-tree` format.
|
|
300
|
+
- Subtitle export now renumbers cues in file order and maintains a monotonic
|
|
301
|
+
cursor for untimed cues instead of overlapping `index * 2s`.
|
|
302
|
+
- Removed the never-incremented `usageCount` TM metric.
|
|
303
|
+
- `cat_submit_translation` now returns `tm.count` as the mounted count and
|
|
304
|
+
`tm.total` as the all-library count.
|
|
305
|
+
- Open documents persist `openDocIds` and `activeDocId`; settings persist, but
|
|
306
|
+
drafts, cursor, and library-modal UI state do not.
|
|
307
|
+
- API key and endpoint fields were removed from settings; `publicSettings()`
|
|
308
|
+
exposes only route/model/temperature.
|
|
309
|
+
- README rewritten for GitHub; this changelog added.
|
|
310
|
+
|
|
311
|
+
### Fixed
|
|
312
|
+
|
|
313
|
+
- Mount checkbox was disabled for every unmounted library when only one was
|
|
314
|
+
mounted; unmounted libraries are now selectable and only the last mounted one
|
|
315
|
+
is protected.
|
|
316
|
+
- `loadDemo()` TM entries were not persisted; demo state now survives reload.
|
|
317
|
+
- Save errors were swallowed and confirmations could report success without a
|
|
318
|
+
disk write; strict confirm + rollback + banner now surface the failure.
|
|
319
|
+
- Agent-driven document switches/confirmations were invisible in an open
|
|
320
|
+
workbench; revision polling and stale/draft handling fixed this.
|
|
321
|
+
- DOCX table paragraphs were flattened into the body text despite the docs; table
|
|
322
|
+
blocks are now excluded during import.
|
|
323
|
+
- TMX inline `bpt/ept/ph` markup was silently dropped; imports now return a
|
|
324
|
+
`TMX_INLINE_MARKUP_LOST` warning with a count.
|
|
325
|
+
- Glossary language matching was case-sensitive in hits but case-insensitive in
|
|
326
|
+
the tool; both paths now canonicalize.
|
|
327
|
+
- XLIFF placeholders, PO plurals/comments/obsolete blocks, and subtitle semantic
|
|
328
|
+
tags were dropped in earlier adapters; all are preserved now.
|
|
329
|
+
- Subtitle zero/negative-duration cues were silently rewritten; they now fail
|
|
330
|
+
with an explicit parse error.
|
|
331
|
+
- Duplicate imports always created a new document; identical content now reuses
|
|
332
|
+
the existing document.
|
|
333
|
+
- Closed documents could not be cleaned up; the recent-documents dialog can now
|
|
334
|
+
delete one or all closed documents.
|
|
335
|
+
- `cat_lookup_glossary` parameter text still claimed case-insensitive matching
|
|
336
|
+
after case-sensitive support was added; corrected.
|
|
337
|
+
- PPTX export no longer silently emits an unformatted deck when the source
|
|
338
|
+
package is missing; it returns `PPTX_SOURCE_REQUIRED`.
|
|
339
|
+
- JSON `formatMeta.jsonTemplate`, XLSX metadata, and PPTX source sidecars were
|
|
340
|
+
not preserved through reload in the first integration pass; fixed and tested.
|
|
341
|
+
- Save-label text was invisible in the settings modal because the generic button
|
|
342
|
+
reset overrode `.cait-btn-primary`; fixed and covered by the mount test.
|
|
343
|
+
|
|
344
|
+
### Security
|
|
345
|
+
|
|
346
|
+
- Removed the CAIT-managed `baseUrl` and API key path, eliminating the SSRF /
|
|
347
|
+
keyless-regex / remote-error-body findings from the audit.
|
|
348
|
+
- MT failures expose only `MT_PROVIDER_FAILED`; provider/model/code/status stay in
|
|
349
|
+
the Host log.
|
|
350
|
+
- All RPC calls retain the DSH Origin/browser-trust check; clear methods require
|
|
351
|
+
explicit confirmation.
|
|
352
|
+
- Snapshot excludes API keys by design; MT credentials remain inside DSH.
|
|
353
|
+
|
|
354
|
+
### Tests
|
|
355
|
+
|
|
356
|
+
- 13 suites: `test-core`, `test-imports`, `test-formats`,
|
|
357
|
+
`test-second-tier`, `test-docx-export`, `test-api`, `test-plugin`,
|
|
358
|
+
`test-persistence`, `test-documents`, `test-libraries`, `test-mounts`,
|
|
359
|
+
`test-ui-scale`, and `test-mt`.
|
|
360
|
+
- Coverage includes TM grading and boundaries, multi-library mounts,
|
|
361
|
+
mounted-only lookup, unmounted-target rejection, clear scope/confirmation,
|
|
362
|
+
corruption fallback, v1 migration, strict persistence rollback, demo reload,
|
|
363
|
+
document tabs/dedupe/delete, DOCX/XLSX/PPTX source preservation, CSV mapping,
|
|
364
|
+
SRT/VTT timelines, PO plurals/comments/obsolete, XLIFF 1.2/2.0 placeholders,
|
|
365
|
+
second-tier round-trips, API 413/403/404/409/415, and UI helper logic.
|
|
366
|
+
- Fixtures: `sample.docx`, `sample-table.docx`, `sample-format.docx` with
|
|
367
|
+
`make-*.py` regeneration scripts.
|
|
368
|
+
|
|
369
|
+
### Documentation
|
|
370
|
+
|
|
371
|
+
- Replaced the long development README with a GitHub-oriented README: badges,
|
|
372
|
+
quick start, feature overview, format matrix, install paths, configuration,
|
|
373
|
+
tools, architecture, development, security, and limits.
|
|
374
|
+
- Added this changelog and set `package.json` version to `1.0.0`.
|
|
375
|
+
- Added a complete Simplified Chinese README (`README.zh-CN.md`) and a language
|
|
376
|
+
switcher; the English README now contains English-only prose and UI labels.
|
|
377
|
+
|
|
378
|
+
### Known limitations
|
|
379
|
+
|
|
380
|
+
- No PDF, EPUB, or image/OCR import yet; no PDF layout-preserving export.
|
|
381
|
+
- DOCX: tables, headers/footers, footnotes, fields, alt text, and tracked
|
|
382
|
+
deletions are not imported; mixed-run translation inherits the first run style.
|
|
383
|
+
- PPTX: body text only; notes, charts, SmartArt, and fields are not imported.
|
|
384
|
+
- XLSX: two-column table only; styles, formulas, merged cells, images, and extra
|
|
385
|
+
sheets are not preserved.
|
|
386
|
+
- HTML/RTF export does not round-trip original styling; JSON only translates
|
|
387
|
+
string values.
|
|
388
|
+
- TM matching is lexical, not semantic.
|
|
389
|
+
- Library rename/delete and per-tab mount state are not part of v1.0.0.
|
|
390
|
+
- Persistence is one snapshot with last-write-wins semantics, not a multi-user
|
|
391
|
+
journal.
|
|
392
|
+
- No browser pixel/click test is included; the generated client is validated by
|
|
393
|
+
`node --check`, helper tests, and plugin slot activation.
|
|
394
|
+
|
|
395
|
+
## Development history
|
|
396
|
+
|
|
397
|
+
| Date | Milestone |
|
|
398
|
+
| --- | --- |
|
|
399
|
+
| 2026-11-03 | Plugin skeleton, Host/Client split, CAT store, segmentation, TM, glossary, three tools, workbench UI, TXT/MD/DOCX/TMX import/export, mock MT. |
|
|
400
|
+
| 2026-11-03 | Persistence layer (`dataDir`, v1 snapshot, atomic writes, corrupt fallback), `tmId`/`glossaryId` reservations, reload/corruption tests. |
|
|
401
|
+
| 2026-11-03 | Graded `matchType` (`exact`/`near_exact`/three fuzzy bands) with locale labels and boundary tests. |
|
|
402
|
+
| 2026-11-03 | Four additional agent tools (`cat_lookup_glossary`, `cat_list_documents`, `cat_switch_document`, `cat_suggest_mt`). |
|
|
403
|
+
| 2026-11-03 | Multi-library TM/glossary mounts, `targetTmId`, v1→v2 migration, library modal, mounted-only semantics. |
|
|
404
|
+
| 2026-11-03 | Read-only audit and hardening: mount checkbox, MT route reuse, clear confirmation, mounted write boundaries, strict persistence, revision polling, language/metadata fixes, store/client split. |
|
|
405
|
+
| 2026-11-04 | Document tabs, close/reopen, duplicate fingerprint, recent-document cleanup. |
|
|
406
|
+
| 2026-11-04 | Source-format-preserving DOCX export with sidecar storage and fixtures. |
|
|
407
|
+
| 2026-11-04 | First-tier exchange formats: CSV mapping, SRT, WebVTT, PO, XLIFF 1.2, metadata persistence, timeline fixes. |
|
|
408
|
+
| 2026-11-04 | Second-tier formats: HTML, JSON, XLSX, PPTX, RTF; binary upload/export; source-preserving PPTX. |
|
|
409
|
+
| 2026-11-04 | Responsive UI density 1×–1.8×; button contrast fix; v1.0.0 release. |
|
|
410
|
+
| 2026-11-06 | EPUB 3 import/export with source-package patching, shared HTML/XHTML scanner, import preprocessing stage, CSV/RTF hardening, PDF out of scope; v1.0.5 release. |
|