@lokascript/semantic 2.6.0 → 2.7.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 (40) hide show
  1. package/dist/browser-ar.ar.global.js +5 -5
  2. package/dist/browser-bn.bn.global.js +4 -4
  3. package/dist/browser-de.de.global.js +4 -4
  4. package/dist/browser-east-asian.east-asian.global.js +3 -3
  5. package/dist/browser-en-tr.en-tr.global.js +4 -4
  6. package/dist/browser-es.es.global.js +4 -4
  7. package/dist/browser-fr.fr.global.js +3 -3
  8. package/dist/browser-hi.hi.global.js +3 -3
  9. package/dist/browser-id.id.global.js +4 -4
  10. package/dist/browser-it.it.global.js +3 -3
  11. package/dist/browser-ja.ja.global.js +4 -4
  12. package/dist/browser-ko.ko.global.js +5 -5
  13. package/dist/browser-lazy.lazy.global.js +1 -1
  14. package/dist/browser-ms.ms.global.js +4 -4
  15. package/dist/browser-pl.pl.global.js +4 -4
  16. package/dist/browser-priority.priority.global.js +1 -1
  17. package/dist/browser-qu.qu.global.js +5 -5
  18. package/dist/browser-ru.ru.global.js +5 -5
  19. package/dist/browser-sw.sw.global.js +4 -4
  20. package/dist/browser-th.th.global.js +3 -3
  21. package/dist/browser-tl.tl.global.js +4 -4
  22. package/dist/browser-tr.tr.global.js +4 -4
  23. package/dist/browser-uk.uk.global.js +5 -5
  24. package/dist/browser-vi.vi.global.js +3 -3
  25. package/dist/browser.global.js +22 -22
  26. package/dist/browser.global.js.map +1 -1
  27. package/dist/generators/index.d.ts +1 -0
  28. package/dist/generators/index.d.ts.map +1 -1
  29. package/dist/generators/profile-queries.d.ts +32 -0
  30. package/dist/generators/profile-queries.d.ts.map +1 -0
  31. package/dist/index.cjs +19 -0
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +17 -0
  36. package/dist/index.js.map +1 -1
  37. package/package.json +3 -3
  38. package/src/generators/index.ts +3 -0
  39. package/src/generators/profile-queries.ts +53 -0
  40. package/src/index.ts +4 -0
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export { type LanguageProfile, type WordOrder, type MarkingStrategy, type RoleMarker, type VerbConfig, type VerbForm, type KeywordTranslation, type TokenizationConfig, englishProfile, japaneseProfile, arabicProfile, spanishProfile, koreanProfile, chineseProfile, turkishProfile, portugueseProfile, frenchProfile, germanProfile, indonesianProfile, quechuaProfile, swahiliProfile, italianProfile, polishProfile, russianProfile, ukrainianProfile, hindiProfile, bengaliProfile, vietnameseProfile, hebrewProfile, thaiProfile, malayProfile, tagalogProfile, } from './language-profiles';
8
8
  export { KNOWN_PROFILES } from './known-profiles';
9
+ export { getKeywordTranslations, getRoleMarkers } from './profile-queries';
9
10
  export { type CommandSchema, type CommandPrecondition, type RoleSpec, type CommandCategory, toggleSchema, addSchema, removeSchema, putSchema, setSchema, showSchema, hideSchema, onSchema, triggerSchema, waitSchema, fetchSchema, goSchema, incrementSchema, decrementSchema, appendSchema, prependSchema, logSchema, sendSchema, takeSchema, makeSchema, cloneSchema, getCommandSchema, callSchema, returnSchema, focusSchema, blurSchema, swapSchema, morphSchema, haltSchema, behaviorSchema, installSchema, measureSchema, commandSchemas, getSchema, getSchemasByCategory, getDefinedSchemas, } from './command-schemas';
10
11
  export { type GeneratorConfig, generatePattern, generateSimplePattern, generatePatternVariants, generatePatternsForLanguage, generatePatternsForCommand, generateAllPatterns, getGeneratorSummary, validateLanguageKeywords, } from './pattern-generator';
11
12
  export { type SchemaValidationItem, type SchemaValidationSeverity, type SchemaValidation, type SchemaValidationResult, SchemaErrorCodes, validateCommandSchema, validateAllSchemas, formatValidationResults, getValidationStats, } from './schema-validator';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generators/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,UAAU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BAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,eAAe,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generators/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG3E,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,aAAa,EACb,UAAU,EACV,WAAW,EACX,QAAQ,EACR,eAAe,EACf,eAAe,EACf,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EAEV,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAEhB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,UAAU,EAEV,UAAU,EACV,WAAW,EAEX,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EAEb,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK,eAAe,EACpB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,KAAK,eAAe,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Small query helpers over the language-profile manifest.
3
+ *
4
+ * Public API for consumers that need per-language profile facts without
5
+ * hand-rolling profile iteration (mcp-server's profile tools,
6
+ * language-server hovers, framework-bridge domains). Backed by
7
+ * `KNOWN_PROFILES` (every defined profile, independent of runtime
8
+ * registration) — pass an explicit `languages` list to narrow.
9
+ */
10
+ import type { SemanticRole } from '../types';
11
+ import type { KeywordTranslation, RoleMarker } from './profiles/types';
12
+ /**
13
+ * Look up one keyword's translations across languages.
14
+ *
15
+ * @param keyword - Profile keyword / action name (e.g. `toggle`, `set`)
16
+ * @param languages - Language codes to include (default: every known profile)
17
+ * @returns Map of language code → translation, with entries only for
18
+ * languages whose profile defines the keyword
19
+ */
20
+ export declare function getKeywordTranslations(keyword: string, languages?: readonly string[]): Record<string, KeywordTranslation>;
21
+ /**
22
+ * Look up a language's grammatical role markers.
23
+ *
24
+ * @param language - Language code (e.g. `ja`)
25
+ * @param role - Optional semantic role; when given, returns that role's
26
+ * marker only
27
+ * @returns The marker(s), or `undefined` when the language is unknown or
28
+ * has no marker for the requested role
29
+ */
30
+ export declare function getRoleMarkers(language: string): Partial<Record<SemanticRole, RoleMarker>>;
31
+ export declare function getRoleMarkers(language: string, role: SemanticRole): RoleMarker | undefined;
32
+ //# sourceMappingURL=profile-queries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-queries.d.ts","sourceRoot":"","sources":["../../src/generators/profile-queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGvE;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAC5B,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAQpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;AAC5F,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC"}
package/dist/index.cjs CHANGED
@@ -25784,6 +25784,7 @@ __export(index_exports, {
25784
25784
  getEventHandlerPatternsForLanguage: () => getEventHandlerPatternsForLanguage,
25785
25785
  getGeneratorSummary: () => getGeneratorSummary,
25786
25786
  getHyperscriptExtractors: () => getHyperscriptExtractors,
25787
+ getKeywordTranslations: () => getKeywordTranslations,
25787
25788
  getLoadedLanguages: () => getLoadedLanguages,
25788
25789
  getPatternById: () => getPatternById,
25789
25790
  getPatternStats: () => getPatternStats,
@@ -25792,6 +25793,7 @@ __export(index_exports, {
25792
25793
  getPutPatternsForLanguage: () => getPutPatternsForLanguage,
25793
25794
  getRegisteredLanguages: () => getRegisteredLanguages,
25794
25795
  getRegisteredMappers: () => getRegisteredMappers,
25796
+ getRoleMarkers: () => getRoleMarkers,
25795
25797
  getSchema: () => getSchema,
25796
25798
  getSchemasByCategory: () => getSchemasByCategory,
25797
25799
  getSupportedCommands: () => getSupportedCommands,
@@ -39614,6 +39616,21 @@ init_turkish();
39614
39616
  init_ukrainian();
39615
39617
  init_vietnamese();
39616
39618
 
39619
+ // src/generators/profile-queries.ts
39620
+ function getKeywordTranslations(keyword, languages) {
39621
+ const codes = languages ?? Object.keys(KNOWN_PROFILES);
39622
+ const translations = {};
39623
+ for (const code of codes) {
39624
+ const translation = KNOWN_PROFILES[code]?.keywords[keyword];
39625
+ if (translation) translations[code] = translation;
39626
+ }
39627
+ return translations;
39628
+ }
39629
+ function getRoleMarkers(language, role) {
39630
+ const markers = KNOWN_PROFILES[language]?.roleMarkers ?? {};
39631
+ return role ? markers[role] : markers;
39632
+ }
39633
+
39617
39634
  // src/generators/index.ts
39618
39635
  init_command_schemas();
39619
39636
  init_pattern_generator();
@@ -40480,6 +40497,7 @@ function parseSemantic(code, language) {
40480
40497
  getEventHandlerPatternsForLanguage,
40481
40498
  getGeneratorSummary,
40482
40499
  getHyperscriptExtractors,
40500
+ getKeywordTranslations,
40483
40501
  getLoadedLanguages,
40484
40502
  getPatternById,
40485
40503
  getPatternStats,
@@ -40488,6 +40506,7 @@ function parseSemantic(code, language) {
40488
40506
  getPutPatternsForLanguage,
40489
40507
  getRegisteredLanguages,
40490
40508
  getRegisteredMappers,
40509
+ getRoleMarkers,
40491
40510
  getSchema,
40492
40511
  getSchemasByCategory,
40493
40512
  getSupportedCommands,