@sonenta/cli 0.19.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 +39 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
- package/bin/verbumia.js +0 -11
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",
|
|
@@ -29,8 +29,7 @@ var package_default = {
|
|
|
29
29
|
author: "Sonenta",
|
|
30
30
|
type: "module",
|
|
31
31
|
bin: {
|
|
32
|
-
sonenta: "bin/sonenta.js"
|
|
33
|
-
verbumia: "bin/verbumia.js"
|
|
32
|
+
sonenta: "bin/sonenta.js"
|
|
34
33
|
},
|
|
35
34
|
main: "./dist/index.js",
|
|
36
35
|
types: "./dist/index.d.ts",
|
|
@@ -172,9 +171,12 @@ ${PREFLIGHT}## Requirements
|
|
|
172
171
|
otherwise), 0 credits, no AI. The authoritative way to populate scores; scope
|
|
173
172
|
with \`key_uuids\` / \`namespace_uuid\`, \`overwrite\` to re-score.
|
|
174
173
|
- \`set_cognitive_score\` \u2014 record ONE key's cognitive difficulty score (0-100)
|
|
175
|
-
|
|
176
|
-
(by_bot).
|
|
177
|
-
|
|
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).
|
|
178
180
|
- \`list_keys\` \u2014 read each key's semantic \`type\` (and source value) to audit
|
|
179
181
|
typing. READ-ONLY.
|
|
180
182
|
- \`update_key\` / \`update_keys_bulk\` \u2014 reclassify a mis-typed key (type-only,
|
|
@@ -198,16 +200,33 @@ ${PREFLIGHT}## Requirements
|
|
|
198
200
|
a11y values are SEMANTIC (the accessible name / alt / simplified wording for
|
|
199
201
|
assistive tech), not the visible UI string \u2014 keep them concise and meaningful.
|
|
200
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
|
+
|
|
201
218
|
## Gap types and how you resolve each (locally, by yourself)
|
|
202
219
|
- \`a11y_variant_absent\` \u2014 a required surface is missing in the source \u2192 compose
|
|
203
220
|
it yourself and \`set_a11y_variant\` (source language).
|
|
204
221
|
- \`alt_missing\` \u2014 an image key has no source alt_text \u2192 write \`alt_text\`.
|
|
205
222
|
- \`reading_level_high\` \u2014 flagged when a key's COGNITIVE SCORE is at/above the
|
|
206
223
|
project threshold. Populate scores with \`score_cognitive_local\` (validated
|
|
207
|
-
Flesch-Kincaid / LIX, 0 credits), then
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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.
|
|
211
230
|
- \`a11y_untranslated\` \u2014 a source a11y variant exists but a locale lacks it \u2192
|
|
212
231
|
TRANSLATE it yourself and \`set_a11y_variant\` for that \`language_code\`.
|
|
213
232
|
|
|
@@ -302,10 +321,12 @@ phase and the wrap-up.
|
|
|
302
321
|
(\`update_key\` / \`update_keys_bulk\`), then write each accepted a11y value
|
|
303
322
|
with \`set_a11y_variant(key_uuid, language_code, surface, value)\` (for
|
|
304
323
|
\`a11y_untranslated\`, translate the source variant into the target
|
|
305
|
-
\`language_code\` yourself first)
|
|
306
|
-
\`set_cognitive_score(key_uuid, score,
|
|
307
|
-
|
|
308
|
-
|
|
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.
|
|
309
330
|
8. **Server fallback (opt-in only).** If the volume is impractical locally, or the
|
|
310
331
|
dev explicitly wants server-side AI, FIRST \`a11y_estimate\` (report
|
|
311
332
|
\`credits_required\` vs \`balance\`; stop if not \`sufficient\`), confirm, THEN
|
|
@@ -1960,6 +1981,10 @@ function renderManagedBlock(d) {
|
|
|
1960
1981
|
" }",
|
|
1961
1982
|
"}",
|
|
1962
1983
|
"```",
|
|
1984
|
+
"",
|
|
1985
|
+
"The server targets `" + DOC_API_HOST + "` by default; set `SONENTA_BASE_URL` (or `SONENTA_API_BASE`) in `env` to retarget a",
|
|
1986
|
+
"self-host or staging deployment. The API key may be omitted from `env` if you have run",
|
|
1987
|
+
"`sonenta login` \u2014 the server then reads it from `~/.sonenta/credentials`.",
|
|
1963
1988
|
BLOCK_END,
|
|
1964
1989
|
""
|
|
1965
1990
|
];
|