@hyperfixi/server-bridge 4.8.0 → 5.1.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 CHANGED
@@ -7,6 +7,73 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [5.1.0] - 2026-10-18
11
+
12
+ Deprecates `@lokascript/compilation-service`'s test and component generation, which 6.0 removes;
13
+ `@hyperfixi/mcp-server` moves to `@lokascript/domains` 5.0.0.
14
+
15
+ ### Changed
16
+
17
+ - **`@hyperfixi/mcp-server`: on `@lokascript/domains` 5.0.0** (domains rethink Phase 6), which deletes
18
+ bdd and peers framework, semantic and intent `^5.0.0`. The server registers every domain (no
19
+ `omit`); the same seven domains and 28 domain tools as 5.0.0. framework's and server-bridge's
20
+ dev dependency follows (`^5.0.0`) (#1559).
21
+
22
+ ### Deprecated
23
+
24
+ - **`@lokascript/compilation-service`: test and component generation, removed in 6.0** (#1560).
25
+ `generateTests`, `generateComponent`, `registerTestRenderer`, `registerComponentRenderer`, the
26
+ `PlaywrightRenderer`, `ReactRenderer`, `VueRenderer` and `SvelteRenderer` exports, and the react,
27
+ vue and svelte targets of `generate` (its `intent-element` target stays). Each call still works
28
+ and its response now carries an info diagnostic, `DEPRECATED`. The HTTP routes
29
+ `/generate-tests` and `/generate-component` and the MCP tools `generate_tests` and
30
+ `generate_component` go with them in 6.0; the tools' descriptions say so now. Measured on the
31
+ docs sites' 164 English patterns and lokascript-examples chat's five examples: 15 of 169 inputs
32
+ give a Playwright test that fails without the engine (103 are refused, 23 tests pass with no
33
+ engine loaded, 26 fail on it), and 4 of 6 React components do not typecheck (every command
34
+ aimed at another element: siblings with no fragment, `function ToggleDark-mode`,
35
+ `const [, set]`). Validation, translation, `scoreFidelity` and `diff` stay.
36
+
37
+ ## [5.0.0] - 2026-10-17
38
+
39
+ A renumber for everything but `@lokascript/framework`, whose classic DSL engine is removed: every
40
+ other package is unchanged in its API, and `@lokascript/domains` 4.2.1+ accepts 5.0.
41
+
42
+ ### Removed (BREAKING)
43
+
44
+ - **`@lokascript/framework`: the classic DSL engine** (domains rethink Phase 6; M3 (e): one
45
+ matcher). Every DSL reads on the core engine, which every kept domain has used since domains 4.2.0
46
+ (bdd's own suite and its gate read the same on it, 0 cases moved). Gone: `PatternMatcher`,
47
+ `patternMatcher`, `matchPattern`, `matchBest` and the `./core/pattern-matching` subpath (and
48
+ `PatternMatcher` from `./parsing`); the classic generator, `generatePattern`,
49
+ `generatePatternVariants` and `GeneratorConfig`. `createMultilingualDSL` defaults to the core;
50
+ `engine: 'core'` is still accepted and changes nothing, so the domains build unchanged, while
51
+ `engine: 'classic'` throws, naming what replaced it. Kept: the schema renderer
52
+ (`createDomainRenderer`, `createSchemaRenderer`, the domains' renderer kit), `PatternGenLanguageProfile`
53
+ and `sortRolesByWordOrder` (now in `generation/profile.ts`), and the value helpers the stock reader
54
+ uses (`isTypeCompatible`, `getPossessiveReference` & co., now in `core/matching`, still exported
55
+ from the root).
56
+
57
+ ### Changed
58
+
59
+ - **`@hyperfixi/mcp-server`: on `@lokascript/domains` 4.2.1, without bdd's tools** (domains rethink
60
+ Phase 5, D6). `parse_bdd`, `compile_bdd`, `validate_bdd` and `translate_bdd` and the multi-step
61
+ bdd scenario handling are gone: behaviorspec reads bdd's preconditions, actions and assertions
62
+ (`given #button is visible`, `when user presses 'Enter'`, `expect #title text Welcome`), and the
63
+ server creates its registry with `createDomainRegistry({ omit: ['bdd'] })`. 98 tools defined, 93
64
+ listed by default (102 and 97). From domains 4.2.0 the domain tools also refuse what their DSL does
65
+ not read (no domain gate case accepts leftover input), and `parse_learn` & co. read and write
66
+ learn's commanding sentence with semantic.
67
+
68
+ ### Fixed
69
+
70
+ - **`@hyperfixi/server-bridge` reads a fetch's method from upstream's options.** It read the method
71
+ only from 2.x's `via POST`, so a route written in the engine's syntax, such as
72
+ `fetch /api/x with {method:'POST'}`, was generated as GET. It now reads `with {method:'POST'}`,
73
+ `with method:'POST'` or a bare `{method:'POST'}`, with `as` before or after them (`as an html`
74
+ too); `via` is still read. Measured on lokascript-examples' cross-domain and flow-playground
75
+ pages: 3 POST routes read as GET, all POST now.
76
+
10
77
  ## [4.8.0] - 2026-10-16
11
78
 
12
79
  ### Added
@@ -1854,7 +1921,9 @@ _Synchronized version release. See git history for details._
1854
1921
  - npm access token stored in GitHub Secrets
1855
1922
  - 2FA recommended for npm organization
1856
1923
 
1857
- [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v4.8.0...HEAD
1924
+ [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v5.1.0...HEAD
1925
+ [5.1.0]: https://github.com/codetalcott/hyperfixi/compare/v5.0.0...v5.1.0
1926
+ [5.0.0]: https://github.com/codetalcott/hyperfixi/compare/v4.8.0...v5.0.0
1858
1927
  [4.8.0]: https://github.com/codetalcott/hyperfixi/compare/v4.7.0...v4.8.0
1859
1928
  [4.7.0]: https://github.com/codetalcott/hyperfixi/compare/v4.6.0...v4.7.0
1860
1929
  [4.6.0]: https://github.com/codetalcott/hyperfixi/compare/v4.5.0...v4.6.0
package/dist/cli.cjs CHANGED
@@ -113,7 +113,14 @@ var ATTR_PATTERNS = [
113
113
  // JSX string
114
114
  ];
115
115
  var SCRIPT_PATTERN = /<script[^>]*type=["']?text\/hyperscript["']?[^>]*>([\s\S]*?)<\/script>/gi;
116
- var FETCH_COMMAND = /\bfetch\s+['"]?([^\s'"]+)['"]?(?:\s+as\s+(\w+))?(?:\s+via\s+(\w+))?/gi;
116
+ var FETCH_COMMAND = /\bfetch\s+['"]?([^\s'"]+)['"]?(?:\s+as\s+(?:an?\s+)?(\w+))?(?:\s+via\s+(\w+))?/gi;
117
+ var OPTIONS_METHOD = /\bmethod\s*:\s*['"]?([A-Za-z]+)/i;
118
+ var TRAILING_AS = /\bas\s+(?:an?\s+)?(\w+)/i;
119
+ function restOfCommand(code, from) {
120
+ const rest = code.slice(from);
121
+ const end = rest.search(/\bthen\b|\bend\b|\n/);
122
+ return end === -1 ? rest : rest.slice(0, end);
123
+ }
117
124
  var SEND_FORM = /\bsend\s+(?:the\s+)?form\s+to\s+['"]?([^\s'"]+)['"]?(?:\s+as\s+(\w+))?/gi;
118
125
  function extractHyperscriptRoutes(content, options) {
119
126
  const routes = [];
@@ -122,8 +129,9 @@ function extractHyperscriptRoutes(content, options) {
122
129
  for (const region of regions) {
123
130
  for (const match of region.code.matchAll(FETCH_COMMAND)) {
124
131
  const rawUrl = match[1];
125
- const responseType = match[2];
126
- const method = match[3];
132
+ const rest = restOfCommand(region.code, match.index + match[0].length);
133
+ const responseType = match[2] ?? rest.match(TRAILING_AS)?.[1];
134
+ const method = match[3] ?? rest.match(OPTIONS_METHOD)?.[1];
127
135
  addRoute(routes, seen, rawUrl, {
128
136
  file: options.file,
129
137
  line: region.line,