dsh-cait 1.0.3 → 1.0.4

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