@hyperfixi/core 2.9.0 → 2.9.1

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 (49) hide show
  1. package/dist/ast-utils/index.js +905 -882
  2. package/dist/ast-utils/index.mjs +905 -882
  3. package/dist/chunks/{bridge-D9JLmPkk.js → bridge-BYhqTOnL.js} +2 -2
  4. package/dist/chunks/browser-modular-D2BHzZFB.js +2 -0
  5. package/dist/chunks/feature-eventsource-Bxg_UNZo.js +2 -0
  6. package/dist/chunks/feature-sockets-CcTxD5sT.js +2 -0
  7. package/dist/chunks/feature-webworker-DoqZ0Grg.js +2 -0
  8. package/dist/chunks/{index-6DUg7Qjm.js → index-DXgJaDj-.js} +2 -2
  9. package/dist/commands/index.js +168 -112
  10. package/dist/commands/index.mjs +168 -112
  11. package/dist/hyperfixi-browser-classic-i18n.js +1 -1
  12. package/dist/hyperfixi-browser-minimal.js +1 -1
  13. package/dist/hyperfixi-browser-standard.js +1 -1
  14. package/dist/hyperfixi-browser.js +1 -1
  15. package/dist/hyperfixi-classic-i18n.js +1 -1
  16. package/dist/hyperfixi-hx-v4.js +1 -1
  17. package/dist/hyperfixi-minimal.js +1 -1
  18. package/dist/hyperfixi-multilingual.js +1 -1
  19. package/dist/hyperfixi-standard.js +1 -1
  20. package/dist/hyperfixi.js +1 -1
  21. package/dist/hyperfixi.mjs +1 -1
  22. package/dist/index.js +1505 -1402
  23. package/dist/index.min.js +1 -1
  24. package/dist/index.mjs +1505 -1402
  25. package/dist/lokascript-browser-classic-i18n.js +1 -1
  26. package/dist/lokascript-browser-minimal.js +1 -1
  27. package/dist/lokascript-browser-standard.js +1 -1
  28. package/dist/lokascript-browser.js +1 -1
  29. package/dist/lokascript-multilingual.js +1 -1
  30. package/dist/lsp-metadata.js +5 -5
  31. package/dist/lsp-metadata.mjs +5 -5
  32. package/dist/metadata.js +25 -25
  33. package/dist/metadata.mjs +25 -25
  34. package/dist/multilingual/index.js +17 -17
  35. package/dist/multilingual/index.mjs +17 -17
  36. package/dist/parser/command-parsers/utility-commands.d.ts +1 -0
  37. package/dist/parser/full-parser.js +155 -106
  38. package/dist/parser/full-parser.mjs +155 -106
  39. package/dist/parser/parser.d.ts +1 -0
  40. package/dist/reference/index.js +1 -0
  41. package/dist/reference/index.mjs +1 -0
  42. package/dist/registry/index.js +155 -106
  43. package/dist/registry/index.mjs +155 -106
  44. package/dist/types/base-types.d.ts +3 -0
  45. package/package.json +5 -5
  46. package/dist/chunks/browser-modular-CPiVQXM0.js +0 -2
  47. package/dist/chunks/feature-eventsource-BpZvPy_K.js +0 -2
  48. package/dist/chunks/feature-sockets-CrYvjZ4j.js +0 -2
  49. package/dist/chunks/feature-webworker-BSYguEIW.js +0 -2
@@ -1,2 +1,2 @@
1
- import{D as n,d as i}from"./browser-modular-CPiVQXM0.js";import"./feature-sockets-CrYvjZ4j.js";function e(n){const i=n.diagnostics;return i?.length?i.filter(n=>"unconsumed-input"===n.code).map(n=>n.message):[]}let t=null;async function a(){return t||(t=await import("./browser-modular-CPiVQXM0.js").then(function(n){return n.n})),t}class c{constructor(i={}){this._initialized=!1,this.config={confidenceThreshold:i.confidenceThreshold??n,fallbackOnLowConfidence:i.fallbackOnLowConfidence??!0}}async initialize(){await a(),this._initialized=!0}isInitialized(){return this._initialized}async transform(n,i,e){if(this.isInitialized()||await this.initialize(),i===e)return{output:n,usedSemantic:!1,confidence:1,sourceLang:i,targetLang:e};const t=await a();try{const a=t.translate(n,i,e);if(a!==n)return{output:a,usedSemantic:!0,confidence:.9,sourceLang:i,targetLang:e}}catch{}return{output:n,usedSemantic:!1,confidence:0,sourceLang:i,targetLang:e}}async parse(n,i){this.isInitialized()||await this.initialize();return(await a()).parseSemantic(n,i).node??null}async render(n,i){return(await a()).render(n,i)}async parseToAST(n,i){this.isInitialized()||await this.initialize();const e=await a(),t=e.parseSemantic(n,i);if(t.confidence>=this.config.confidenceThreshold&&t.node)try{return e.buildAST(t.node).ast}catch(n){}return null}async parseToASTWithDetails(n,i){this.isInitialized()||await this.initialize();const t=await a(),c=t.parseSemantic(n,i);if(c.confidence>=this.config.confidenceThreshold&&c.node)try{const n=t.buildAST(c.node);return{ast:n.ast,usedDirectPath:!0,confidence:c.confidence,lang:i,fallbackText:null,warnings:[...n.warnings??[],...e(c.node)]}}catch{}if(c.node&&this.config.fallbackOnLowConfidence){const n=t.render(c.node,"en");return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:n}}return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:null}}async getAllTranslations(n,i){const e=(await a()).getSupportedLanguages(),t={};for(const a of e)t[a]=await this.transform(n,i,a);return t}}export{c as SemanticGrammarBridge};
2
- //# sourceMappingURL=bridge-D9JLmPkk.js.map
1
+ import{D as n,d as i}from"./browser-modular-D2BHzZFB.js";import"./feature-sockets-CcTxD5sT.js";function e(n){const i=n.diagnostics;return i?.length?i.filter(n=>"unconsumed-input"===n.code).map(n=>n.message):[]}let t=null;async function a(){return t||(t=await import("./browser-modular-D2BHzZFB.js").then(function(n){return n.n})),t}class c{constructor(i={}){this._initialized=!1,this.config={confidenceThreshold:i.confidenceThreshold??n,fallbackOnLowConfidence:i.fallbackOnLowConfidence??!0}}async initialize(){await a(),this._initialized=!0}isInitialized(){return this._initialized}async transform(n,i,e){if(this.isInitialized()||await this.initialize(),i===e)return{output:n,usedSemantic:!1,confidence:1,sourceLang:i,targetLang:e};const t=await a();try{const a=t.translate(n,i,e);if(a!==n)return{output:a,usedSemantic:!0,confidence:.9,sourceLang:i,targetLang:e}}catch{}return{output:n,usedSemantic:!1,confidence:0,sourceLang:i,targetLang:e}}async parse(n,i){this.isInitialized()||await this.initialize();return(await a()).parseSemantic(n,i).node??null}async render(n,i){return(await a()).render(n,i)}async parseToAST(n,i){this.isInitialized()||await this.initialize();const e=await a(),t=e.parseSemantic(n,i);if(t.confidence>=this.config.confidenceThreshold&&t.node)try{return e.buildAST(t.node).ast}catch(n){}return null}async parseToASTWithDetails(n,i){this.isInitialized()||await this.initialize();const t=await a(),c=t.parseSemantic(n,i);if(c.confidence>=this.config.confidenceThreshold&&c.node)try{const n=t.buildAST(c.node);return{ast:n.ast,usedDirectPath:!0,confidence:c.confidence,lang:i,fallbackText:null,warnings:[...n.warnings??[],...e(c.node)]}}catch{}if(c.node&&this.config.fallbackOnLowConfidence){const n=t.render(c.node,"en");return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:n}}return{ast:null,usedDirectPath:!1,confidence:c.confidence,lang:i,fallbackText:null}}async getAllTranslations(n,i){const e=(await a()).getSupportedLanguages(),t={};for(const a of e)t[a]=await this.transform(n,i,a);return t}}export{c as SemanticGrammarBridge};
2
+ //# sourceMappingURL=bridge-BYhqTOnL.js.map