@lokascript/planner 3.3.0 → 4.0.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 +162 -0
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,168 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.0.0] - 2026-10-04
11
+
12
+ `@hyperfixi/core`'s own hyperscript engine is gone: its root re-exports `@hyperfixi/engine`, and
13
+ its `hyperfixi.js` is the engine's 34 KB script-tag bundle where core's ~352 KB bundle used to be.
14
+ The engine follows upstream `_hyperscript`'s grammar and is gated by upstream's own test suite, so
15
+ scripts in core-only syntax need upstream's spelling (two additions stay: `new X()` and
16
+ `toggle <element>`). Core's other bundles, its htmx layer, the core-era plugin packages and the
17
+ AOT compiler retire: htmx 4 or fixi supply hypermedia attributes beside the engine, and
18
+ `@lokascript/hyperscript-adapter` runs hyperscript written in other languages. Every package moves
19
+ to 4.0.0 together. Everything under **Removed** is breaking, as is each **Changed** item marked ⚠;
20
+ [MIGRATION.md](MIGRATION.md) names each replacement.
21
+
22
+ ### Removed
23
+
24
+ - **Core's engine and its API** (#1368). These root exports had no engine counterpart:
25
+ `hyperscript` (`compile`, `compileSync`, `compileAsync`, `eval`, `validate`), `lokascript`,
26
+ `Runtime`, `RuntimeBase`, `createContext` and the element-scope helpers, `installPlugin`,
27
+ `getParserExtensionRegistry`, `setGlobal`, `DebugController`, `validatePartialContent` and its
28
+ helpers, `fromCoreAST` / `toCoreAST`. `parse` is now the engine's. The root is ESM-only, like the
29
+ engine: `dist/index.cjs` and the UMD `dist/index.min.js` (`LokaScriptCore`) are gone, though the
30
+ kept subpaths still ship CommonJS.
31
+ - **21 of core's 29 entry points**: `/commands`, `/expressions`, `/parser/*`, `/behaviors`,
32
+ `/bundle-generator`, `/registry/*`, `/lse`, and `/browser/` `hybrid-complete`, `hybrid-hx`,
33
+ `hybrid-hx-v4`, `multilingual`, `modular` (#1343–#1368). Instead of `/commands`, import the
34
+ grammar modules from the root: `import { toggle } from '@hyperfixi/core'`.
35
+ - **Core's browser bundles** (#1348, #1350, #1352, #1368): `hyperfixi-hx.js`,
36
+ `hyperfixi-hx-v4.js`, `hyperfixi-hybrid-complete.js`, `hyperfixi-multilingual.js`,
37
+ `hyperfixi-classic-i18n.js` and the code-split `hyperfixi.mjs`, plus every alias
38
+ (`hyperfixi-browser.js`, `hyperfixi-hybrid-hx.js`, each `lokascript-*.js`). Only
39
+ `hyperfixi.js` remains. CDN URLs pinned to 3.x keep working.
40
+ - **Core's embedded htmx layer** (#1342, #1348, #1350): `hx-*` and fixi `fx-*` on core's runtime,
41
+ `hx-live`, `sse-connect` / `sse-swap`, `ws-connect` / `ws-send`. Load htmx 4 or fixi beside the
42
+ engine. `hx-live` becomes the engine's `live` block, and SSE and WebSockets are htmx 4's
43
+ `hx-sse` / `hx-ws`.
44
+ - **Core-only members of `window.hyperfixi`**: `compile`, `compileSync`, `execute`, `setLocale`,
45
+ `evalLSENode`, `debugControl`, `semanticDebug`, the `hyperfixi:semantic-parse` event,
46
+ `hyperfixi:debug` logging, `_hyperscript.behaviors.resolve`, and the deprecated
47
+ `window.lokascript` (#1352, #1355).
48
+ - **Core-only hyperscript syntax** (#1346, #1363, #1365). The engine rejects `has` / `have`,
49
+ `prepend`, `copy`, `push url` / `replace url`, `process partials`, the `pseudo` keyword, prefix
50
+ `unless`, bare `beep`, `a ? b : c`, core's `swap <strategy> of X with Y`, `set @a to v on X`,
51
+ `.debounce(n)` / `.throttle(n)`, `my?.x` and `tell X to …`. A few forms still parse but no longer
52
+ do what they did, such as `toggle .a on this` and `go forward`. MIGRATION.md gives each form's
53
+ upstream spelling. The multilingual reader still accepts them all.
54
+ - **`@hyperfixi/core/multilingual`'s class API** (#1345, #1368): `MultilingualHyperscript` (with
55
+ `parseToAST`, `getAllTranslations`, …), `getMultilingual`, `multilingual`, `LanguageInfo`,
56
+ `schemaRoleInferrer`. The entry is three async functions: `parse`, `render`, `translate`.
57
+ - **The AOT compiler** (#1364). Its output ran only on a runtime that was never published.
58
+ `@lokascript/compilation-service` loses `compile()`, `POST /compile`, `CompileResponse`, the
59
+ compile cache (`SemanticCache`, `getCacheStats`, `clearCache`, `/cache`), `generateTests`'
60
+ `executionMode` and `generate()`'s `'js'` target. `generate()` now requires `target`
61
+ (`react` | `vue` | `svelte` | `intent-element`). `@hyperfixi/mcp-server` loses
62
+ `compile_hyperscript`, `execute_lse`, `lse_to_hyperscript`'s `compile` option and
63
+ `generate_tests`' `executionMode`, leaving 106 tools. The loop is now `validate_and_compile`
64
+ (name kept), then repair, then the hyperscript as is in `_="…"`.
65
+ - **`@hyperfixi/vite-plugin`'s compile mode** (#1360). `mode: 'compile'` warns and builds the
66
+ engine bundle. The exports `CompiledHandler`, `CompileOptions` and
67
+ `set/clear/hasSemanticParser` are removed.
68
+ - **Smaller removals.** `@hyperfixi/core/reference` loses `availability`, `BundleAvailability`
69
+ and `getCommandsByAvailability` (#1363). `@hyperfixi/speech` loses `speechPlugin`,
70
+ `speakCommand`, `askCommand` and `answerCommand`; the engine has `ask` / `answer` (#1358).
71
+ `@hyperfixi/intent-element` loses its `evalLSENode` fallback (#1356).
72
+ `@hyperfixi/patterns-reference` loses four rows that held only retired htmx attributes, and
73
+ `hx-live-with-mutator` is renamed `live-with-handler` (#1348). Of the never-published VS Code
74
+ extensions, the LokaScript one loses its debugger and the standalone `_hyperscript` one is
75
+ retired (#1361).
76
+
77
+ ### Deprecated
78
+
79
+ - **`@hyperfixi/reactivity`, `@hyperfixi/realtime`, `@hyperfixi/components`**: deprecated on npm,
80
+ last version 3.3.0 (#1358). Use the engine's built-in `live` / `when` / `bind`, htmx 4's
81
+ `hx-sse` / `hx-ws`, and upstream's component extension.
82
+ - **`@hyperfixi/types-browser`'s `LokaScriptCoreAPI`**: a deprecated alias of `HyperfixiAPI`
83
+ (#1356).
84
+
85
+ ### Changed
86
+
87
+ - ⚠ **`@hyperfixi/core` is the engine plus tooling** (#1368). The root is
88
+ `export * from '@hyperfixi/engine'` and `VERSION`: `register`, `everything` and each grammar
89
+ module, `api`, `parse`, `evaluate`, `processNode`, `boot`, and the AST types. The engine stays
90
+ external, so both packages share one grammar. Kept: `/multilingual`, `/ast-utils`,
91
+ `/reference`, `/metadata`, `/lsp-metadata`, `/browser`.
92
+ - ⚠ **`hyperfixi.js` (`@hyperfixi/core/browser`) is the engine's `hyperfixi-hs.js`**, byte for
93
+ byte: 34 KB gzipped instead of ~352 KB (#1355). `window.hyperfixi` is `window._hyperscript`,
94
+ upstream-shaped (`evaluate`, `parse`, `process`, `use`, `config`, `addSourceTransform`). Parse
95
+ errors are a `hyperscript:parse-error` event on the element plus a `console.error` (#1354).
96
+ - ⚠ **Runtime semantics follow upstream** wherever core's differed. `swap #a with #b` exchanges
97
+ the elements; `show` / `hide … with *opacity` honour the strategy; `tell` binds `you`, not `me`;
98
+ `set` on a selector sets every match; and `no ""` is true. MIGRATION.md has the full list.
99
+ - ⚠ **`@hyperfixi/vite-plugin` emits a bundle on `@hyperfixi/engine`** (#1343). There is one
100
+ tier: the grammar modules the scan finds. It weighs 17.9 KB gzipped for three commands (3.x lite:
101
+ 3.9 KB) and 34.4 KB for everything; 3.x fell back to 352 KB on `fetch`. htmx is not bundled.
102
+ Non-English scripts are translated as the engine reads them. `devFallback: 'everything'` is new,
103
+ and `'full'` / `'hybrid-complete'` mean the same. The plugin no longer depends on core.
104
+ - ⚠ **`@hyperfixi/behaviors` runs on the engine** (peer `@hyperfixi/engine`; upstream works too).
105
+ Each behavior is defined with `host.evaluate(source)` and written in upstream's idioms.
106
+ Toggleable's `target` parameter is now `targetEl`. `LokaScriptInstance` / `LokaScriptWindow`
107
+ are now `HyperscriptHost` / `HyperscriptWindow` (#1338).
108
+ - ⚠ **`@hyperfixi/speech` is an engine module** (#1358). Install it with
109
+ `register(...everything, speak)`. It is ESM-only and peers on the engine. `speak` takes
110
+ upstream's syntax (`speak <text> [with voice|rate|pitch|volume <x>]…`) and waits for the
111
+ utterance to end.
112
+ - ⚠ **The localized htmx vocabulary moved** from `@hyperfixi/core/vocab/htmx/{lang}.js` to
113
+ `@lokascript/htmx-adapter/vocab/{lang}.js`; the data is unchanged (#1349).
114
+ - **`@hyperfixi/intent-element`** renders an intent to English with the page's semantic bundle
115
+ and runs it through the host's `evaluate` (`NO_RENDERER` without one). It peers on
116
+ `@hyperfixi/engine` and `@lokascript/semantic` (#1339, #1356).
117
+ - **`@lokascript/semantic` writes upstream's spelling in English** for core-only forms (#1346).
118
+ For example, `has` becomes `matches`, `prepend` becomes `put … at start of`, and swap strategies
119
+ become `put … into` / `before` / `after`. This reaches `translate(…, 'en')`,
120
+ `render(node, 'en')`, both adapters and MCP `translate_to_english`. In `fromSemanticAST`, a
121
+ handler's `then` chain is now its body (#1359).
122
+ - **The language tools read the engine's parse** (#1356, #1359, #1365).
123
+ `@lokascript/language-server` and MCP `validate_hyperscript` report the engine's errors
124
+ (`source: 'engine'`). Hover and symbols come from `@lokascript/semantic`, and some long handlers
125
+ show fewer commands than in 3.x. Hyperscript mode flags exactly `new X()` and `toggle <element>`.
126
+ `@lokascript/compilation-service` rejects natural-language input the engine cannot read
127
+ (`ENGINE_PARSE_ERROR`), and its generated Playwright tests load `hyperfixi-hs.js`. The language
128
+ server, the MCP server and the compilation service now peer on `@hyperfixi/engine`.
129
+ - **MCP**: `get_bundle_config` recommends `hyperfixi-hs.js`, plus an `adapter` field for
130
+ non-English. `analyze_complexity` / `analyze_metrics` no longer count every comparison as a
131
+ decision. The `debug_*` tools point to `log` and `breakpoint`. `UNSUPPORTED_QUERY_LITERAL` is
132
+ gone (#1350, #1352, #1359, #1361, #1364).
133
+ - **`@hyperfixi/core/reference`, `/lsp-metadata`, `/metadata` describe the engine** (#1355,
134
+ #1363). They cover its 53 commands, adding `for`, `ask`, `answer` and `beep!`. Examples are in
135
+ upstream spelling and each is checked to parse; descriptions of core-only semantics (`pick`,
136
+ `beep`, `swap`) are fixed. `FEATURE_KEYWORDS` gains `install`, `when`, `live` and `bind`, and
137
+ `bundleInfo` holds one row.
138
+ - **Dependencies.** `@lokascript/i18n`, `@hyperfixi/testing-framework`, `@hyperfixi/vite-plugin`,
139
+ `@hyperfixi/behaviors`, `@hyperfixi/speech` and `@hyperfixi/intent-element` no longer depend
140
+ on core. Core drops `@lokascript/intent`, morphlex, tslib and its optional peers. Versions are
141
+ lockstep, so upgrade `@hyperfixi/*` and `@lokascript/*` together. `@hyperfixi/mcp-server`,
142
+ `@lokascript/framework` (tests) and `@hyperfixi/server-bridge` (tests) range on
143
+ `@lokascript/domains ^3.0.1`, the first domains release whose peers accept framework,
144
+ semantic and intent 4.x (`^3.1.0 || ^4.0.0`).
145
+
146
+ ### Added
147
+
148
+ - **`@hyperfixi/engine` exports `expr`**, so a grammar module can live in another package
149
+ (#1358).
150
+ - **`@hyperfixi/core/ast-utils`'s `withEnginePositions`** gives interchange nodes the source
151
+ spans of the engine's parse (#1359).
152
+
153
+ ### Fixed
154
+
155
+ - **`@hyperfixi/engine`** accepts upstream's `beep!` command (`beep! a, b`); 3.3.0 rejected it
156
+ (#1362).
157
+ - **`@hyperfixi/types-browser`** types `window.hyperfixi` / `window._hyperscript` as the engine's
158
+ `HyperfixiAPI`. 3.3.0 re-exported a `./globals` it never emitted, so `window.hyperfixi` was
159
+ untyped (#1356).
160
+ - **Semantic browser bundles** (#1351). Single-language and regional bundles (es, ja,
161
+ east-asian, …) registered no English, so the hyperscript adapter left scripts untranslated. They
162
+ now register it (+~2.2 KB gzipped) and export `translate`. The lite adapter finds any
163
+ `LokaScriptSemantic*` global.
164
+ - **`@lokascript/semantic`** (#1338, #1343, #1347). `/core` plus a language module no longer
165
+ throws "No patterns registered". `on click from (x or me)` parses in th and zh. A `js … end`
166
+ block no longer ends its handler in ja / ko / hi / tr / qu / bn. An options object's `}` is no
167
+ longer read as an SOV event name.
168
+ - **Language server and MCP** (#1359, #1363, #1365). `beep!` has hover docs. `set X to`
169
+ completions offer values. Hyperscript-mode errors land on the form, not line 0. Hover no longer
170
+ shows a second `on click`.
171
+
10
172
  ## [3.3.0] - 2026-10-02
11
173
 
12
174
  The first publication of `@hyperfixi/engine`, the hyperscript engine meant to replace the one
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokascript/planner",
3
- "version": "3.3.0",
3
+ "version": "4.0.0",
4
4
  "description": "BFS planner over affordance graphs — cost-aware planning with preconditions, effects, and template parameters",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",