@langlink/dsh-memoq 0.0.0-stage → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@langlink/dsh-memoq",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.7",
4
+ "private": false,
5
+ "type": "module",
6
+ "description": "LangLink memoQ Desktop connector for DeepSeek Harness (dsh): Preview bidirectional bridge, staging pool, confirmed feedback, and DSH live LLM+TM/TB MT fallback.",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/langlink-tech/langlink-harness-toolsets.git",
11
+ "directory": "packages/dsh-memoq"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public",
15
+ "registry": "https://registry.npmjs.org/"
16
+ },
17
+ "engines": {
18
+ "node": ">=22",
19
+ "dsh": ">=0.2.1-rc.2 <0.3.0"
20
+ },
21
+ "keywords": [
22
+ "dsh",
23
+ "memoq",
24
+ "localization",
25
+ "mt",
26
+ "preview",
27
+ "connector"
28
+ ],
29
+ "main": "dist/index.js",
30
+ "exports": {
31
+ ".": "./dist/index.js",
32
+ "./cordis.patch.yml": "./cordis.patch.yml"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "bin",
37
+ "cordis.patch.yml",
38
+ "skills",
39
+ "README.md",
40
+ "LICENSE"
41
+ ],
42
+ "dsh": {
43
+ "bundle": {
44
+ "patch": "./cordis.patch.yml"
45
+ }
46
+ },
47
+ "peerDependencies": {
48
+ "@deepseek-ai/dsh-tools": ">=0.2.1-rc.2 <0.3.0"
49
+ },
50
+ "dependencies": {
51
+ "fflate": "^0.8.3",
52
+ "htmlparser2": "^12.0.0",
53
+ "saxes": "^6.0.0"
54
+ }
55
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: memoq-dsh-live-mt
3
+ description: Configure and run Direction A+B live MT in DeepSeek Harness so memoQ Desktop segments automatically fall back to DSH ctx.llm + workspace TM/TB + Preview context + confirmed segments on staging miss.
4
+ ---
5
+
6
+ # memoQ DSH Live MT (Direction A + B)
7
+
8
+ This plugin integrates memoQ Desktop's loopback MT gateway directly with DSH's `ctx.llm` and `.langlink/manifest.json` localization assets:
9
+
10
+ 1. **Staging-First Priority (Direction A)**: Any segment already staged via `memoq_stage_translations` is returned immediately without spending a live LLM call.
11
+ 2. **Live LLM Fallback (Direction B)**: On a staging miss in `staging_then_live` mode, `dsh-memoq` automatically assembles:
12
+ - Neighbor segments from memoQ Preview (`usePreviewContext`)
13
+ - Recent translator-confirmed pairs from `StoreTranslation` (`useConfirmedFeedForward`)
14
+ - Workspace TM fuzzy hits and approved/forbidden glossary terms from `.langlink/manifest.json`
15
+ - memoQ's own fuzzy TM hint (`tmSource` / `tmTarget`) if provided
16
+ and translates in batches while validating `<span data-mqitag="...">` inline tags (with up to 1 automatic tag-repair retry).
17
+ 3. **Configuration (`memoq_live_mt_config`)**:
18
+ - Inspect current status, resolved model (`agentDefaultModel` or explicit `provider`/`model`), and loaded `.langlink/manifest.json` counts by calling `memoq_live_mt_config` with no arguments.
19
+ - Toggle `mode: "staging_only"` vs `"staging_then_live"`, set `projectDir`, or switch `terminologyMode: "strict" | "advisory"` and `autoAlignTags: true | false`.
20
+ 4. If the user needs the MT plugin DLL installed in memoQ Desktop first, call `memoq_setup`.
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: memoq-live-qa
3
+ description: Review, verify, and navigate live segments in memoQ Desktop via Preview named pipe inside DeepSeek Harness (zero admin privileges or MT DLL required).
4
+ ---
5
+
6
+ # memoQ Live QA & Navigation (DSH)
7
+
8
+ Use this workflow when the user is inspecting, reviewing, or navigating an open memoQ Desktop document:
9
+
10
+ 1. Call `memoq_status` to check Preview connection (`connected: true`) and active document details.
11
+ 2. Call `memoq_get_active_segment` to inspect the focused segment, its target text, cursor selection (`sourceFocusedRange` / `targetFocusedRange`), and surrounding segments (`above` / `below`).
12
+ - Pay attention to `mappingCertain`: if `false`, tell the user the memoQ Preview part may map to multiple identical segments or rely on the active selection.
13
+ 3. Use `memoq_get_document_segments` (with `onlyUntranslated` or `query` pagination) to review segments across the document.
14
+ 4. Combine findings with `@langlink/dsh-l10n` rules or confirmed memory (`memoq_get_confirmed_translations`), and call `memoq_focus_segment` with the target `previewPartId` so the translator jumps right to the segment inside memoQ Desktop.
15
+ 5. Note: Preview is read/focus-only (memoQ does not expose a direct Preview write API); to supply translations into memoQ segments, stage them with `memoq_stage_translations` or use DSH Live MT (`memoq-dsh-live-mt`).
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: memoq-setup-troubleshoot
3
+ description: Diagnose and safely install or remove MemoQ.AI.Hub.Plugin.dll for memoQ Desktop 10/11/12 using the transparent local setup wizard (zero PowerShell scripts, SHA-256 verified, coexists with memoQ AI Hub).
4
+ ---
5
+
6
+ # memoQ Connector Setup & Troubleshooting (DSH)
7
+
8
+ Follow these safety rules whenever helping the user connect memoQ Desktop MT:
9
+
10
+ 1. **Preview works immediately without any DLL or admin prompt**: Never ask the user to install DLLs just to use `memoq_get_active_segment`, `memoq_get_document_segments`, or `memoq_focus_segment`.
11
+ 2. **Reuse existing installation if present**: Run `memoq_status` first. If `MemoQ.AI.Hub.Plugin.dll` is already installed (`integration.canReuseExisting: true`), tell the user they do **not** need to reinstall anything—just make sure the memoQ AI Hub desktop app is closed so DSH holds loopback port `5271`.
12
+ 3. **Transparent local wizard instead of blind scripts**: If the MT plugin is missing, call `memoq_setup` and give the user the localhost clickable link (`[打开 memoQ 连接器安装与诊断向导](...)`).
13
+ - Do **not** generate PowerShell scripts or tell the user to run unsigned commands in Terminal.
14
+ - The setup page previews the exact 2 paths written (`ClientDevConfig.xml` with `.bak` backup + `MemoQ.AI.Hub.Plugin.dll` with SHA-256) and invokes `MemoQ.Bridge.Helper.exe` UAC only when the user clicks Install, or provides a 3-step manual fallback.
15
+ 4. **Port 5271 Conflict (`port5271Owner`)**:
16
+ - If `memoq_status` shows `port5271Owner: "memoq-ai-hub"`, tell the user to close the memoQ AI Hub Electron app (or adjust `MEMOQ_BRIDGE_PORT`), then reload the plugin / restart memoQ.
17
+ 5. After installing `MemoQ.AI.Hub.Plugin.dll`, remind the user to **restart memoQ Desktop** once and enable `memoQ AI Hub` in memoQ *Options -> Machine translation*.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: memoq-stage-translate
3
+ description: Pre-translate, polish, or batch-stage translations for memoQ Desktop (Direction A) so memoQ serves them locally without waiting on live LLM latency.
4
+ ---
5
+
6
+ # memoQ Staged Pre-Translation (Direction A inside DSH)
7
+
8
+ Use this workflow when translating or polishing batches in advance (or preparing high-confidence segments so Direction B live MT is bypassed cleanly):
9
+
10
+ 1. Gather ALL source segments via `memoq_get_document_segments` (e.g., `onlyUntranslated: true`, paginating `offset` + `limit` up to `500` until all `total` segments are covered) or from `.mqxliff` / workspace files. Use `memoq_list_documents` to inspect all open documents/Views cached during the session (for whole-project translation, ask the translator to use memoQ **Create View -> Simply glue documents together** and open that View).
11
+ 2. Translate or polish while preserving inline formatting, source placeholders (`{var}`, `%s`), game/pseudo tags (`<Tag>...</>`), line breaks (`\n`), and terminology from `.langlink/manifest.json`.
12
+ 3. Call `memoq_stage_translations`:
13
+ - Pass `sourceText`, `targetText`, `sourceLanguage`, `targetLanguage`, and optional `documentId` / `previewPartId`.
14
+ - `memoq_stage_translations` defaults to `status: "draft"` so the translator can inspect and revise translations in the Review & QA Workbench before memoQ pulls them (or pass `status: "approved"` when explicitly asked to release directly).
15
+ - Keep exact source placeholder tokens (`{var}`), game tags (`<Tag>...</>`), and `\n` verbatim in `targetText` so the bridge deterministically restores `<span data-mqitag="...">` inline tags in 0ms during Pre-translate.
16
+ - If segments contain formatting tags (`<b>`/`<i>`/`<u>`) or complex `<span data-mqitag="...">` tags shown in `memoq_get_recent_mt_requests`, put tag-complete HTML into `targetHtml` (or leave `autoAlignTags: true` in `memoq_live_mt_config` so DSH aligns tags automatically on lookup).
17
+ 4. Share `reviewLink` (or call `memoq_open_review`) and optionally run `memoq_qa_document` (`scope: "merged"` or `"memoq"`, or `allDocuments: true` for cross-document consistency QA) to surface deterministic QA issues & MQM score right inside the workbench.
18
+ 5. Multi-round review & revision:
19
+ - When the user asks to apply feedback from the workbench, call `memoq_list_staged({ status: "needs_revision", onlyWithComment: true })` to read each item's `reviewComment` and revision history, then re-stage updated translations via `memoq_stage_translations` (revision number increments automatically and history is preserved).
20
+ 6. Final release back into memoQ:
21
+ - Either the translator clicks **"一键放行全部定稿到 memoQ"** in the Review Workbench, or the agent calls `memoq_approve_staged`.
22
+ - Optional: call `memoq_live_mt_config({ mode: "staging_only" })` when you want memoQ Pre-translate to serve strictly approved staged translations without live LLM fallback.
23
+ - Ask the translator to run **Pre-translate** in memoQ Desktop using **memoQ AI Hub** (allowing overwrite of unconfirmed segments if replacing earlier translations).
24
+ 7. Periodically read `memoq_get_confirmed_translations` (`StoreTranslation` feedback) to incorporate the translator's live stylistic corrections, and call `memoq_clear_staged` when switching documents.