@sonenta/cli 0.20.0 → 0.21.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/dist/index.js +34 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command as Command17 } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@sonenta/cli",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.21.0",
|
|
10
10
|
description: "Command-line interface for Sonenta translation management.",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
homepage: "https://sonenta.com",
|
|
@@ -171,9 +171,12 @@ ${PREFLIGHT}## Requirements
|
|
|
171
171
|
otherwise), 0 credits, no AI. The authoritative way to populate scores; scope
|
|
172
172
|
with \`key_uuids\` / \`namespace_uuid\`, \`overwrite\` to re-score.
|
|
173
173
|
- \`set_cognitive_score\` \u2014 record ONE key's cognitive difficulty score (0-100)
|
|
174
|
-
|
|
175
|
-
(by_bot).
|
|
176
|
-
|
|
174
|
+
PLUS a plain-language \`suggestion\` (your own rewrite), CRUD, **0 AI credits**
|
|
175
|
+
(by_bot). The \`suggestion\` is what populates \`keys.cognitive_suggestion\` \u2014
|
|
176
|
+
the dashboard's "Plain language" / cognitive tab \u2014 so it must be set whenever
|
|
177
|
+
you simplify a key (see **Plain language**), NOT just the score. Prefer
|
|
178
|
+
\`score_cognitive_local\` to populate the scores themselves; use this for the
|
|
179
|
+
suggestion (and a score when scoring locally).
|
|
177
180
|
- \`list_keys\` \u2014 read each key's semantic \`type\` (and source value) to audit
|
|
178
181
|
typing. READ-ONLY.
|
|
179
182
|
- \`update_key\` / \`update_keys_bulk\` \u2014 reclassify a mis-typed key (type-only,
|
|
@@ -197,16 +200,33 @@ ${PREFLIGHT}## Requirements
|
|
|
197
200
|
a11y values are SEMANTIC (the accessible name / alt / simplified wording for
|
|
198
201
|
assistive tech), not the visible UI string \u2014 keep them concise and meaningful.
|
|
199
202
|
|
|
203
|
+
## Plain language \u2014 write the variant AND \`cognitive_suggestion\` (both, always)
|
|
204
|
+
A plain-language simplification lives in TWO places that must stay consistent:
|
|
205
|
+
the \`plain_language\` a11y VARIANT (per locale) and the key's
|
|
206
|
+
\`cognitive_suggestion\` field (the dashboard's "Plain language" / cognitive
|
|
207
|
+
tab). Writing only the variant leaves that tab empty even though the overlay
|
|
208
|
+
exists. So whenever you simplify a key, do BOTH \u2014 at **0 credits**:
|
|
209
|
+
1. \`set_a11y_variant(key_uuid, language_code, "plain_language", <simplified>)\`
|
|
210
|
+
for each locale you simplify (the source locale first, then translations).
|
|
211
|
+
2. \`set_cognitive_score(key_uuid, score, suggestion=<simplified SOURCE-language
|
|
212
|
+
text>)\` \u2014 the \`suggestion\` is the simplified text in the SOURCE language (i.e.
|
|
213
|
+
exactly the source locale's \`plain_language\` value), so the cognitive tab
|
|
214
|
+
shows the proposed rewrite and matches the overlay. (Score it with
|
|
215
|
+
\`score_cognitive_local\` or your own 0-100 judgement.)
|
|
216
|
+
Both are drafts for human approval; never approve them yourself.
|
|
217
|
+
|
|
200
218
|
## Gap types and how you resolve each (locally, by yourself)
|
|
201
219
|
- \`a11y_variant_absent\` \u2014 a required surface is missing in the source \u2192 compose
|
|
202
220
|
it yourself and \`set_a11y_variant\` (source language).
|
|
203
221
|
- \`alt_missing\` \u2014 an image key has no source alt_text \u2192 write \`alt_text\`.
|
|
204
222
|
- \`reading_level_high\` \u2014 flagged when a key's COGNITIVE SCORE is at/above the
|
|
205
223
|
project threshold. Populate scores with \`score_cognitive_local\` (validated
|
|
206
|
-
Flesch-Kincaid / LIX, 0 credits), then
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
224
|
+
Flesch-Kincaid / LIX, 0 credits), then simplify the hard ones \u2014 writing BOTH
|
|
225
|
+
the \`plain_language\` variant (\`set_a11y_variant\`) AND the
|
|
226
|
+
\`cognitive_suggestion\` (\`set_cognitive_score(key_uuid, score, suggestion)\`)
|
|
227
|
+
with the same simplified SOURCE-language text, per **Plain language** (0
|
|
228
|
+
credits, drafts). Don't write one without the other, or the cognitive tab and
|
|
229
|
+
the overlay disagree.
|
|
210
230
|
- \`a11y_untranslated\` \u2014 a source a11y variant exists but a locale lacks it \u2192
|
|
211
231
|
TRANSLATE it yourself and \`set_a11y_variant\` for that \`language_code\`.
|
|
212
232
|
|
|
@@ -301,10 +321,12 @@ phase and the wrap-up.
|
|
|
301
321
|
(\`update_key\` / \`update_keys_bulk\`), then write each accepted a11y value
|
|
302
322
|
with \`set_a11y_variant(key_uuid, language_code, surface, value)\` (for
|
|
303
323
|
\`a11y_untranslated\`, translate the source variant into the target
|
|
304
|
-
\`language_code\` yourself first)
|
|
305
|
-
\`set_cognitive_score(key_uuid, score,
|
|
306
|
-
|
|
307
|
-
|
|
324
|
+
\`language_code\` yourself first). For every plain-language simplification write
|
|
325
|
+
BOTH the \`plain_language\` variant AND \`set_cognitive_score(key_uuid, score,
|
|
326
|
+
suggestion=<simplified SOURCE text>)\` so the cognitive tab matches the overlay
|
|
327
|
+
(see **Plain language**) \u2014 never just one. Work in sensible batches, narrate
|
|
328
|
+
progress, skip whatever the dev declined. All 0 credits, all drafts. If reality
|
|
329
|
+
diverges from the plan mid-execution, STOP and re-present.
|
|
308
330
|
8. **Server fallback (opt-in only).** If the volume is impractical locally, or the
|
|
309
331
|
dev explicitly wants server-side AI, FIRST \`a11y_estimate\` (report
|
|
310
332
|
\`credits_required\` vs \`balance\`; stop if not \`sufficient\`), confirm, THEN
|