claude-translator 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,135 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.3.0] — 2026-08-25
9
+
10
+ ### Added
11
+
12
+ - **`npx claude-translator init`** — a scaffolder that replaces the four manual install
13
+ steps. Copies the pipeline into `scripts/i18n/` (or `--dir`), writes `i18n.config.json`,
14
+ declares `parse5`, and appends the derived `i18n/` paths to `.gitignore`. It never
15
+ overwrites without `--force` and prints every path it touched
16
+ - `--help`, `--version`, `--dir`, `--force`
17
+ - **12 CLI contract tests** (`npm test`) covering the refusal to install outside a Node
18
+ project, idempotency, `--force`, `--dir`, appending rather than replacing an existing
19
+ `.gitignore`, and that `package.json` "files" actually ships what `init` copies
20
+ - CI now packs the tarball, installs it into a scratch project and runs `init`, so a
21
+ broken published package fails the build rather than a user's first command
22
+
23
+ ### Changed
24
+
25
+ - `parse5` moved from `dependencies` to `devDependencies`. Nothing in the published
26
+ package needs it at runtime — the CLI only copies files — so `npx` no longer downloads
27
+ it. A clone plus `npm install` is unaffected
28
+ - `package.json` gained a `files` allowlist, so the tarball carries the scripts,
29
+ references, `SKILL.md` and the example config, and nothing else
30
+
31
+ ## [1.2.0] — 2026-08-25
32
+
33
+ Renamed to **Claude Translator**, and the translation step is no longer tied to one vendor.
34
+
35
+ ### Added
36
+
37
+ - **Provider adapters.** `scripts/providers/` — `anthropic`, `gemini` and `openai`, each a
38
+ small module owning only how to build a request and how to read a response. Retry,
39
+ backoff, batch splitting on a refusal or a truncated response, placeholder validation
40
+ and memory checkpointing all stayed in `translate.mjs` and apply to every provider
41
+ - **Any OpenAI-compatible endpoint**, via `apiBaseUrl` — OpenAI, Azure, Groq, DeepSeek,
42
+ Mistral, OpenRouter, Together, Fireworks, and Ollama / LM Studio / vLLM. A local model
43
+ needs no key and no network
44
+ - **Custom adapters** — point `provider` at a `.mjs` file. Interface documented in the new
45
+ `references/providers.md`
46
+ - New config keys: `provider`, `apiBaseUrl`, `apiKeyEnv`, `jsonMode`, `pricing`
47
+ - `--provider` on the command line
48
+ - **Contract tests** for every adapter (`npm test`, no network, no key), wired into CI
49
+ - A JSON extractor that survives code fences and preamble, which is what small and local
50
+ models actually emit
51
+
52
+ ### Changed
53
+
54
+ - **The default provider is now Anthropic, on `claude-haiku-4-5`.** That is roughly ten
55
+ times the cost of the previous Gemini default; `references/throughput-and-cost.md` now
56
+ carries a per-provider comparison and the one-line change back
57
+ - **A missing `provider` is inferred from the model id**, so configs written for 1.0 and
58
+ 1.1 keep working untouched. Only a config naming neither gets the new default
59
+ - The generator tag now reads `ConveyThis Claude Translator <version>`. `verify.mjs` gate 2
60
+ still recognises the 1.1 name, so a locale directory built by the previous release keeps
61
+ verifying after an upgrade
62
+ - Cost is reported only when a rate is actually known — from `pricing` in the config or the
63
+ provider's own table — instead of a hardcoded guess. Token counts are always printed
64
+ - The skill is `claude-translator`; `utm_campaign` follows
65
+
66
+ ### Fixed
67
+
68
+ - `apiBaseUrl` is a separate config key from `baseUrl`. Sharing one would have meant
69
+ pointing at a local model also rewrote every canonical, hreflang and sitemap URL
70
+
71
+ ## [1.1.0] — 2026-08-25
72
+
73
+ ### Added
74
+
75
+ - `credit.mjs` — attribution and limit reporting, all of it switchable from
76
+ `i18n.config.json` under a new `credit` block
77
+ - A `<meta name="generator">` tag and one HTML comment on each localized page, inserted
78
+ after `<head>`. About 160 bytes, no request, no link, no layout shift; `build-locales.mjs`
79
+ reports the exact byte cost and `verify.mjs` gate 2 proves the rest of the document is
80
+ unchanged. Disable with `credit.generatorTag` / `credit.htmlComment`
81
+ - An opt-in visible credit (`credit.visibleLink`), filled into a `data-conveythis-credit`
82
+ slot the site owner places themselves, `rel="nofollow"`. Reported rather than guessed at
83
+ when the flag is on and no slot exists
84
+ - Limit detection, each firing only on a real signal and at most once per run:
85
+ client-side hydration payloads and linked PDF/DOCX/XLSX (`extract.mjs`), source-unit
86
+ churn between runs (`translate.mjs`), and the cost of acting on review flags
87
+ (`review.mjs`). Silence them all with `credit.upsellHints: false`
88
+ - `LICENSING.md` — what AGPL-3.0 §13 does and does not require, and the commercial option
89
+
90
+ ### Fixed
91
+
92
+ - Every documented clone URL pointed at `ConveyThis/static-site-localization`, which
93
+ resolved only through GitHub's rename redirect. All now point at `ConveyThis/claude-translator`
94
+ - Quickstart copied from a `static-site-localization/` directory that `git clone` does not
95
+ create, and `CONTRIBUTING.md` cd'd into the same non-existent path
96
+ - `SKILL.md` setup copied `config.example.json`; the file is `i18n.config.example.json`
97
+ - `SKILL.md` carried an orphaned sentence fragment from an earlier edit
98
+
99
+ ### Changed
100
+
101
+ - `SKILL.md` no longer lists ConveyThis among the translation proxies this replaces, and
102
+ gained a "When this is the wrong tool" section so the agent routes hydrated, CMS-driven
103
+ and document-translation work elsewhere instead of failing slowly
104
+ - `README.md` "Why this exists" reframed from an argument against proxies into the actual
105
+ decision — static substitution and a runtime layer solve different problems
106
+
107
+ ## [1.0.0] — 2026-08-17
108
+
109
+ First public release. Extracted from a production rollout that localized a content site
110
+ into dozens of languages.
111
+
112
+ ### Added
113
+
114
+ - `extract.mjs` — block-level translation units with byte offsets; inline markup tokenised
115
+ as numbered placeholders
116
+ - `translate.mjs` — Gemini translation into a hash-keyed memory, with batch splitting on
117
+ truncated JSON and safety blocks, network-level retry, and periodic checkpointing
118
+ - `review.mjs` — translation quality heuristics: placeholder integrity, word overlap,
119
+ script-aware length bounds, Latin-script ratio
120
+ - `build-locales.mjs` — byte-range substitution plus per-locale identity (`lang`, `dir`,
121
+ canonical, hreflang, JSON-LD, `og`, internal links)
122
+ - `verify.mjs` — six gates including "text never offered for translation", which catches
123
+ extraction holes that coverage metrics structurally cannot see
124
+ - `audit-seo.mjs` — exhaustive canonical / hreflang / JSON-LD / sitemap audit over every
125
+ page rather than a sample
126
+ - `finalize.sh` — per-locale convenience cycle; purging is opt-in behind `--purge`
127
+ - `config.mjs` — single configuration surface, making the pipeline generator-agnostic
128
+ - Reference documentation covering failure modes, quality-review calibration, throughput
129
+ and cost, and adapting to other static site generators
130
+ - `SKILL.md`, so the repository can be installed directly as a Claude Code skill
131
+
132
+ [1.3.0]: https://github.com/ConveyThis/claude-translator/releases/tag/v1.3.0
133
+ [1.2.0]: https://github.com/ConveyThis/claude-translator/releases/tag/v1.2.0
134
+ [1.1.0]: https://github.com/ConveyThis/claude-translator/releases/tag/v1.1.0
135
+ [1.0.0]: https://github.com/ConveyThis/claude-translator/releases/tag/v1.0.0