@hyperfixi/speech 3.1.0 → 3.2.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.
Files changed (2) hide show
  1. package/CHANGELOG.md +168 -0
  2. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -7,6 +7,174 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.2.0] - 2026-09-30
11
+
12
+ A correctness release for multilingual hyperscript. The semantic parser behind
13
+ `translate()`, `@lokascript/hyperscript-adapter`, MCP `translate_code` and hyperfixi's
14
+ non-English path now keeps whole programs that it used to shorten or drop: values,
15
+ conditions, loops and handler heads. Every value shape in a generated matrix of 4,205
16
+ (executed in 24 languages, directly and through the adapter, against upstream
17
+ \_hyperscript) now matches upstream, apart from two documented differences. Core
18
+ matches upstream \_hyperscript on more forms.
19
+
20
+ ### Added
21
+
22
+ - **Counted loops are written in each language's own words**: es `repetir 3 veces`,
23
+ fr `répéter 3 fois`, ja `3 回 を 繰り返し`, hi `3 बार को दोहराएं`, where translations
24
+ wrote English `times` in 18 languages and English `repeat` in the SOV six. English
25
+ `times`/`repeat` and each language's other count words (es `vez`, ru `раза`, …) still
26
+ read. 18 i18n dictionaries gain a `temporal.times` word.
27
+ - **Variable names that are words of the target language.** A variable spelled like a
28
+ structure word (es `si`, pl `w`, tr `al`) is written in parentheses, `(si)`, where the
29
+ plain translation would be misread, and read back as the variable. The language server
30
+ warns (`name-collision`, with a rename quick fix), MCP `validate_hyperscript` reports
31
+ `NAME_COLLISION`, and `translate_code` warns when a variable reads as a value word in
32
+ the target (tl `ako` is `me`). `@lokascript/semantic` exports `nameCollision`,
33
+ `findNameCollisions` and `findTranslationCollisions`.
34
+ - Event-handler modifiers (`once`, `debounced at`, `throttled at`, `from`) render in every
35
+ language and are scored by the fidelity signals.
36
+ - `of`-paths and pseudo-commands (`reset() the closest <form/>`) survive translation.
37
+ - `@lokascript/hyperscript-adapter`'s host gate also rejects a translation that reads a
38
+ reference as a handler's event (`on click on me toggle .active`, an empty click handler
39
+ plus a handler for an event named `me`), falling back to the author's text with a
40
+ warning; such a translation used to parse cleanly and do nothing.
41
+ - **Localized htmx attributes: all 23 non-English languages now cover
42
+ every attribute the _Hypermedia Systems_ book's code listings use** —
43
+ `hx-vals`, `hx-select`, `hx-swap-oob` and `hx-sync` join the Contact.app
44
+ twelve (`hx-値`, `hx-valores`, `hx-값`, `hx-werte`, `hx-選択`, `hx-selección`,
45
+ `hx-seçim`, `hx-auswahl`, `hx-sélection`, `hx-选择`, …). tr/de/fr/zh are new
46
+ in the table: the Contact.app seven they lacked (`hx-sil`, `hx-löschen`,
47
+ `hx-supprimer`, `hx-删除`, …) plus audited trigger/swap primaries following
48
+ loka-js (`hx-tetikleyici`, `hx-auslöser`, `hx-déclencheur`, `hx-替换`; the
49
+ profile words `hx-tetikle`, `hx-auslösen`, `hx-déclencher`, `hx-交换` still
50
+ resolve). de gains a lowercase `hx-ziel`: the profile's `hx-Ziel` could never
51
+ match a parsed attribute, since HTML lowercases attribute names. The other
52
+ 15 languages (ar, bn, he, hi, id, it, ms, pl, qu, ru, sw, th, tl, uk, vi)
53
+ are unreviewed drafts, every entry flagged `lowConfidence`; they also gain
54
+ the trigger heads their dictionaries left in English (ms and tl all six,
55
+ vi/he/ar some). id gains `hx-sasaran` for a target that was the English
56
+ identity; tl keeps `hx-target` on purpose. `hx-ext` is left in English on
57
+ purpose: htmx 4 removed it. The vocab table gains an `events` block for
58
+ trigger heads the i18n dictionaries do not name; ja, es, pt and ko author
59
+ the DOM `search` event (`検索`, `buscar`, `검색`), which the book's and
60
+ Contact.app's search box fires. htmx's own trigger words (`revealed`,
61
+ `every`) stay English, like the `delay:` / `from:` modifiers.
62
+ - Adapter-only vocab keys now resolve from the authored table alone, never
63
+ from a semantic profile: 22 profiles carry a `select` keyword that means
64
+ mark/highlight text (de `markieren`, tr `vurgula`), and it would otherwise
65
+ have shipped as `hx-select` in 22 unreviewed languages.
66
+
67
+ - **Localized htmx attributes: ja, es, pt and ko now cover every attribute the
68
+ _Hypermedia Systems_ Contact.app uses** — `hx-post`, `hx-delete`,
69
+ `hx-confirm`, `hx-push-url`, `hx-boost`, `hx-indicator` and `hx-include` join
70
+ the existing five (e.g. `hx-削除`, `hx-eliminar`, `hx-excluir`, `hx-삭제`).
71
+ `hx-indicator` / `hx-include` localize under `@hyperfixi/htmx-adapter` (stock
72
+ htmx implements them; the embedded layer does not).
73
+ - **Vocab aliases.** Several localized names may map to one attribute or event;
74
+ the first is the form to teach, later ones keep already-authored pages
75
+ working. Core's embedded orchestrator now reads whichever form an element
76
+ carries (it previously kept a single name per attribute).
77
+
78
+ ### Changed
79
+
80
+ - **Rendered vocabulary** (owner decisions): `null` is written `null` in ar, hi, id, qu,
81
+ sw, th and tr, where it shared the word for `empty`; hi writes `no` as `कोई नहीं`; qu
82
+ writes `and` as `hinallataq`; tl and tr write `includes` with `contains`' word (both
83
+ engines read the two as one operator).
84
+ - `@lokascript/semantic` exports its real `VERSION` (it was `0.1.0` since the first
85
+ release); browser bundles report `<version>-<bundle>`.
86
+ - MCP `translate_hyperscript` is described accurately: it uses the same semantic engine as
87
+ `translate_code`, without the verification.
88
+ - **Audited primaries for `hx-trigger` / `hx-swap`** in ja (`hx-トリガー`,
89
+ `hx-置換`), es (`hx-disparador`, `hx-intercambio`), pt (`hx-gatilho`,
90
+ `hx-troca`) and ko (`hx-교체`), following loka-js's terminology reviews. The
91
+ names that shipped before (`hx-引き金`, `hx-disparar`, …) still resolve.
92
+ - The vocab modules are regenerated against the current i18n dictionaries.
93
+ **No working name was removed** — 141 retired event names and three attribute
94
+ names are kept as aliases. One name changed meaning with its dictionary: sw
95
+ `panya_juu` is now `mouseup` (was `mouseover`).
96
+
97
+ ### Fixed
98
+
99
+ - **Translations that lost code** (semantic parse and render, in every language):
100
+ - `get` of a literal (`get "hello"`, `get 3`, `get true`) dropped the whole command; an
101
+ object literal after `get` was cut to `get {`.
102
+ - Loops keep their extent and body; `repeat until` stops; a loop keeps its index
103
+ variable, the tail after an `if` inside it, and the command after an empty loop its own
104
+ `end` closes; a count may be any value (a variable, `$n`, `it`, a possessive), where
105
+ some translations read `forever`, a silent infinite loop.
106
+ - Handler heads keep `or` events, filters and event parameters; a translated
107
+ `wait for <event>` waits instead of throwing; behaviors keep their handlers and init
108
+ blocks; an else-if chain shares one `end`.
109
+ - Values keep their comparison phrases (`is equal to`, `includes`, `is an Element`, …),
110
+ `and`/`or`/`not`, `mod`, possessive and `of` chains, object and array literals, every
111
+ conversion core supports (`as Int`, `as Fixed:2`, piped conversions), unary minus and
112
+ property paths; `true`/`false`/`null` keep their meaning.
113
+ - Commands keep `put … into <variable>`, `tell … to show`, fetch's `do not throw` and
114
+ response type, event-source/socket URLs, show/hide `with` strategies, `go`/`scroll`
115
+ positions, `${…}` URLs, core's `has`, and a class query's `in` scope.
116
+ - **`@hyperfixi/core` follows upstream \_hyperscript**:
117
+ - `X of Y` binds as property access, and the X of a null target is null.
118
+ - `increment` reads its amount and counter as upstream does, and writing an object's
119
+ property through `'s`/`of` works.
120
+ - A loop's count reads as upstream's `index < times` does: `"6.5"` loops 7 times and
121
+ `"6abc"` none, in the full runtime and in the hybrid bundles (`hyperfixi-hx.js`,
122
+ plugin bundles), which read `parseInt`.
123
+ - Blocks close at the end of input; `morph … to`; `render … with name: value`; `beep!`
124
+ as an expression; `transition`'s owners, several properties, `from` and `using`; three
125
+ handler forms from _Hypermedia Systems_; four upstream-valid forms that compiled and
126
+ then failed at run time; `.item in #list` keeps its scope; `on click once` fires on
127
+ the first click.
128
+ - htmx: camelCase event names survive an attribute name.
129
+ - MCP: the validators report what the parsers actually did.
130
+ - The AOT compiler (experimental): loops were compiled to `while (true)`; targets,
131
+ property access, scoped queries, `empty` and variable scope now compile to what they
132
+ mean.
133
+ - `@lokascript/hyperscript-adapter` and `@hyperscript-tools/multilingual` READMEs: the
134
+ Japanese quickstart example was a dead button, and the multi-language example loaded
135
+ only the Spanish bundle; the examples are now native and run in a test. Bundle sizes are
136
+ measured.
137
+ - Bare CDN URLs now serve a browser bundle: `unpkg.com/@lokascript/hyperscript-adapter@3` (and
138
+ jsDelivr) served `dist/index.cjs`, which throws in a `<script>` tag. The adapter,
139
+ `@hyperscript-tools/multilingual`, `@lokascript/semantic`, `@hyperfixi/core` and
140
+ `@lokascript/htmx-adapter` declare `unpkg`/`jsdelivr` entries.
141
+ - `hyperfixi-multilingual.js`'s error names the semantic bundle that exists (the full
142
+ `browser.global.js`, the only one that defines `LokaScriptSemantic`).
143
+ - READMEs: `@lokascript/i18n` no longer claims to translate (and its `/lsp` export and CLI,
144
+ which do not exist, are gone); `@lokascript/semantic`, `@hyperfixi/vite-plugin` and
145
+ `@hyperfixi/core` have correct package names, API calls, language lists (24) and measured
146
+ bundle sizes.
147
+ - Dependencies: the js-yaml and smol-toml advisories; Vite 8, vitest 5 and happy-dom 20.14.
148
+ - **Vietnamese `hx-get` / `hx-target` / `hx-swap` / `hx-trigger` / `sse-swap`
149
+ never worked**: the names were emitted with spaces (`hx-lấy giá trị`), which
150
+ HTML reads as three attributes. They are now hyphen-joined
151
+ (`hx-lấy-giá-trị`), like vi's existing `hx-trực-tiếp`.
152
+ - 29 multi-word event names (ar, vi) were removed from the vocab modules: an
153
+ event is a single token of an `hx-trigger` value, so they could never match.
154
+
155
+ ## [3.1.1] - 2026-09-04
156
+
157
+ ### Fixed
158
+
159
+ - **`@hyperfixi/mcp-server` no longer installs two copies of the contract
160
+ packages.** 3.1.0 pinned `@lokascript/domains ^2.11.1`, whose framework /
161
+ semantic / intent were hard 2.x dependencies — a clean install got 3.1.0 at
162
+ the top level and 2.11.1 nested under domains, and every `DomainRegistry` /
163
+ schema singleton forked across that boundary. mcp-server, framework and
164
+ server-bridge now range on `@lokascript/domains ^3.0.0`, which peers on
165
+ framework 3.x instead.
166
+
167
+ ### Added
168
+
169
+ - **`scripts/check-domains-peer-major.cjs`** — the cross-repo guard for that
170
+ class: the domains version the lockfile pins must PEER (not depend) on
171
+ framework / semantic / intent at a range the version this repo publishes
172
+ satisfies. Runs in `lint-typecheck`, first thing in `publish.yml` after the
173
+ version bump, and from the pre-commit hook. `examples/release-smoke/run.mjs`
174
+ additionally asserts one installed copy of each contract package, and
175
+ Dependabot now gives `@lokascript/domains` its own PR group so a domains
176
+ release is visible on its own instead of riding the weekly tooling PR.
177
+
10
178
  ## [3.1.0] - 2026-09-04
11
179
 
12
180
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperfixi/speech",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "description": "Speech Synthesis and prompt() plugin for hyperfixi — adds `speak`, `ask`, and `answer` commands (upstream _hyperscript 0.9.90).",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -23,14 +23,14 @@
23
23
  "typecheck": "tsc --noEmit"
24
24
  },
25
25
  "dependencies": {
26
- "@hyperfixi/core": "^3.1.0"
26
+ "@hyperfixi/core": "^3.2.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "^26.1.2",
30
- "happy-dom": "^20.10.6",
29
+ "@types/node": "^26.6.3",
30
+ "happy-dom": "^20.14.5",
31
31
  "tsup": "^8.0.0",
32
32
  "typescript": "^5.0.0",
33
- "vitest": "^4.1.5"
33
+ "vitest": "^5.0.2"
34
34
  },
35
35
  "files": [
36
36
  "dist",