@lokascript/compilation-service 2.0.0 → 2.2.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 (31) hide show
  1. package/dist/{chunk-HMLY7DHA.js → chunk-GBPMR66W.js} +8 -1
  2. package/dist/{chunk-ODJIDVMN.js → chunk-PVQF6QYP.js} +5 -118
  3. package/dist/chunk-PVQF6QYP.js.map +1 -0
  4. package/dist/{chunk-JDOSUTCM.js → chunk-ZQ3GX55O.js} +2 -2
  5. package/dist/{core-parser-adapter-VCJB52SO-MDHRIVZ7.js → core-parser-adapter-VCJB52SO-7T2PARW4.js} +3 -3
  6. package/dist/{dist-ICUX26U7.js → dist-A6VWPCPB.js} +498 -15
  7. package/dist/dist-A6VWPCPB.js.map +1 -0
  8. package/dist/{dist-JOIDNRL3.js → dist-CYO3JGTJ.js} +32925 -24218
  9. package/dist/dist-CYO3JGTJ.js.map +1 -0
  10. package/dist/http.cjs +13467 -4407
  11. package/dist/http.cjs.map +1 -1
  12. package/dist/http.d.cts +2 -1
  13. package/dist/http.d.ts +2 -1
  14. package/dist/http.js +2 -2
  15. package/dist/index.cjs +13472 -4409
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +4 -23
  18. package/dist/index.d.ts +4 -23
  19. package/dist/index.js +9 -4
  20. package/dist/index.js.map +1 -1
  21. package/dist/{semantic-adapter-7HTMTO75-MFFBR7K3.js → semantic-adapter-7HTMTO75-WVF6UAHI.js} +2 -2
  22. package/dist/{service-891L1MYk.d.cts → service-qk1aChG9.d.cts} +6 -25
  23. package/dist/{service-891L1MYk.d.ts → service-qk1aChG9.d.ts} +6 -25
  24. package/package.json +4 -2
  25. package/dist/chunk-ODJIDVMN.js.map +0 -1
  26. package/dist/dist-ICUX26U7.js.map +0 -1
  27. package/dist/dist-JOIDNRL3.js.map +0 -1
  28. /package/dist/{chunk-HMLY7DHA.js.map → chunk-GBPMR66W.js.map} +0 -0
  29. /package/dist/{chunk-JDOSUTCM.js.map → chunk-ZQ3GX55O.js.map} +0 -0
  30. /package/dist/{core-parser-adapter-VCJB52SO-MDHRIVZ7.js.map → core-parser-adapter-VCJB52SO-7T2PARW4.js.map} +0 -0
  31. /package/dist/{semantic-adapter-7HTMTO75-MFFBR7K3.js.map → semantic-adapter-7HTMTO75-WVF6UAHI.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
- import { I as InputFormat, S as SemanticJSON, D as Diagnostic, a as CompileResponse, B as BehaviorSpec, T as TriggerDiff, O as OperationDiff, A as AbstractOperation, b as TestRenderer, c as TestRenderOptions, G as GeneratedTest, d as ComponentRenderer, e as ComponentRenderOptions, f as GeneratedComponent } from './service-891L1MYk.cjs';
2
- export { w as AddClassOp, y as AppendContentOp, P as BlurOp, C as CompilationService, g as CompileRequest, m as ComponentRequest, n as ComponentResponse, J as DecrementOp, q as DiffInput, o as DiffRequest, p as DiffResponse, K as FetchOp, M as FocusOp, l as GeneratedTestOutput, H as HideOp, F as IncrementOp, Q as LogOp, N as NavigateOp, r as OperationChangeKind, R as RemoveClassOp, t as SemanticJSONValue, s as ServiceOptions, x as SetContentOp, E as SetVariableOp, z as ShowOp, u as TargetRef, j as TestRequest, k as TestResponse, v as ToggleClassOp, h as TranslateRequest, i as TranslateResponse, L as TriggerEventOp, V as ValidationResponse, W as WaitOp } from './service-891L1MYk.cjs';
1
+ import { I as InputFormat, a as CompileResponse, B as BehaviorSpec, A as AbstractOperation, T as TriggerDiff, O as OperationDiff, b as TestRenderer, c as TestRenderOptions, G as GeneratedTest, d as ComponentRenderer, e as ComponentRenderOptions, f as GeneratedComponent } from './service-qk1aChG9.cjs';
2
+ export { g as AddClassOp, h as AppendContentOp, i as BlurOp, C as CompilationService, j as CompileRequest, k as ComponentRequest, l as ComponentResponse, D as DecrementOp, m as Diagnostic, n as DiffInput, o as DiffRequest, p as DiffResponse, F as FetchOp, q as FocusOp, r as GeneratedTestOutput, H as HideOp, s as IncrementOp, L as LogOp, N as NavigateOp, t as OperationChangeKind, R as RemoveClassOp, S as SemanticJSON, u as SemanticJSONValue, v as ServiceOptions, w as SetContentOp, x as SetVariableOp, y as ShowOp, z as TargetRef, E as TestRequest, J as TestResponse, K as ToggleClassOp, M as TranslateRequest, P as TranslateResponse, Q as TriggerEventOp, V as ValidationResponse, W as WaitOp } from './service-qk1aChG9.cjs';
3
+ export { jsonToSemanticNode, validateSemanticJSON } from '@lokascript/framework/ir';
3
4
 
4
5
  /**
5
6
  * Input format detection.
@@ -12,26 +13,6 @@ export { w as AddClassOp, y as AppendContentOp, P as BlurOp, C as CompilationSer
12
13
  */
13
14
  declare function detectFormat(input: string): InputFormat;
14
15
 
15
- /**
16
- * LLM JSON input validation.
17
- *
18
- * Validates structured semantic JSON from LLM output and converts
19
- * it to a SemanticNode compatible with the semantic package.
20
- */
21
-
22
- /**
23
- * Validate LLM JSON input structure.
24
- * Returns diagnostics (empty = valid).
25
- */
26
- declare function validateSemanticJSON(input: SemanticJSON): Diagnostic[];
27
- /**
28
- * Convert validated SemanticJSON to a SemanticNode-compatible object.
29
- *
30
- * Returns a plain object matching the SemanticNode interface from
31
- * @lokascript/semantic, using ReadonlyMap for roles.
32
- */
33
- declare function jsonToSemanticNode(input: SemanticJSON): unknown;
34
-
35
16
  /**
36
17
  * Semantic-keyed LRU cache.
37
18
  *
@@ -165,4 +146,4 @@ declare class SvelteRenderer implements ComponentRenderer {
165
146
  render(spec: BehaviorSpec, options?: ComponentRenderOptions): GeneratedComponent;
166
147
  }
167
148
 
168
- export { AbstractOperation, BehaviorSpec, CompileResponse, ComponentRenderOptions, ComponentRenderer, Diagnostic, GeneratedComponent, GeneratedTest, InputFormat, OperationDiff, PlaywrightRenderer, ReactRenderer, SemanticCache, SemanticJSON, SvelteRenderer, TestRenderOptions, TestRenderer, TriggerDiff, VueRenderer, canonicalizeOp, detectFormat, diffBehaviors, extractOperations, generateCacheKey, jsonToSemanticNode, validateSemanticJSON };
149
+ export { AbstractOperation, BehaviorSpec, CompileResponse, ComponentRenderOptions, ComponentRenderer, GeneratedComponent, GeneratedTest, InputFormat, OperationDiff, PlaywrightRenderer, ReactRenderer, SemanticCache, SvelteRenderer, TestRenderOptions, TestRenderer, TriggerDiff, VueRenderer, canonicalizeOp, detectFormat, diffBehaviors, extractOperations, generateCacheKey };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { I as InputFormat, S as SemanticJSON, D as Diagnostic, a as CompileResponse, B as BehaviorSpec, T as TriggerDiff, O as OperationDiff, A as AbstractOperation, b as TestRenderer, c as TestRenderOptions, G as GeneratedTest, d as ComponentRenderer, e as ComponentRenderOptions, f as GeneratedComponent } from './service-891L1MYk.js';
2
- export { w as AddClassOp, y as AppendContentOp, P as BlurOp, C as CompilationService, g as CompileRequest, m as ComponentRequest, n as ComponentResponse, J as DecrementOp, q as DiffInput, o as DiffRequest, p as DiffResponse, K as FetchOp, M as FocusOp, l as GeneratedTestOutput, H as HideOp, F as IncrementOp, Q as LogOp, N as NavigateOp, r as OperationChangeKind, R as RemoveClassOp, t as SemanticJSONValue, s as ServiceOptions, x as SetContentOp, E as SetVariableOp, z as ShowOp, u as TargetRef, j as TestRequest, k as TestResponse, v as ToggleClassOp, h as TranslateRequest, i as TranslateResponse, L as TriggerEventOp, V as ValidationResponse, W as WaitOp } from './service-891L1MYk.js';
1
+ import { I as InputFormat, a as CompileResponse, B as BehaviorSpec, A as AbstractOperation, T as TriggerDiff, O as OperationDiff, b as TestRenderer, c as TestRenderOptions, G as GeneratedTest, d as ComponentRenderer, e as ComponentRenderOptions, f as GeneratedComponent } from './service-qk1aChG9.js';
2
+ export { g as AddClassOp, h as AppendContentOp, i as BlurOp, C as CompilationService, j as CompileRequest, k as ComponentRequest, l as ComponentResponse, D as DecrementOp, m as Diagnostic, n as DiffInput, o as DiffRequest, p as DiffResponse, F as FetchOp, q as FocusOp, r as GeneratedTestOutput, H as HideOp, s as IncrementOp, L as LogOp, N as NavigateOp, t as OperationChangeKind, R as RemoveClassOp, S as SemanticJSON, u as SemanticJSONValue, v as ServiceOptions, w as SetContentOp, x as SetVariableOp, y as ShowOp, z as TargetRef, E as TestRequest, J as TestResponse, K as ToggleClassOp, M as TranslateRequest, P as TranslateResponse, Q as TriggerEventOp, V as ValidationResponse, W as WaitOp } from './service-qk1aChG9.js';
3
+ export { jsonToSemanticNode, validateSemanticJSON } from '@lokascript/framework/ir';
3
4
 
4
5
  /**
5
6
  * Input format detection.
@@ -12,26 +13,6 @@ export { w as AddClassOp, y as AppendContentOp, P as BlurOp, C as CompilationSer
12
13
  */
13
14
  declare function detectFormat(input: string): InputFormat;
14
15
 
15
- /**
16
- * LLM JSON input validation.
17
- *
18
- * Validates structured semantic JSON from LLM output and converts
19
- * it to a SemanticNode compatible with the semantic package.
20
- */
21
-
22
- /**
23
- * Validate LLM JSON input structure.
24
- * Returns diagnostics (empty = valid).
25
- */
26
- declare function validateSemanticJSON(input: SemanticJSON): Diagnostic[];
27
- /**
28
- * Convert validated SemanticJSON to a SemanticNode-compatible object.
29
- *
30
- * Returns a plain object matching the SemanticNode interface from
31
- * @lokascript/semantic, using ReadonlyMap for roles.
32
- */
33
- declare function jsonToSemanticNode(input: SemanticJSON): unknown;
34
-
35
16
  /**
36
17
  * Semantic-keyed LRU cache.
37
18
  *
@@ -165,4 +146,4 @@ declare class SvelteRenderer implements ComponentRenderer {
165
146
  render(spec: BehaviorSpec, options?: ComponentRenderOptions): GeneratedComponent;
166
147
  }
167
148
 
168
- export { AbstractOperation, BehaviorSpec, CompileResponse, ComponentRenderOptions, ComponentRenderer, Diagnostic, GeneratedComponent, GeneratedTest, InputFormat, OperationDiff, PlaywrightRenderer, ReactRenderer, SemanticCache, SemanticJSON, SvelteRenderer, TestRenderOptions, TestRenderer, TriggerDiff, VueRenderer, canonicalizeOp, detectFormat, diffBehaviors, extractOperations, generateCacheKey, jsonToSemanticNode, validateSemanticJSON };
149
+ export { AbstractOperation, BehaviorSpec, CompileResponse, ComponentRenderOptions, ComponentRenderer, GeneratedComponent, GeneratedTest, InputFormat, OperationDiff, PlaywrightRenderer, ReactRenderer, SemanticCache, SvelteRenderer, TestRenderOptions, TestRenderer, TriggerDiff, VueRenderer, canonicalizeOp, detectFormat, diffBehaviors, extractOperations, generateCacheKey };
package/dist/index.js CHANGED
@@ -9,11 +9,16 @@ import {
9
9
  detectFormat,
10
10
  diffBehaviors,
11
11
  extractOperations,
12
- generateCacheKey,
12
+ generateCacheKey
13
+ } from "./chunk-PVQF6QYP.js";
14
+ import "./chunk-GBPMR66W.js";
15
+
16
+ // src/input/json-schema.ts
17
+ import {
18
+ validateSemanticJSON,
13
19
  jsonToSemanticNode,
14
- validateSemanticJSON
15
- } from "./chunk-ODJIDVMN.js";
16
- import "./chunk-HMLY7DHA.js";
20
+ semanticNodeToJSON
21
+ } from "@lokascript/framework/ir";
17
22
  export {
18
23
  CompilationService,
19
24
  PlaywrightRenderer,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../src/input/json-schema.ts"],"sourcesContent":["/**\n * LLM JSON input validation and conversion.\n *\n * Re-exports from @lokascript/framework/ir — the canonical IR layer.\n */\n\nexport {\n validateSemanticJSON,\n jsonToSemanticNode,\n semanticNodeToJSON,\n} from '@lokascript/framework/ir';\n"],"mappings":";;;;;;;;;;;;;;;;AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
@@ -3,10 +3,10 @@ import {
3
3
  convertSemanticASTToAOT,
4
4
  createSemanticAdapter
5
5
  } from "./chunk-CY26COTT.js";
6
- import "./chunk-HMLY7DHA.js";
6
+ import "./chunk-GBPMR66W.js";
7
7
  export {
8
8
  SemanticParserAdapter,
9
9
  convertSemanticASTToAOT,
10
10
  createSemanticAdapter
11
11
  };
12
- //# sourceMappingURL=semantic-adapter-7HTMTO75-MFFBR7K3.js.map
12
+ //# sourceMappingURL=semantic-adapter-7HTMTO75-WVF6UAHI.js.map
@@ -1,3 +1,5 @@
1
+ import { SemanticJSON as SemanticJSON$1, SemanticJSONValue as SemanticJSONValue$1 } from '@lokascript/framework/ir';
2
+
1
3
  /**
2
4
  * Abstract Operation Types
3
5
  *
@@ -314,30 +316,9 @@ interface TranslateRequest {
314
316
  /** Target language */
315
317
  to: string;
316
318
  }
317
- /**
318
- * Structured semantic representation for LLM output.
319
- * This is the "reliable input format" — no parsing ambiguity.
320
- */
321
- interface SemanticJSON {
322
- /** Command name (e.g., "toggle", "add", "set", "put") */
323
- action: string;
324
- /** Semantic roles mapping */
325
- roles: Record<string, SemanticJSONValue>;
326
- /** Event trigger (for event handlers) */
327
- trigger?: {
328
- event: string;
329
- modifiers?: Record<string, unknown>;
330
- };
331
- }
332
- /**
333
- * A typed value in a semantic role.
334
- */
335
- interface SemanticJSONValue {
336
- /** Value type */
337
- type: 'selector' | 'literal' | 'reference' | 'expression' | 'property-path';
338
- /** The value */
339
- value: string | number | boolean;
340
- }
319
+
320
+ type SemanticJSON = SemanticJSON$1;
321
+ type SemanticJSONValue = SemanticJSONValue$1;
341
322
  /**
342
323
  * Compilation response.
343
324
  */
@@ -592,4 +573,4 @@ declare class CompilationService {
592
573
  clearCache(): void;
593
574
  }
594
575
 
595
- export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type Diagnostic as D, type SetVariableOp as E, type IncrementOp as F, type GeneratedTest as G, type HideOp as H, type InputFormat as I, type DecrementOp as J, type FetchOp as K, type TriggerEventOp as L, type FocusOp as M, type NavigateOp as N, type OperationDiff as O, type BlurOp as P, type LogOp as Q, type RemoveClassOp as R, type SemanticJSON as S, type TriggerDiff as T, type ValidationResponse as V, type WaitOp as W, type CompileResponse as a, type TestRenderer as b, type TestRenderOptions as c, type ComponentRenderer as d, type ComponentRenderOptions as e, type GeneratedComponent as f, type CompileRequest as g, type TranslateRequest as h, type TranslateResponse as i, type TestRequest as j, type TestResponse as k, type GeneratedTestOutput as l, type ComponentRequest as m, type ComponentResponse as n, type DiffRequest as o, type DiffResponse as p, type DiffInput as q, type OperationChangeKind as r, type ServiceOptions as s, type SemanticJSONValue as t, type TargetRef as u, type ToggleClassOp as v, type AddClassOp as w, type SetContentOp as x, type AppendContentOp as y, type ShowOp as z };
576
+ export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type DecrementOp as D, type TestRequest as E, type FetchOp as F, type GeneratedTest as G, type HideOp as H, type InputFormat as I, type TestResponse as J, type ToggleClassOp as K, type LogOp as L, type TranslateRequest as M, type NavigateOp as N, type OperationDiff as O, type TranslateResponse as P, type TriggerEventOp as Q, type RemoveClassOp as R, type SemanticJSON as S, type TriggerDiff as T, type ValidationResponse as V, type WaitOp as W, type CompileResponse as a, type TestRenderer as b, type TestRenderOptions as c, type ComponentRenderer as d, type ComponentRenderOptions as e, type GeneratedComponent as f, type AddClassOp as g, type AppendContentOp as h, type BlurOp as i, type CompileRequest as j, type ComponentRequest as k, type ComponentResponse as l, type Diagnostic as m, type DiffInput as n, type DiffRequest as o, type DiffResponse as p, type FocusOp as q, type GeneratedTestOutput as r, type IncrementOp as s, type OperationChangeKind as t, type SemanticJSONValue as u, type ServiceOptions as v, type SetContentOp as w, type SetVariableOp as x, type ShowOp as y, type TargetRef as z };
@@ -1,3 +1,5 @@
1
+ import { SemanticJSON as SemanticJSON$1, SemanticJSONValue as SemanticJSONValue$1 } from '@lokascript/framework/ir';
2
+
1
3
  /**
2
4
  * Abstract Operation Types
3
5
  *
@@ -314,30 +316,9 @@ interface TranslateRequest {
314
316
  /** Target language */
315
317
  to: string;
316
318
  }
317
- /**
318
- * Structured semantic representation for LLM output.
319
- * This is the "reliable input format" — no parsing ambiguity.
320
- */
321
- interface SemanticJSON {
322
- /** Command name (e.g., "toggle", "add", "set", "put") */
323
- action: string;
324
- /** Semantic roles mapping */
325
- roles: Record<string, SemanticJSONValue>;
326
- /** Event trigger (for event handlers) */
327
- trigger?: {
328
- event: string;
329
- modifiers?: Record<string, unknown>;
330
- };
331
- }
332
- /**
333
- * A typed value in a semantic role.
334
- */
335
- interface SemanticJSONValue {
336
- /** Value type */
337
- type: 'selector' | 'literal' | 'reference' | 'expression' | 'property-path';
338
- /** The value */
339
- value: string | number | boolean;
340
- }
319
+
320
+ type SemanticJSON = SemanticJSON$1;
321
+ type SemanticJSONValue = SemanticJSONValue$1;
341
322
  /**
342
323
  * Compilation response.
343
324
  */
@@ -592,4 +573,4 @@ declare class CompilationService {
592
573
  clearCache(): void;
593
574
  }
594
575
 
595
- export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type Diagnostic as D, type SetVariableOp as E, type IncrementOp as F, type GeneratedTest as G, type HideOp as H, type InputFormat as I, type DecrementOp as J, type FetchOp as K, type TriggerEventOp as L, type FocusOp as M, type NavigateOp as N, type OperationDiff as O, type BlurOp as P, type LogOp as Q, type RemoveClassOp as R, type SemanticJSON as S, type TriggerDiff as T, type ValidationResponse as V, type WaitOp as W, type CompileResponse as a, type TestRenderer as b, type TestRenderOptions as c, type ComponentRenderer as d, type ComponentRenderOptions as e, type GeneratedComponent as f, type CompileRequest as g, type TranslateRequest as h, type TranslateResponse as i, type TestRequest as j, type TestResponse as k, type GeneratedTestOutput as l, type ComponentRequest as m, type ComponentResponse as n, type DiffRequest as o, type DiffResponse as p, type DiffInput as q, type OperationChangeKind as r, type ServiceOptions as s, type SemanticJSONValue as t, type TargetRef as u, type ToggleClassOp as v, type AddClassOp as w, type SetContentOp as x, type AppendContentOp as y, type ShowOp as z };
576
+ export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type DecrementOp as D, type TestRequest as E, type FetchOp as F, type GeneratedTest as G, type HideOp as H, type InputFormat as I, type TestResponse as J, type ToggleClassOp as K, type LogOp as L, type TranslateRequest as M, type NavigateOp as N, type OperationDiff as O, type TranslateResponse as P, type TriggerEventOp as Q, type RemoveClassOp as R, type SemanticJSON as S, type TriggerDiff as T, type ValidationResponse as V, type WaitOp as W, type CompileResponse as a, type TestRenderer as b, type TestRenderOptions as c, type ComponentRenderer as d, type ComponentRenderOptions as e, type GeneratedComponent as f, type AddClassOp as g, type AppendContentOp as h, type BlurOp as i, type CompileRequest as j, type ComponentRequest as k, type ComponentResponse as l, type Diagnostic as m, type DiffInput as n, type DiffRequest as o, type DiffResponse as p, type FocusOp as q, type GeneratedTestOutput as r, type IncrementOp as s, type OperationChangeKind as t, type SemanticJSONValue as u, type ServiceOptions as v, type SetContentOp as w, type SetVariableOp as x, type ShowOp as y, type TargetRef as z };
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@lokascript/compilation-service",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Semantic compilation service for LokaScript - validates and compiles hyperscript from 24 languages, explicit syntax, or LLM JSON",
5
5
  "type": "module",
6
+ "sideEffects": false,
6
7
  "main": "./dist/index.cjs",
7
8
  "module": "./dist/index.js",
8
9
  "types": "./dist/index.d.ts",
@@ -33,6 +34,7 @@
33
34
  "clean": "rm -rf dist"
34
35
  },
35
36
  "dependencies": {
37
+ "@lokascript/framework": "*",
36
38
  "hono": "^4.11.7"
37
39
  },
38
40
  "devDependencies": {
@@ -42,7 +44,7 @@
42
44
  "@types/node": "^20.11.0",
43
45
  "tsup": "^8.0.1",
44
46
  "typescript": "^5.3.3",
45
- "vitest": "^1.2.0"
47
+ "vitest": "^3.2.4"
46
48
  },
47
49
  "peerDependencies": {
48
50
  "@lokascript/semantic": "*"