@hyperfixi/patterns-reference 3.1.1 → 3.3.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 (39) hide show
  1. package/CHANGELOG.md +186 -1
  2. package/README.md +47 -36
  3. package/data/engine-verification.json +58 -65
  4. package/data/patterns.db +0 -0
  5. package/data/patterns.db.stamp +1 -0
  6. package/dist/api/index.d.mts +2 -2
  7. package/dist/api/index.d.ts +2 -2
  8. package/dist/api/index.js +198 -98
  9. package/dist/api/index.mjs +197 -100
  10. package/dist/{index-6GkHj5yJ.d.mts → index-CoDUfq2P.d.mts} +39 -3
  11. package/dist/{index-6GkHj5yJ.d.ts → index-CoDUfq2P.d.ts} +39 -3
  12. package/dist/index.d.mts +87 -13
  13. package/dist/index.d.ts +87 -13
  14. package/dist/index.js +261 -144
  15. package/dist/index.mjs +258 -146
  16. package/dist/{llm-B5nGz8V1.d.mts → llm-CCCSw-yp.d.ts} +21 -10
  17. package/dist/{llm-rEdJQScF.d.ts → llm-PxnriEZ_.d.mts} +21 -10
  18. package/dist/sync/index.d.mts +1 -1
  19. package/dist/sync/index.d.ts +1 -1
  20. package/dist/sync/index.js +4 -1
  21. package/dist/sync/index.mjs +4 -1
  22. package/package.json +16 -16
  23. package/src/adapters/llm-adapter.ts +64 -42
  24. package/src/api/engine-filter.ts +37 -0
  25. package/src/api/llm.ts +54 -64
  26. package/src/api/patterns.ts +92 -30
  27. package/src/api/roles.ts +6 -4
  28. package/src/api/translations.ts +34 -27
  29. package/src/database/connection.ts +16 -4
  30. package/src/html-snippets.ts +39 -10
  31. package/src/index.ts +12 -2
  32. package/src/registry/patterns-provider.ts +3 -1
  33. package/src/sync/db-stamp.ts +7 -4
  34. package/src/sync/markup-attributes.ts +15 -0
  35. package/src/sync/verify-parses.ts +42 -0
  36. package/src/types/better-sqlite3.d.ts +2 -0
  37. package/src/types/index.ts +44 -2
  38. package/src/sync/span-mask.ts +0 -166
  39. package/src/sync/translation-checks.ts +0 -282
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "meta": {
3
3
  "bar": {
4
- "lokascript": "compileSync(code).ok with zero recovered errors via @hyperfixi/core (same call as the browser _= path), with @hyperfixi/reactivity and @hyperfixi/realtime installed (both ship pre-installed in hyperfixi.js), plus a jsdom top-level install smoke (no error within 500ms settle window)",
5
- "hyperscript": "upstream _hyperscript parse with zero recovered errors (extensions loaded: socket, worker, eventsource); parse-level only",
6
- "html": "HTML-markup patterns: each _= / script-tag snippet verified individually; hx-live/sse-*/ws-* attributes are hyperfixi-only and block the upstream claim"
4
+ "lokascript": "compileSync(code).ok with zero recovered errors via @hyperfixi/core (same call as the browser _= path) with its first-party plugins installed (@hyperfixi/reactivity and @hyperfixi/realtime, both pre-installed in hyperfixi.js, and @hyperfixi/components), plus a jsdom top-level install smoke (no error within a 500ms settle window; registrations cleaned up afterwards)",
5
+ "hyperscript": "upstream _hyperscript parse with zero recovered errors (extensions loaded: socket, worker, eventsource, component); parse-level for plain sources",
6
+ "html": "HTML-markup patterns: every _= / hx-live / script-tag source, including those inside component template bodies, verified on both legs; template components rendered on both legs (non-empty, nothing logged or thrown); hx-live/sse-*/ws-* markup is hyperfixi-only (blocks the upstream claim) and earns its lokascript credit only by running in dist/hyperfixi-hx-v4.js (sse events swap into hx-target, ws-send reaches the socket, hx-live re-renders); a row with no source earns no credit"
7
7
  },
8
- "lokascriptVersion": "2.11.1",
8
+ "lokascriptVersion": "3.2.0",
9
9
  "hyperscriptVersion": "0.9.93"
10
10
  },
11
11
  "engines": {
@@ -13,19 +13,21 @@
13
13
  "accordion-toggle": "both",
14
14
  "add-class-basic": "both",
15
15
  "add-class-to-other": "both",
16
- "announce-screen-reader": "lokascript",
16
+ "announce-screen-reader": "both",
17
17
  "append-content": "both",
18
- "async-block": "lokascript",
18
+ "async-block": null,
19
19
  "beep-debug-expression": "both",
20
20
  "behavior-draggable": "both",
21
21
  "behavior-removable": "both",
22
- "behavior-resizable": "lokascript",
22
+ "behavior-resizable": "both",
23
23
  "behavior-sortable": "both",
24
24
  "bind-auto-detect": "both",
25
25
  "bind-explicit-property": "both",
26
26
  "bind-non-form-display": "both",
27
27
  "bind-two-way": "both",
28
28
  "blur-element": "both",
29
+ "book-archive-download-click": "both",
30
+ "book-counter-increment": "both",
29
31
  "breakpoint-command": "both",
30
32
  "call-function": "both",
31
33
  "caret-var-increment": "both",
@@ -33,11 +35,11 @@
33
35
  "caret-var-write": "both",
34
36
  "chained-access-possessive-dot": "both",
35
37
  "closest-ancestor": "both",
36
- "component-click-counter": "lokascript",
37
- "component-hello-world": "lokascript",
38
+ "component-click-counter": "both",
39
+ "component-hello-world": "both",
38
40
  "component-with-attrs": "lokascript",
39
- "component-with-conditional": "lokascript",
40
- "component-with-slots": "lokascript",
41
+ "component-with-conditional": "both",
42
+ "component-with-slots": "both",
41
43
  "computed-value": "both",
42
44
  "copy-to-clipboard": "both",
43
45
  "decrement-counter": "both",
@@ -45,10 +47,10 @@
45
47
  "document-ready": "both",
46
48
  "dropdown-close-outside": "both",
47
49
  "dropdown-toggle": "both",
48
- "event-debounce": "lokascript",
50
+ "event-debounce": "both",
49
51
  "event-from-elsewhere": "both",
50
52
  "event-key-combo": "both",
51
- "event-once": null,
53
+ "event-once": "both",
52
54
  "event-throttle": "both",
53
55
  "eventsource-basic": "both",
54
56
  "fade-out-remove": "both",
@@ -59,7 +61,7 @@
59
61
  "fetch-json": "both",
60
62
  "fetch-loading-state": "both",
61
63
  "fetch-with-headers": "both",
62
- "fetch-with-method": "lokascript",
64
+ "fetch-with-method": "both",
63
65
  "fetch-with-method-body": "both",
64
66
  "first-in-parent": "both",
65
67
  "focus-element": "both",
@@ -83,7 +85,7 @@
83
85
  "increment-by-amount": "both",
84
86
  "increment-counter": "both",
85
87
  "input-char-count": "both",
86
- "input-clear": "lokascript",
88
+ "input-clear": "both",
87
89
  "input-mirror": "both",
88
90
  "input-validation": "both",
89
91
  "install-behavior": "both",
@@ -104,12 +106,12 @@
104
106
  "modal-close-escape": "both",
105
107
  "modal-open": "both",
106
108
  "morph-fetch-result": "both",
107
- "morph-form-update": "lokascript",
109
+ "morph-form-update": "both",
108
110
  "morph-with-template": "both",
109
111
  "multiple-events": "both",
110
112
  "next-element": "both",
111
113
  "on-custom-event-receive": "both",
112
- "optional-chaining-possessive": "lokascript",
114
+ "optional-chaining-possessive": "both",
113
115
  "pick-text-range": "both",
114
116
  "previous-element": "both",
115
117
  "put-after": "both",
@@ -139,19 +141,19 @@
139
141
  "settle-animations": "both",
140
142
  "show-element": "both",
141
143
  "show-with-transition": "both",
142
- "slide-toggle": "lokascript",
144
+ "slide-toggle": "both",
143
145
  "socket-basic": "both",
144
146
  "socket-send": "both",
145
147
  "sse-connect-swap": "lokascript",
146
148
  "sse-multi-event": "lokascript",
147
- "stagger-animation": "lokascript",
149
+ "stagger-animation": "both",
148
150
  "swap-content": "both",
149
151
  "swap-view-transition": "lokascript",
150
- "tabs-aria": "lokascript",
152
+ "tabs-aria": "both",
151
153
  "tabs-basic": "both",
152
154
  "tabs-content": "both",
153
155
  "take-class-from-siblings": "both",
154
- "tell-command": "lokascript",
156
+ "tell-command": "both",
155
157
  "tell-other-element": "both",
156
158
  "template-literal-interpolation": "both",
157
159
  "template-literal-list-build": "both",
@@ -165,7 +167,7 @@
165
167
  "transition-transform": "both",
166
168
  "trigger-event": "both",
167
169
  "two-way-binding": "both",
168
- "unless-condition": "lokascript",
170
+ "unless-condition": "both",
169
171
  "wait-for-event": "both",
170
172
  "wait-then": "both",
171
173
  "when-multiple-changes": "both",
@@ -195,16 +197,16 @@
195
197
  },
196
198
  "announce-screen-reader": {
197
199
  "lokascript": true,
198
- "hyperscript": false,
199
- "hyperscriptError": "Expected event name"
200
+ "hyperscript": true
200
201
  },
201
202
  "append-content": {
202
203
  "lokascript": true,
203
204
  "hyperscript": true
204
205
  },
205
206
  "async-block": {
206
- "lokascript": true,
207
+ "lokascript": false,
207
208
  "hyperscript": false,
209
+ "lokascriptError": "Unexpected token: fetch",
208
210
  "hyperscriptError": "Unexpected Token : async"
209
211
  },
210
212
  "beep-debug-expression": {
@@ -221,8 +223,7 @@
221
223
  },
222
224
  "behavior-resizable": {
223
225
  "lokascript": true,
224
- "hyperscript": false,
225
- "hyperscriptError": "You must parenthesize math operations with different operators"
226
+ "hyperscript": true
226
227
  },
227
228
  "behavior-sortable": {
228
229
  "lokascript": true,
@@ -248,6 +249,14 @@
248
249
  "lokascript": true,
249
250
  "hyperscript": true
250
251
  },
252
+ "book-archive-download-click": {
253
+ "lokascript": true,
254
+ "hyperscript": true
255
+ },
256
+ "book-counter-increment": {
257
+ "lokascript": true,
258
+ "hyperscript": true
259
+ },
251
260
  "breakpoint-command": {
252
261
  "lokascript": true,
253
262
  "hyperscript": true
@@ -278,28 +287,24 @@
278
287
  },
279
288
  "component-click-counter": {
280
289
  "lokascript": true,
281
- "hyperscript": false,
282
- "hyperscriptError": "uses hyperfixi-only attributes"
290
+ "hyperscript": true
283
291
  },
284
292
  "component-hello-world": {
285
293
  "lokascript": true,
286
- "hyperscript": false,
287
- "hyperscriptError": "uses hyperfixi-only attributes"
294
+ "hyperscript": true
288
295
  },
289
296
  "component-with-attrs": {
290
297
  "lokascript": true,
291
298
  "hyperscript": false,
292
- "hyperscriptError": "uses hyperfixi-only attributes"
299
+ "hyperscriptError": "uncaught: \"[object Object]\" is not valid JSON"
293
300
  },
294
301
  "component-with-conditional": {
295
302
  "lokascript": true,
296
- "hyperscript": false,
297
- "hyperscriptError": "uses hyperfixi-only attributes"
303
+ "hyperscript": true
298
304
  },
299
305
  "component-with-slots": {
300
306
  "lokascript": true,
301
- "hyperscript": false,
302
- "hyperscriptError": "uses hyperfixi-only attributes"
307
+ "hyperscript": true
303
308
  },
304
309
  "computed-value": {
305
310
  "lokascript": true,
@@ -331,8 +336,7 @@
331
336
  },
332
337
  "event-debounce": {
333
338
  "lokascript": true,
334
- "hyperscript": false,
335
- "hyperscriptError": "Unexpected Token : value"
339
+ "hyperscript": true
336
340
  },
337
341
  "event-from-elsewhere": {
338
342
  "lokascript": true,
@@ -343,10 +347,8 @@
343
347
  "hyperscript": true
344
348
  },
345
349
  "event-once": {
346
- "lokascript": false,
347
- "hyperscript": false,
348
- "lokascriptError": "Unexpected token: add",
349
- "hyperscriptError": "Unexpected Token : once"
350
+ "lokascript": true,
351
+ "hyperscript": true
350
352
  },
351
353
  "event-throttle": {
352
354
  "lokascript": true,
@@ -391,8 +393,7 @@
391
393
  },
392
394
  "fetch-with-method": {
393
395
  "lokascript": true,
394
- "hyperscript": false,
395
- "hyperscriptError": "Unexpected Token : body"
396
+ "hyperscript": true
396
397
  },
397
398
  "fetch-with-method-body": {
398
399
  "lokascript": true,
@@ -453,12 +454,12 @@
453
454
  "hx-live-attribute": {
454
455
  "lokascript": true,
455
456
  "hyperscript": false,
456
- "hyperscriptError": "uses hyperfixi-only attributes"
457
+ "hyperscriptError": "uses hyperfixi-only attributes (hx-live / sse-* / ws-*)"
457
458
  },
458
459
  "hx-live-with-mutator": {
459
460
  "lokascript": true,
460
461
  "hyperscript": false,
461
- "hyperscriptError": "uses hyperfixi-only attributes"
462
+ "hyperscriptError": "uses hyperfixi-only attributes (hx-live / sse-* / ws-*)"
462
463
  },
463
464
  "if-condition": {
464
465
  "lokascript": true,
@@ -490,8 +491,7 @@
490
491
  },
491
492
  "input-clear": {
492
493
  "lokascript": true,
493
- "hyperscript": false,
494
- "hyperscriptError": "Expected 'to' but found '<'"
494
+ "hyperscript": true
495
495
  },
496
496
  "input-mirror": {
497
497
  "lokascript": true,
@@ -577,8 +577,7 @@
577
577
  },
578
578
  "morph-form-update": {
579
579
  "lokascript": true,
580
- "hyperscript": false,
581
- "hyperscriptError": "Expected 'to' but found '<<<EOF>>>'"
580
+ "hyperscript": true
582
581
  },
583
582
  "morph-with-template": {
584
583
  "lokascript": true,
@@ -598,8 +597,7 @@
598
597
  },
599
598
  "optional-chaining-possessive": {
600
599
  "lokascript": true,
601
- "hyperscript": false,
602
- "hyperscriptError": "Unexpected Token : ?"
600
+ "hyperscript": true
603
601
  },
604
602
  "pick-text-range": {
605
603
  "lokascript": true,
@@ -719,8 +717,7 @@
719
717
  },
720
718
  "slide-toggle": {
721
719
  "lokascript": true,
722
- "hyperscript": false,
723
- "hyperscriptError": "Expected 'to' but found 'over'"
720
+ "hyperscript": true
724
721
  },
725
722
  "socket-basic": {
726
723
  "lokascript": true,
@@ -733,17 +730,16 @@
733
730
  "sse-connect-swap": {
734
731
  "lokascript": true,
735
732
  "hyperscript": false,
736
- "hyperscriptError": "uses hyperfixi-only attributes"
733
+ "hyperscriptError": "uses hyperfixi-only attributes (hx-live / sse-* / ws-*)"
737
734
  },
738
735
  "sse-multi-event": {
739
736
  "lokascript": true,
740
737
  "hyperscript": false,
741
- "hyperscriptError": "uses hyperfixi-only attributes"
738
+ "hyperscriptError": "uses hyperfixi-only attributes (hx-live / sse-* / ws-*)"
742
739
  },
743
740
  "stagger-animation": {
744
741
  "lokascript": true,
745
- "hyperscript": false,
746
- "hyperscriptError": "Expected 'end' but found 'with'"
742
+ "hyperscript": true
747
743
  },
748
744
  "swap-content": {
749
745
  "lokascript": true,
@@ -756,8 +752,7 @@
756
752
  },
757
753
  "tabs-aria": {
758
754
  "lokascript": true,
759
- "hyperscript": false,
760
- "hyperscriptError": "Expected event name"
755
+ "hyperscript": true
761
756
  },
762
757
  "tabs-basic": {
763
758
  "lokascript": true,
@@ -773,8 +768,7 @@
773
768
  },
774
769
  "tell-command": {
775
770
  "lokascript": true,
776
- "hyperscript": false,
777
- "hyperscriptError": "Expected 'end' but found 'to'"
771
+ "hyperscript": true
778
772
  },
779
773
  "tell-other-element": {
780
774
  "lokascript": true,
@@ -830,8 +824,7 @@
830
824
  },
831
825
  "unless-condition": {
832
826
  "lokascript": true,
833
- "hyperscript": false,
834
- "hyperscriptError": "Unexpected Token : unless"
827
+ "hyperscript": true
835
828
  },
836
829
  "wait-for-event": {
837
830
  "lokascript": true,
@@ -868,7 +861,7 @@
868
861
  "ws-connect-send": {
869
862
  "lokascript": true,
870
863
  "hyperscript": false,
871
- "hyperscriptError": "uses hyperfixi-only attributes"
864
+ "hyperscriptError": "uses hyperfixi-only attributes (hx-live / sse-* / ws-*)"
872
865
  }
873
866
  }
874
867
  }
package/data/patterns.db CHANGED
Binary file
@@ -0,0 +1 @@
1
+ e0e64deb40ab4c8f93381ac427d4026e193bb4c3f8e7492c4e9b88af2f2100ff
@@ -1,5 +1,5 @@
1
- export { a as addLLMExample, b as buildFewShotContext, g as getAllPatterns, c as getAllTranslations, d as getExamplesByCommand, e as getHighConfidenceTranslations, f as getHighQualityExamples, h as getLLMExamples, i as getLLMStats, j as getMostUsedExamples, k as getPatternById, l as getPatternStats, m as getPatternsByCategory, n as getPatternsByCommand, o as getTranslation, p as getTranslationStats, q as getTranslationsByLanguage, r as getVerifiedTranslations, s as getWordOrder, t as searchPatterns, u as updateQualityScore, v as verifyTranslation } from '../llm-B5nGz8V1.mjs';
2
- import { C as ConnectionOptions, P as PatternRole, a as Pattern, R as RoleType } from '../index-6GkHj5yJ.mjs';
1
+ export { a as addLLMExample, b as buildFewShotContext, g as getAllPatterns, c as getAllTranslations, d as getExamplesByCommand, e as getHighConfidenceTranslations, f as getHighQualityExamples, h as getLLMExamples, i as getLLMStats, j as getMostUsedExamples, k as getPatternById, l as getPatternStats, m as getPatternsByCategory, n as getPatternsByCommand, o as getTranslation, p as getTranslationStats, q as getTranslationsByLanguage, r as getVerifiedTranslations, s as getWordOrder, t as searchPatterns, u as updateQualityScore, v as verifyTranslation } from '../llm-PxnriEZ_.mjs';
2
+ import { C as ConnectionOptions, P as PatternRole, a as Pattern, R as RoleType } from '../index-CoDUfq2P.mjs';
3
3
  import { SemanticRole } from '@lokascript/semantic';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- export { a as addLLMExample, b as buildFewShotContext, g as getAllPatterns, c as getAllTranslations, d as getExamplesByCommand, e as getHighConfidenceTranslations, f as getHighQualityExamples, h as getLLMExamples, i as getLLMStats, j as getMostUsedExamples, k as getPatternById, l as getPatternStats, m as getPatternsByCategory, n as getPatternsByCommand, o as getTranslation, p as getTranslationStats, q as getTranslationsByLanguage, r as getVerifiedTranslations, s as getWordOrder, t as searchPatterns, u as updateQualityScore, v as verifyTranslation } from '../llm-rEdJQScF.js';
2
- import { C as ConnectionOptions, P as PatternRole, a as Pattern, R as RoleType } from '../index-6GkHj5yJ.js';
1
+ export { a as addLLMExample, b as buildFewShotContext, g as getAllPatterns, c as getAllTranslations, d as getExamplesByCommand, e as getHighConfidenceTranslations, f as getHighQualityExamples, h as getLLMExamples, i as getLLMStats, j as getMostUsedExamples, k as getPatternById, l as getPatternStats, m as getPatternsByCategory, n as getPatternsByCommand, o as getTranslation, p as getTranslationStats, q as getTranslationsByLanguage, r as getVerifiedTranslations, s as getWordOrder, t as searchPatterns, u as updateQualityScore, v as verifyTranslation } from '../llm-CCCSw-yp.js';
2
+ import { C as ConnectionOptions, P as PatternRole, a as Pattern, R as RoleType } from '../index-CoDUfq2P.js';
3
3
  import { SemanticRole } from '@lokascript/semantic';
4
4
 
5
5
  /**