@hyperfixi/types-browser 4.6.0 → 4.8.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 +121 -1
  2. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,124 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.8.0] - 2026-10-16
11
+
12
+ ### Added
13
+
14
+ - **`@lokascript/intent` / `@lokascript/framework`: a role's word list, `RoleSpec.words`** (domains
15
+ rethink Phase 5). Per language, with `'*'` for every language; the core engine (`engine: 'core'`)
16
+ reads such a slot only from one of its words, compared lower-cased, so a word the grammar does not
17
+ know is left unread and the input refused, instead of read as the value. It is for a domain's fixed
18
+ words: behaviorspec's `when clicks zzqx` read actor `clicks`, action `zzqx`, and compiled to a
19
+ comment. The schema-pattern generator carries the pattern language's list on the role token
20
+ (`RolePatternToken.words`); a grammar that lists no words generates the same patterns. The classic
21
+ engine and semantic ignore it.
22
+ - **`@lokascript/framework/testing/gate`: `GateFixture.commands`**, commands the gate writes besides
23
+ the generated ones, where one role's value depends on another's (behaviorspec's
24
+ `[given subject:#box value:visible]` beside `[given subject:viewport value:1024x768]`).
25
+ - **`@lokascript/framework`: `UnreadInputError.hint`.** Where the last word a parse read as a value is
26
+ followed by another bare word, the refusal adds `if "buy milk" is one value, quote it` (todo's
27
+ `add buy milk to groceries`, whose item is quoted).
28
+
29
+ ### Changed
30
+
31
+ - **`@lokascript/framework/testing/gate`: leftover input read into a role is `pass`.** An unknown word
32
+ after a command used to be `silent` wherever the parse accepted it. It is `pass` when the parse is
33
+ the text's own with the word in one role (an open-text role extended by it, sql's
34
+ `where active zzqx`, or a role the text left empty, todo's `list zzqx`) and the word reaches the
35
+ compiled code; `refused` when the input stops compiling; `silent` otherwise (read as something
36
+ else, or the word goes nowhere). `readsWord` is exported. On the domains (domains 4.1.0, this
37
+ framework packed): 74 leftover cases accepted → read, 0 worse, 0 parses moved.
38
+ - **`@lokascript/framework`: the stock reader's optional slot does not read a marker the rest of the
39
+ pattern owes**, through its optional groups, as a required slot already does not read the marker
40
+ next to it (behaviorspec's `when user types into #search`, whose typed text is optional and has no
41
+ marker). No domain parse moves.
42
+
43
+ ## [4.7.0] - 2026-10-16
44
+
45
+ ### Added
46
+
47
+ - **`@lokascript/framework`: the matcher's skeleton, `MatchSkeleton`** (domains rethink Phase 4.3), with
48
+ its seam (`ValueReader`, `MatchView`, `RoleSlot`) and the `ConfidenceModel` / `ConfidenceContext` /
49
+ `ConfidenceBreakdown` interfaces, all exported. It is the skeleton semantic's hyperscript matcher runs:
50
+ `@lokascript/semantic`'s `PatternMatcher` now extends it and passes `HyperscriptValueReader`, and its
51
+ confidence types are framework's narrowed to hyperscript's names. Framework's pattern types take the
52
+ fields semantic's carried alone (`LanguagePattern.parseOnly`, `LiteralPatternToken.renderSuppress`,
53
+ `RolePatternToken.valueShape`, `GroupPatternToken.renderRequired`, `ExtractionRule.valueIsExpression`,
54
+ `PatternMatchResult.roleStarts` / `eventSource`). `createMultilingualDSL` still uses its own matcher.
55
+ Every hyperscript parse is unchanged (27,194 checked); semantic's browser bundles grew ~150 bytes
56
+ gzipped.
57
+ - **`@lokascript/framework`: `createSchemaPatternGenerator`** (domains rethink Phase 4.4), the pattern
58
+ generator semantic's hyperscript parser runs, moved from `@lokascript/semantic`: the main pattern per
59
+ command and language and its variants (simple, omit-role, widened-type, required-role, SOV verb-first,
60
+ value-prefix-literal), with the grammar's hook `positionOrder` (`'ascending'`: hyperscript's 1-based
61
+ positions; `'descending'`: a domain's, as framework's `generatePattern` reads them). Also exported:
62
+ `withoutVariantOnlyRoles`, `resolveMarkerForRole`, `schemaMarkerAlternatives`,
63
+ `legacyMarkerAlternatives`. semantic's `generatePattern` / `generatePatternVariants` / … keep their
64
+ names and signatures over it; its fused event-handler patterns stay in semantic. Every generated
65
+ pattern in all 24 languages is byte-identical (5,899), and every parse unchanged (27,194).
66
+ - **`@lokascript/framework`: rendering through patterns, and the translation-loss checks** (domains
67
+ rethink Phase 4.5), moved from `@lokascript/semantic`. `selectRenderPattern` scores a language's
68
+ patterns for a node (role coverage, values a pattern pins) and `renderPattern` walks the chosen one;
69
+ a grammar's preferences and its value writing are `PatternRenderHooks`. `findTranslationLoss` runs
70
+ the fail-loud checks in order (unread input, forms nothing writes, a read-back that does not read or
71
+ differs, verbatim values) with a grammar's `TranslationLossRules`; `LossyTranslationError`,
72
+ `TranslationLoss` and `unconsumedSpans` moved with it (semantic re-exports them, so `instanceof`
73
+ holds). semantic's renderer and `translate` run them with hyperscript's hooks and rules; its
74
+ collision rule (`verified-render`) stays in semantic. Every translation of every command-shape case
75
+ in all 24 languages is unchanged, rendered (27,240) and with refusals on (704 refused, the same
76
+ kinds and losses).
77
+ - **`@lokascript/framework/testing/gate`: the round-trip gate kit and the grammar linter** (domains
78
+ rethink Phase 4.6), moved from lokascript-domains: `runRoundTrip` renders every command of a
79
+ grammar in each of its languages and reads it back (`pass` / `refused` / `silent`, plus each render
80
+ with an unknown word after it, which must be refused); `compare` / `listingOf` / `countsOf` keep a
81
+ shrink-only baseline and `snapshotOf` / `snapshotChanges` a parse snapshot; `lintDomain` runs the
82
+ domain-toolkit rules R1–R10, its schema-structure rule on the validator the input passes
83
+ (`validateSchema`; framework cannot import semantic). No test runner needed. On the 8 domains, with
84
+ their own fixtures, it reads 3,488 of 3,488 cases as the domains' gate does, with no drift from
85
+ their baseline.
86
+ - **`@lokascript/framework`: the stock value reader and confidence model for domain grammars** (domains
87
+ rethink Phase 4.7a). `createStockReader()` (`StockValueReader`) is a `ValueReader` for the matcher's
88
+ skeleton: a greedy slot reads up to the next marker its pattern owes (`readGreedy`,
89
+ `greedyStopMarkers`), any other slot one value (`readRoleValue`: a selector, a quoted string, a number,
90
+ a boolean, a duration, a URL, an identifier, or a dotted or called form, checked against the slot's
91
+ types), a required slot never takes the marker its pattern wants next, and an optional one may be
92
+ skipped for it. `stockConfidenceModel` scores as the old matcher did. Both are the old matcher's code,
93
+ moved: `createMultilingualDSL`'s matcher calls them, and the domain gate on this build moves no case
94
+ and no parse. `createSchemaPatternGenerator` also takes a domain schema's `greedy`, its
95
+ post-verb `sovSlot` and its `markerPosition` (hyperscript's patterns: unchanged, 5,899).
96
+ - **`@lokascript/framework`: `engine: 'core'`, a domain DSL on the core** (domains rethink Phase 4.7b):
97
+ a `DSLConfig` option. `createMultilingualDSL({ ...config, engine: 'core' })` returns the same
98
+ `MultilingualDSL`, read by the core semantic's hyperscript parser runs: patterns from
99
+ `createSchemaPatternGenerator` (positions descending), matched by `MatchSkeleton` with the stock
100
+ reader and confidence model, and rendered through those patterns where the domain's own renderer
101
+ declines. Parsing's whole-input rule, the refusals, translation's read-back, compile, explicit syntax
102
+ and extensions are shared with the default, `engine: 'classic'`, which is unchanged; any other engine
103
+ name throws. The stock reader also gives a required slot back the value an optional, marker-less slot
104
+ just before it read (the old matcher's backtrack). Measured on the 8 domains, each on the core
105
+ (the domain gate on a packed build): 0 cases worse, 30 better (behaviorspec 306 → 336
106
+ round trips), no case silent that was not before.
107
+
108
+ ### Changed
109
+
110
+ - **`@lokascript/intent`: one schema type for every grammar** (domains rethink Phase 4.1). `RoleSpec` and
111
+ `CommandSchema` now hold the fields hyperscript's schemas use as well as the domains' (`valueShape`,
112
+ `variantOnly`, `markerOptional`, `markerLegacy`, `valuePrefixLiteral`; `bareKeyword`, `structuralOnly`
113
+ and the `omitRoleVariants` / `widenTypeVariants` / `rolePrefixLiteralVariants` / `requiredRoleVariants`
114
+ lists), each documented with the code that reads it, and take type parameters for a grammar's action,
115
+ role, value and category names. The parameters default to today's types, so a domain schema reads as
116
+ before; framework's `docs/API_SURFACE.md` prints them spelled out. `@lokascript/semantic`'s `RoleSpec`
117
+ is this type with hyperscript's names, and its `CommandSchema` extends it with the fields only its AST
118
+ builder and error docs read (`ast`, `errorCodes`, `preconditions`, `recoveryHints`). One field keeps two
119
+ meanings for now: framework's generator sorts `svoPosition` / `sovPosition` descending (higher =
120
+ earlier), semantic's ascending; the field doc says so.
121
+ - **`@lokascript/semantic`: the pattern matcher reads every value through a seam** (domains rethink
122
+ Phase 4.2). The matcher is now a grammar-neutral skeleton (`parser/match-skeleton.ts`: literals,
123
+ groups and their rollback, the speculative skip of an optional slot, spans, ranking, confidence) and
124
+ hyperscript's `HyperscriptValueReader`, which reads each role slot and answers the skeleton's grammar
125
+ hooks (`parser/value-reader.ts`). `PatternMatcher` keeps its constructor, methods and import path. Every
126
+ parse is unchanged (27,194 checked).
127
+
10
128
  ## [4.6.0] - 2026-10-15
11
129
 
12
130
  ### Added
@@ -1736,7 +1854,9 @@ _Synchronized version release. See git history for details._
1736
1854
  - npm access token stored in GitHub Secrets
1737
1855
  - 2FA recommended for npm organization
1738
1856
 
1739
- [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v4.6.0...HEAD
1857
+ [Unreleased]: https://github.com/codetalcott/hyperfixi/compare/v4.8.0...HEAD
1858
+ [4.8.0]: https://github.com/codetalcott/hyperfixi/compare/v4.7.0...v4.8.0
1859
+ [4.7.0]: https://github.com/codetalcott/hyperfixi/compare/v4.6.0...v4.7.0
1740
1860
  [4.6.0]: https://github.com/codetalcott/hyperfixi/compare/v4.5.0...v4.6.0
1741
1861
  [4.5.0]: https://github.com/codetalcott/hyperfixi/compare/v4.4.0...v4.5.0
1742
1862
  [4.4.0]: https://github.com/codetalcott/hyperfixi/compare/v4.3.0...v4.4.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperfixi/types-browser",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "description": "TypeScript definitions for the hyperfixi browser globals: window.hyperfixi / window._hyperscript (the engine), LokaScriptSemantic, LokaScriptI18n",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "author": "LokaScript Contributors",
31
31
  "license": "MIT",
32
32
  "devDependencies": {
33
- "@hyperfixi/engine": "^4.6.0",
33
+ "@hyperfixi/engine": "^4.8.0",
34
34
  "typescript": "^5.8.3"
35
35
  },
36
36
  "publishConfig": {