dsh-cait 1.0.5 → 1.1.6

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 CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <strong>Computer-aided translation, inside DeepSeek Harness.</strong><br/>
9
- Translation memory · glossary · segment editor · MT assistance · document tabs · Office / subtitle / localization formats
9
+ Translation memory 路 glossary 路 segment editor 路 MT assistance 路 document tabs 路 Office / subtitle / localization formats
10
10
  </p>
11
11
  <p align="center">
12
12
  <a href="README.zh-CN.md">简体中文</a> · <a href="README.ja.md">日本語</a> · <a href="README.md">English</a>
@@ -16,12 +16,12 @@
16
16
  <p align="center">
17
17
  <a href="https://www.npmjs.com/package/dsh-cait"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-cait.svg" /></a>
18
18
  <img alt="DSH 0.2.x" src="https://img.shields.io/badge/DSH-0.2.x-4d6bfe.svg" />
19
- <img alt="Tests: 15 suites" src="https://img.shields.io/badge/tests-15%20suites-brightgreen.svg" />
19
+ <img alt="Tests: 41 suites" src="https://img.shields.io/badge/tests-41%20suites-brightgreen.svg" />
20
20
  <img alt="No API key required" src="https://img.shields.io/badge/API%20key-not%20required-6b7280.svg" />
21
21
  </p>
22
22
 
23
23
  CAIT adds a CAT workbench to the DSH Web UI and Desktop. It opens from a
24
- left-sidebar entry, keeps one shared store behind the workbench and seven agent
24
+ left-sidebar entry, keeps one shared store behind the workbench and twenty agent
25
25
  tools, and covers the practical path from importing a source file to exporting a
26
26
  translated document.
27
27
 
@@ -34,11 +34,11 @@ translated document.
34
34
  | | |
35
35
  |---|---|
36
36
  | **Native to DSH** | A real sidebar panel, a main workbench, DSH theme tokens, and the same store for humans and agents. No iframe, no separate app. |
37
- | **TM that explains itself** | Multiple TM libraries, mounted-only lookup, exact / near-exact / high / medium / low fuzzy grades, and automatic write-back on confirm. |
37
+ | **TM that explains itself** | Multiple TM libraries, mounted-only lookup, 101% context (ICE) matches, exact / near-exact / high / medium / low fuzzy grades, and automatic write-back on confirm. |
38
38
  | **Glossary-aware editing** | Multiple term bases, source-language filtering, inline highlighting, click-to-insert terms, and per-term case sensitivity. |
39
39
  | **A document workflow** | Tabs, close/reopen, recent-document cleanup, duplicate-import reuse, and progress per document. |
40
40
  | **Real format coverage** | TXT, Markdown, DOCX, EPUB, TMX, CSV, SRT/VTT, PO, XLIFF 1.2/2.0/SDLXLIFF, HTML, JSON, XLSX, PPTX, and RTF. |
41
- | **Agent-ready** | Seven tools share the open document and store, so an agent can translate alongside you. |
41
+ | **Agent-ready** | Twenty-one tools share the open document and store, so an agent can translate alongside you. |
42
42
 
43
43
  ## Quick start
44
44
 
@@ -57,14 +57,71 @@ manual reload.
57
57
 
58
58
  ## Features
59
59
 
60
+ ### New in 1.1.6
61
+
62
+ - **Find and replace** across source/target with a preview, one-step apply, and
63
+ undo; confirmed segments return to review when their target changes.
64
+ - **Command palette** (`Ctrl/Cmd+K`) and `Ctrl/Cmd+F` for find and replace.
65
+ - **Segment notes** for review comments, plus per-segment **draft undo/redo**.
66
+ - **Merge, split, and lock** text segments. Merge/split are limited to TXT and
67
+ Markdown until Office paragraph mapping can be written back safely.
68
+ - **Term discovery for one-off names.** Quoted terms, capitalized names, and
69
+ Chinese proper names that occur once are offered as candidates with evidence,
70
+ type, and confidence; nothing is added to the glossary automatically.
71
+ - **AI review.** The QA tab can ask the configured DSH route for structured
72
+ suggestions, jump to a segment, and fill a suggestion into the draft. Agents can
73
+ call `cat_review`; neither path writes the document. Review follows the
74
+ translation model by default, and Settings can give it a separate provider and
75
+ model.
76
+
77
+ ### New in 1.1.5
78
+
79
+ - Each document can **inherit the global TM/glossary mounts or bind its own
80
+ libraries**, with a default write TM per document. Lookup, glossary hits, QA,
81
+ pre-translation, and confirmations all honor that scope.
82
+ - **Word count and leverage analysis** reports segments, words, characters,
83
+ duplicates, ICE/exact/fuzzy/new buckets, match rate, and leverage, with CSV and
84
+ JSON download.
85
+ - Export a **bilingual review DOCX** (Source/Target/Status) for reviewers who do
86
+ not use CAIT.
87
+ - Export and re-import an **XLIFF 1.2 review package**. Re-import matches by uid,
88
+ XLIFF id, or a unique source, refuses source mismatches, and reports unmatched
89
+ segments.
90
+ - **TM maintenance** previews and confirms merge, deduplicate, and prune actions.
91
+
92
+ ### New in 1.1.4
93
+
94
+ - Each document can carry a **translation brief** — domain, audience, tone,
95
+ notes, do-not-translate terms, and a style sample — which is injected into MT
96
+ prompts and readable by agents through `cat_get_brief`.
97
+ - Pre-translation now sends **up to eight segments per request** with the brief
98
+ and neighbouring source sentences, then falls back to one segment at a time
99
+ for anything the model leaves out.
100
+ - Glossary entries can be **forbidden** (never use this rendering) or
101
+ **preferred** (must use it when the source term appears), and the flags survive
102
+ CSV/JSON/TBX export and CSV import.
103
+ - QA findings are graded **high / medium / low**, and the QA tab can jump to a
104
+ finding, copy the source, clear the target, or insert the required term. A
105
+ concordance tab searches every mounted TM for a word or phrase.
106
+ - A confirmed segment can be **unconfirmed** without deleting its text or its TM
107
+ entry; editing a confirmed segment revokes the confirmation automatically.
108
+ - The segment rail can **clear all unconfirmed pre-translated targets** in one
109
+ action. A confirmation dialog states the count and the MT/TM/auto breakdown,
110
+ and confirms that confirmed segments, manual drafts, and saved TM entries are
111
+ left untouched.
112
+
60
113
  ### Translation memory
61
114
 
62
115
  - Multiple TM libraries with id, name, mount state, and a default write library.
116
+ - **Context match (ICE) at 101%.** Each confirmation records the two neighbouring
117
+ source sentences. A later segment with the same neighbours scores 101% and is
118
+ graded `context`; identical text with different neighbours stays at 100%. A key
119
+ keeps up to 8 context variants and always keeps the context-free one.
63
120
  - Exact, near-exact, and three fuzzy bands:
64
121
  - `near_exact` compares a key that ignores digits, punctuation, and whitespace;
65
122
  it does not depend on a score cutoff.
66
123
  - `high_fuzzy` is `>= 0.85`, `medium_fuzzy` is `0.75–0.85`, `low_fuzzy` is
67
- below `0.75` (above the configurable floor, default `0.55`).
124
+ below `0.75` (above the configurable floor, default `0.70`).
68
125
  - Fuzzy scoring is lexical: 72% character-bigram Dice + 28% token Jaccard.
69
126
  Latin text uses words; CJK text uses individual characters. There is no
70
127
  stemming, synonym, or semantic matching.
@@ -74,7 +131,8 @@ manual reload.
74
131
  `bootstrap().tm.count` is the mounted count and `bootstrap().tm.total` is the
75
132
  all-library count. Use `cat_lookup_tm` or the library modal for full data.
76
133
  - TMX 1.4 `<tu>/<tuv>/<seg>` import/export. Inline TMX placeholders are flattened
77
- to plain text with an explicit warning.
134
+ to plain text with an explicit warning. Context travels as
135
+ `<prop type="x-context">`, so a CAIT round-trip keeps 101% matches.
78
136
 
79
137
  ### Glossary
80
138
 
@@ -83,11 +141,83 @@ manual reload.
83
141
  - CSV/TSV import, per-term notes, source-language filtering, and a
84
142
  `caseSensitive` flag honored by both the workbench and `cat_lookup_glossary`.
85
143
  - Language codes are canonicalized (`EN` → `en`, `ZH_cn` → `zh-CN`).
144
+ - Entries can be edited or deleted in any library, mounted or not; mount state
145
+ only decides what the workbench searches and writes.
146
+ - **Terminology mining**: *Mine terms from the document* in the glossary toolbar
147
+ lists candidates with occurrence counts, sample wording from memory, and a
148
+ marker when the term is already known. Counting finds and ranks the candidates
149
+ (Latin n-grams, repeated CJK substrings filtered by boundary entropy); you
150
+ confirm the wording and add them. A model-assisted shortlist that can include
151
+ single-occurrence proper nouns is planned for 1.1.6.
152
+
153
+ ### Library workspace
154
+
155
+ `Documents` / `Libraries` / `Align` in the topbar switches between the translator
156
+ and the library manager. The library view needs no open document.
157
+
158
+ - One table for translation memory, one for glossaries, with paging
159
+ (20/50/100/200, remembered), language filters, and a search that can be scoped
160
+ to any combination of libraries.
161
+ - A side panel edits the selected entry in place, adds entries, and shows when a
162
+ draft is unsaved.
163
+ - Translation memory exports to **TMX**; glossaries export to **TBX**, **CSV**, or
164
+ **JSON**. Import and clear stay available in the same toolbar.
165
+ - The right panel's library button opens this workspace with the panel's search
166
+ text already applied, so a lookup in the panel continues in the full list.
167
+
168
+ ### Alignment
169
+
170
+ `Documents` / `Libraries` / `Align` — the third view builds a translation
171
+ memory from two finished files: the source document and its translation, as
172
+ separate files in any supported format and any pair of languages.
173
+
174
+ - Cross-language scoring: shared anchors (numbers, `{0}` placeholders, URLs,
175
+ capitalised names), length normalised per language, and paragraph structure.
176
+ Word overlap is deliberately not used, because it cannot compare two languages.
177
+ - Blocked dynamic programming pairs 1:1, 1:0, 0:1, 2:1 and 1:2; rows are graded
178
+ high / to review / doubtful and start selected only when they are high.
179
+ - Each row can be merged with the next, split on line breaks, or removed before
180
+ writing; the target library is chosen in the toolbar, and identical entries are
181
+ skipped rather than duplicated.
86
182
 
87
183
  ### Workbench
88
184
 
89
185
  - Paragraph/sentence segmentation with a per-segment target editor.
90
- - Draft saving, confirm-and-next, previous/next navigation, and progress.
186
+ - Segment states: **pending** → **translated** → **confirmed**, with the origin of
187
+ each translation (`tm`, `mt`, `agent`, `manual`) kept alongside the text. The
188
+ rail filters by state and search covers source, target, and suggestions.
189
+ - **Segment paging**: the rail pages through the filtered segments with a page
190
+ size of 20/50/100/200 and a box to jump straight to a segment number. Jumping
191
+ clears the filter when the target segment would otherwise be hidden.
192
+ - **Pre-translate** fills the whole document from exact TM matches and machine
193
+ translation in batches of up to eight segments, carrying the document brief
194
+ and neighbouring source sentences, and falls back to one segment at a time
195
+ when a batch response is partial. It shows `done/total` and can be stopped
196
+ between blocks. Confirmed and already-translated segments are never overwritten.
197
+ - **Translation brief** lives beside the document: domain, audience, tone, notes,
198
+ do-not-translate terms, and a style sample. It is editable from the segment
199
+ header and used by both pre-translation and agent translation.
200
+ - **Stacked review**: source, the machine/agent baseline, and the editable target
201
+ are laid out top to bottom, so each block gets the full pane width.
202
+ **Confirm all** accepts every segment awaiting review after one confirmation
203
+ dialog.
204
+ - Draft saving, confirm-and-next, previous/next navigation, and progress. The
205
+ selected segment and the draft are persisted (debounced) so a restart resumes
206
+ where you left off.
207
+ - **Repeated segments are mirrored**: confirming a sentence fills every other
208
+ unconfirmed copy with the same source (`origin: auto`), editing a draft keeps
209
+ them in sync, and *Fill repeated segments* does the whole document at once.
210
+ Confirmed segments are never touched.
211
+ - Advisory QA markers in the rail and an export-time summary, graded **high /
212
+ medium / low**: missing placeholders/tags, mismatched numbers, unused or
213
+ forbidden glossary terms, empty targets, an untouched copy of the source,
214
+ length drift, and one source with several translations. The QA tab lists
215
+ findings and offers jump, copy-source, clear-target, and insert-term actions.
216
+ Nothing is blocked and nothing is stored.
217
+ - **Undo confirmation.** A confirmed segment can be unconfirmed back to
218
+ `translated`; its text and TM entry stay in place. Editing a confirmed segment
219
+ revokes the confirmation automatically, and confirming it again updates the
220
+ same TM entry.
91
221
  - Document tabs; closing a tab does not delete the document.
92
222
  - **Open existing document** reopens a closed document.
93
223
  - Interface language switch in **Settings → Interface**: *Follow DSH language*
@@ -100,9 +230,12 @@ manual reload.
100
230
  - Re-importing identical content in the same format reuses the existing document
101
231
  instead of creating a duplicate. The fingerprint covers languages, source,
102
232
  format, and exchange metadata.
103
- - Responsive density: the workbench measures its DSH panel and applies a
104
- `--cait-u` multiplier of 1×–1.8×. A 1600×900 panel renders at ~1.32× and a
105
- 2560×1440 panel at 1.8×; short windows stay at 1× rather than shrinking.
233
+ - Responsive density: the workbench measures its DSH panel and applies a damped
234
+ `--cait-u` multiplier of 1×–1.45×. A 1600×900 panel renders at ~1.17× and a
235
+ maximized 4K panel stops at 1.45×, which keeps large windows close to the host
236
+ UI and leaves room for the three review columns.
237
+ - The workbench follows the host light/dark theme, including native controls
238
+ (`color-scheme`), so selects, checkboxes, and scrollbars match the panel.
106
239
 
107
240
  ### Preprocessing
108
241
 
@@ -126,7 +259,10 @@ CAIT does not own an endpoint or key. The selector is built from DSH:
126
259
  - `ctx.llm.listModels(provider)` supplies model ids; CAIT selects the first model
127
260
  by default.
128
261
  - `ctx.llm.stream({ provider, model, messages, temperature, purpose: 'cait-mt' })`
129
- performs the call; CAIT concatenates `text-delta` chunks.
262
+ performs the call; CAIT concatenates `text-delta` chunks. Batch pre-translation
263
+ uses `purpose: 'cait-mt-batch'` and asks for a JSON array keyed by position;
264
+ both paths include the document brief, the neighbouring source sentences, and
265
+ the usable/forbidden glossary rules in the prompt.
130
266
 
131
267
  If no usable route exists, the selected route disappears, or it has no models,
132
268
  CAIT falls back to offline glossary substitution and says so in the UI and in the
@@ -137,21 +273,21 @@ provider/model/code/status; the client receives only `MT_PROVIDER_FAILED`.
137
273
 
138
274
  | Format | Import | Export | Notes |
139
275
  | --- | :---: | :---: | --- |
140
- | TXT / Markdown | ✅ | ✅ | Paragraph and sentence segmentation |
141
- | CSV | ✅ | ✅ | Comma, semicolon, tab, or pipe delimiter auto-detected; source/target column by header name or 1-based number; existing bilingual export |
142
- | DOCX | ✅ | ✅ | Body paragraphs; table blocks are excluded from import. Export patches the original package, keeping styles, numbering, images, headers, tables, and layout. |
143
- | EPUB | ✅ | ✅ | EPUB 3 spine order; XHTML text blocks with inline markup kept as tokens and patched back into the retained package. DRM-protected, fixed-layout, and scripted EPUBs are not supported. |
144
- | TMX 1.4 | ✅ | ✅ | Common `<tu>/<tuv>/<seg>` subset; inline markup flattened with warning |
145
- | SRT / WebVTT | ✅ | ✅ | One cue per segment, timings/settings/identifier retained; semantic tags kept; invalid ranges rejected |
146
- | PO | ✅ | ✅ | Contexts, plural forms, translator comments, obsolete `#~` entries |
147
- | XLIFF 1.2 | ✅ | ✅ | Inline tags become `{n}` tokens; missing tokens block confirmation |
148
- | XLIFF 2.0 | ✅ | ✅ | Basic `<unit><segment><source>/<target>` subset |
149
- | SDLXLIFF | ✅ | ✅ | Basic XLIFF 1.2 path; SDL-specific extensions are not round-tripped |
150
- | HTML | ✅ | ✅ | Text blocks and inline tags preserved; document CSS/layout is not rebuilt |
151
- | JSON | ✅ | ✅ | String-path subset; object/array structure preserved via a template; keys and numbers are not translated |
152
- | XLSX | ✅ | ✅ | First worksheet; `Source`/`Target` headers or columns A/B; export is a new two-column workbook |
153
- | PPTX | ✅ | ✅* | Source-preserving export; requires the imported `.pptx` package. Body text only; notes/charts/SmartArt not imported. |
154
- | RTF | ✅ | ✅ | Basic paragraphs, `\uN`, `\'hh`, control words; original styling not round-tripped |
276
+ | TXT / Markdown | 鉁?| 鉁?| Paragraph and sentence segmentation |
277
+ | CSV | 鉁?| 鉁?| Comma, semicolon, tab, or pipe delimiter auto-detected; source/target column by header name or 1-based number; existing bilingual export |
278
+ | DOCX | 鉁?| 鉁?| Body paragraphs; table blocks are excluded from import. Export patches the original package, keeping styles, numbering, images, headers, tables, and layout. |
279
+ | EPUB | 鉁?| 鉁?| EPUB 3 spine order; XHTML text blocks with inline markup kept as tokens and patched back into the retained package. DRM-protected, fixed-layout, and scripted EPUBs are not supported. |
280
+ | TMX 1.4 | 鉁?| 鉁?| Common `<tu>/<tuv>/<seg>` subset; inline markup flattened with warning; context kept in `<prop type="x-context">` |
281
+ | SRT / WebVTT | 鉁?| 鉁?| One cue per segment, timings/settings/identifier retained; semantic tags kept; invalid ranges rejected |
282
+ | PO | 鉁?| 鉁?| Contexts, plural forms, translator comments, obsolete `#~` entries |
283
+ | XLIFF 1.2 | 鉁?| 鉁?| Inline tags become `{n}` tokens; missing tokens block confirmation |
284
+ | XLIFF 2.0 | 鉁?| 鉁?| Basic `<unit><segment><source>/<target>` subset |
285
+ | SDLXLIFF | 鉁?| 鉁?| Basic XLIFF 1.2 path; SDL-specific extensions are not round-tripped |
286
+ | HTML | 鉁?| 鉁?| Text blocks and inline tags preserved; document CSS/layout is not rebuilt |
287
+ | JSON | 鉁?| 鉁?| String-path subset; object/array structure preserved via a template; keys and numbers are not translated |
288
+ | XLSX | 鉁?| 鉁?| First worksheet; `Source`/`Target` headers or columns A/B; export is a new two-column workbook |
289
+ | PPTX | 鉁?| 鉁? | Source-preserving export; requires the imported `.pptx` package. Body text only; notes/charts/SmartArt not imported. |
290
+ | RTF | 鉁?| 鉁?| Basic paragraphs, `\uN`, `\'hh`, control words; original styling not round-tripped |
155
291
 
156
292
  \* PPTX export fails with `PPTX_SOURCE_REQUIRED` when the retained source package
157
293
  is missing rather than silently producing an unformatted deck.
@@ -195,7 +331,7 @@ In DSH Desktop (or any profile with the `plugin_manager` tool):
195
331
  plugin_manager install_bundle target: dsh-cait
196
332
  ```
197
333
 
198
- Pin a release with `dsh-cait@1.0.5`, or ask for the newest one with
334
+ Pin a release with `dsh-cait@1.1.6`, or ask for the newest one with
199
335
  `dsh-cait@latest`. The manager resolves the registry package, applies the bundle
200
336
  patch, and activates the plugin — no hand-written profile rows.
201
337
 
@@ -276,8 +412,9 @@ confirmation. Other structural edits remain best-effort and surface
276
412
 
277
413
  If the snapshot is corrupt or has an unknown version, CAIT logs a warning, moves
278
414
  it to `store.json.corrupt-<timestamp>`, and starts empty instead of failing
279
- activation. Version-1 snapshots are migrated to version 2 with default TM and
280
- glossary libraries.
415
+ activation. Version-1 and version-2 snapshots are migrated to version 3 with
416
+ default TM and glossary libraries; a version-2 draft that had text but was never
417
+ confirmed becomes `translated` with `origin: manual`.
281
418
 
282
419
  ## Agent tools
283
420
 
@@ -290,6 +427,26 @@ glossary libraries.
290
427
  | `cat_list_documents` | List documents and progress |
291
428
  | `cat_switch_document` | Select the active document |
292
429
  | `cat_suggest_mt` | MT via the selected DSH route, or the explicit offline fallback |
430
+ | `cat_pre_translate` | Fill one block from TM + MT, skipping confirmed/translated segments; returns `next` |
431
+ | `cat_get_segments` | Bounded segment window with status, origin, and suggestions |
432
+ | `cat_confirm_segments` | Confirm a list of indices, a window, or everything awaiting review |
433
+ | `cat_propose_translation` | Leave a suggestion plus a reason without touching the confirmed target |
434
+ | `cat_align` | Align two texts and report high / to-review / doubtful pairs |
435
+ | `cat_consistency_report` | Group repeated sources that carry different translations |
436
+ | `cat_term_candidates` | Mining shortlist, including one-off proper names, with type/confidence and evidence |
437
+ | `cat_get_brief` | Read the document brief before translating |
438
+ | `cat_set_brief` | Update brief fields, or clear the whole brief |
439
+ | `cat_get_context` | Brief, current segment, previous/next sources, and paragraph around a segment |
440
+ | `cat_unconfirm_segment` | Revoke a confirmation without deleting the text or TM entry |
441
+ | `cat_concordance` | Search every mounted TM for a word or phrase in source or target |
442
+ | `cat_add_terms` | Add accepted terminology to a library in one batch |
443
+ | `cat_review` | Ask the model for structured review suggestions; never writes the document |
444
+
445
+ An agent can therefore draft a whole document without clicking in the UI:
446
+ `cat_pre_translate` with `from: next` until `next` is `null`, then
447
+ `cat_get_segments` to review, then `cat_confirm_segments` to accept. For
448
+ terminology it reads `cat_term_candidates`, judges the shortlist, and writes the
449
+ result with `cat_add_terms`.
293
450
 
294
451
  The workbench and tools share one `CatStore`, so an agent can translate the same
295
452
  document the user has open.
@@ -300,7 +457,7 @@ document the user has open.
300
457
  flowchart LR
301
458
  UI["DSH Web UI<br/>(sidebar + workbench)"] --> Client["client.js<br/>generated Web bundle"]
302
459
  Client --> API["/cait/api/rpc<br/>same-origin JSON"]
303
- Tools["7 agent tools"] --> Store["CatStore"]
460
+ Tools["21 agent tools"] --> Store["CatStore"]
304
461
  API --> Store
305
462
  Store --> Snapshot[("store.json<br/>+ sources/")]
306
463
  ```
@@ -317,44 +474,48 @@ flowchart LR
317
474
 
318
475
  ```text
319
476
  cait/
320
- ├─ package.json
321
- ├─ cordis.patch.yml
322
- ├─ index.js # Host half
323
- ├─ client.js # generated Web bundle
324
- ├─ client/ # helpers, styles, RPC, components, locales, entry
325
- ├─ scripts/build-client.mjs
326
- ├─ icon.svg
327
- ├─ locale/{en,zh,ja}.json
328
- ├─ NOTICE
329
- ├─ README.md
330
- ├─ README.zh-CN.md
331
- ├─ README.ja.md
332
- ├─ CHANGELOG.md
333
- ├─ lib/
334
- │ ├─ store.js # CatStore facade + document/segment core
335
- │ ├─ errors.js
336
- │ ├─ store-utils.js
337
- │ ├─ libraries.js # TM/glossary registries + mounts
338
- │ ├─ tm.js
339
- │ ├─ glossary.js
340
- │ ├─ persistence.js
341
- │ ├─ import-export.js
342
- │ ├─ formats.js # CSV/SRT/VTT/PO/XLIFF/HTML/JSON/RTF
343
- │ ├─ html.js # Shared HTML/XHTML run scanner + patcher
344
- │ ├─ epub.js # EPUB package read / spine import / patch export
345
- │ ├─ preprocess.js # Import-time source cleaning stage
346
- │ ├─ xlsx.js
347
- │ ├─ pptx.js
348
- │ ├─ segmenter.js
349
- │ ├─ similarity.js
350
- │ ├─ tmx.js
351
- │ ├─ docx.js
352
- │ ├─ markdown.js
353
- │ ├─ xml.js
354
- │ ├─ mt.js
355
- │ ├─ tools.js
356
- │ └─ api.js
357
- └─ _dev/ # tests, fixtures, local patch overlay
477
+ 鈹溾攢 package.json
478
+ 鈹溾攢 cordis.patch.yml
479
+ 鈹溾攢 index.js # Host half
480
+ 鈹溾攢 client.js # generated Web bundle
481
+ 鈹溾攢 client/ # helpers, styles, RPC, components, locales, entry
482
+ 鈹溾攢 scripts/build-client.mjs
483
+ 鈹溾攢 icon.svg
484
+ 鈹溾攢 locale/{en,zh,ja}.json
485
+ 鈹溾攢 NOTICE
486
+ 鈹溾攢 README.md
487
+ 鈹溾攢 README.zh-CN.md
488
+ 鈹溾攢 README.ja.md
489
+ 鈹溾攢 CHANGELOG.md
490
+ 鈹溾攢 lib/
491
+ 鈹? 鈹溾攢 store.js # CatStore facade + document/segment core
492
+ 鈹? 鈹溾攢 errors.js
493
+ 鈹? 鈹溾攢 store-utils.js
494
+ 鈹? 鈹溾攢 libraries.js # TM/glossary registries + mounts
495
+ 鈹? 鈹溾攢 library-view.js # Library paging/search + export entry points
496
+ 鈹? 鈹溾攢 library-export.js # Glossary TBX / CSV / JSON builders
497
+ 鈹? 鈹溾攢 tm.js
498
+ 鈹? 鈹溾攢 glossary.js
499
+ 鈹? 鈹溾攢 persistence.js
500
+ 鈹? 鈹溾攢 import-export.js
501
+ 鈹? 鈹溾攢 formats.js # CSV/SRT/VTT/PO/XLIFF/HTML/JSON/RTF
502
+ 鈹? 鈹溾攢 html.js # Shared HTML/XHTML run scanner + patcher
503
+ 鈹? 鈹溾攢 epub.js # EPUB package read / spine import / patch export
504
+ 鈹? 鈹溾攢 preprocess.js # Import-time source cleaning stage
505
+ 鈹? 鈹溾攢 pre-translate.js # Block pre-translation methods
506
+ 鈹? 鈹溾攢 qa.js # Derived QA report (never persisted)
507
+ 鈹? 鈹溾攢 xlsx.js
508
+ 鈹? 鈹溾攢 pptx.js
509
+ 鈹? 鈹溾攢 segmenter.js
510
+ 鈹? 鈹溾攢 similarity.js
511
+ 鈹? 鈹溾攢 tmx.js
512
+ 鈹? 鈹溾攢 docx.js
513
+ 鈹? 鈹溾攢 markdown.js
514
+ 鈹? 鈹溾攢 xml.js
515
+ 鈹? 鈹溾攢 mt.js
516
+ 鈹? 鈹溾攢 tools.js
517
+ 鈹? 鈹斺攢 api.js
518
+ 鈹斺攢 _dev/ # tests, fixtures, local patch overlay
358
519
  ```
359
520
 
360
521
  </details>
@@ -383,11 +544,25 @@ node _dev/test-libraries.mjs
383
544
  node _dev/test-mounts.mjs
384
545
  node _dev/test-ui-scale.mjs
385
546
  node _dev/test-mt.mjs
547
+ node _dev/test-mt-routes.mjs
548
+ node _dev/test-three-state.mjs
549
+ node _dev/test-pretranslate.mjs
550
+ node _dev/test-qa.mjs
551
+ node _dev/test-library-crud.mjs
552
+ node _dev/test-library-view.mjs
553
+ node _dev/test-pagination.mjs
554
+ node _dev/test-replace.mjs
555
+ node _dev/test-notes.mjs
556
+ node _dev/test-lock.mjs
557
+ node _dev/test-segment-edit.mjs
558
+ node _dev/test-review.mjs
559
+ node _dev/test-theme-tokens.mjs
560
+ node _dev/test-e2e-1.1.mjs
386
561
  ```
387
562
 
388
563
  The import/export fixtures are `_dev/sample.docx`, `_dev/sample-table.docx`, and
389
564
  `_dev/sample-format.docx`; regenerate them with the matching
390
- `python _dev/make-*.py` scripts. All 15 suites should pass.
565
+ `python _dev/make-*.py` scripts. All 36 suites should pass.
391
566
 
392
567
  ### Releasing
393
568
 
@@ -444,13 +619,22 @@ GitHub with a release.
444
619
  - HTML/RTF export does not round-trip original styling; JSON translates string
445
620
  values only.
446
621
  - TM matching is lexical, not semantic; no stemming, synonyms, or embeddings.
447
- - Library rename/delete and per-tab mount state are not implemented yet.
622
+ - One translation per source text per context: a repeated sentence keeps a
623
+ separate variant for each surrounding pair, capped at 8 variants per key, and
624
+ reuses the generic entry when the neighbours differ.
625
+ - TM context is the two neighbouring source sentences only; the document brief
626
+ and project metadata are used by MT prompts but are not part of TM scoring.
627
+ - TBX and JSON glossary exports are one-way; only TMX and CSV import back.
448
628
  - The workbench UI ships in Chinese, English, and Japanese, switchable in
449
629
  Settings; this README ships in English, Simplified Chinese, and Japanese, and
450
630
  the English version is the source of truth.
451
631
 
452
- Planned next: image/vision input through a multimodal DSH route, richer library
453
- management, style-preserving XLSX output, and XLIFF `<alt-trans>` / notes support.
632
+ Planned next: per-document TM/glossary binding, word-count and leverage analysis,
633
+ bilingual DOCX review output, and an XLIFF review package (1.1.5); then
634
+ find/replace, segment merge/split/lock, comments, local undo (1.1.6), plus a
635
+ term-extraction overhaul that stops ranking by frequency and can surface
636
+ single-occurrence proper nouns and fiction terms, and an optional LLM review
637
+ pass (1.1.6).
454
638
 
455
639
  ## Changelog and versioning
456
640
 
@@ -458,9 +642,20 @@ See [CHANGELOG.md](CHANGELOG.md). `v1.0.0` was the first public release;
458
642
  `v1.0.1` adds the Japanese UI and the in-app interface language switch,
459
643
  `v1.0.2` makes *Follow DSH language* honour the DSH locale, `v1.0.3`
460
644
  publishes the package to npm, `v1.0.4` moves later releases to the
461
- provenance-publishing workflow, and `v1.0.5` adds EPUB, import preprocessing,
462
- and the PDF policy. The project was developed as `0.1.0` and
463
- renumbered for the GitHub release.
645
+ provenance-publishing workflow, `v1.0.5` adds EPUB, import preprocessing,
646
+ and the PDF policy, `v1.1.0` adds agent-driven pre-translation, the
647
+ three-state segment model, stacked review, and advisory QA, `v1.1.1` adds
648
+ the library workspace with TMX/TBX/CSV/JSON export, segment paging, and the
649
+ panel-to-library jump, `v1.1.2` adds context-aware memory with 101% (ICE)
650
+ matches, `v1.1.3` adds two-file alignment, automatic propagation of repeated
651
+ segments, terminology mining, and the proposal primitive agents use, and
652
+ `v1.1.4` adds the document brief, context-aware batch pre-translation,
653
+ forbidden/preferred terminology, risk-graded QA with one-click fixes,
654
+ concordance, and undo confirmation, and `v1.1.5` adds per-document TM/glossary
655
+ scopes, word-count and leverage analysis, bilingual DOCX and XLIFF review
656
+ packages, and TM maintenance.
657
+ The project
658
+ was developed as `0.1.0` and renumbered for the GitHub release.
464
659
 
465
660
  > **License:** Apache License 2.0 — see [LICENSE](LICENSE). Redistributions must
466
661
  > retain the attribution in [NOTICE](NOTICE).