@lokascript/compilation-service 2.0.0 → 2.1.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.
- package/dist/{chunk-ODJIDVMN.js → chunk-JGAJAREK.js} +5 -118
- package/dist/chunk-JGAJAREK.js.map +1 -0
- package/dist/{chunk-JDOSUTCM.js → chunk-UQULNKOC.js} +2 -2
- package/dist/{core-parser-adapter-VCJB52SO-MDHRIVZ7.js → core-parser-adapter-VCJB52SO-5HK2TL6Q.js} +2 -2
- package/dist/{dist-JOIDNRL3.js → dist-KBC4YRQJ.js} +923 -253
- package/dist/dist-KBC4YRQJ.js.map +1 -0
- package/dist/{dist-ICUX26U7.js → dist-SWJWTU4Z.js} +550 -13
- package/dist/dist-SWJWTU4Z.js.map +1 -0
- package/dist/http.cjs +1473 -381
- package/dist/http.cjs.map +1 -1
- package/dist/http.d.cts +2 -1
- package/dist/http.d.ts +2 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +1478 -383
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -23
- package/dist/index.d.ts +4 -23
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/{service-891L1MYk.d.cts → service-qk1aChG9.d.cts} +6 -25
- package/dist/{service-891L1MYk.d.ts → service-qk1aChG9.d.ts} +6 -25
- package/package.json +3 -1
- package/dist/chunk-ODJIDVMN.js.map +0 -1
- package/dist/dist-ICUX26U7.js.map +0 -1
- package/dist/dist-JOIDNRL3.js.map +0 -1
- /package/dist/{chunk-JDOSUTCM.js.map → chunk-UQULNKOC.js.map} +0 -0
- /package/dist/{core-parser-adapter-VCJB52SO-MDHRIVZ7.js.map → core-parser-adapter-VCJB52SO-5HK2TL6Q.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { I as InputFormat,
|
|
2
|
-
export {
|
|
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,
|
|
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,
|
|
2
|
-
export {
|
|
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,
|
|
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
|
|
13
|
-
|
|
14
|
-
validateSemanticJSON
|
|
15
|
-
} from "./chunk-ODJIDVMN.js";
|
|
12
|
+
generateCacheKey
|
|
13
|
+
} from "./chunk-JGAJAREK.js";
|
|
16
14
|
import "./chunk-HMLY7DHA.js";
|
|
15
|
+
|
|
16
|
+
// src/input/json-schema.ts
|
|
17
|
+
import {
|
|
18
|
+
validateSemanticJSON,
|
|
19
|
+
jsonToSemanticNode,
|
|
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":[]}
|
|
@@ -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
|
-
|
|
319
|
-
|
|
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
|
|
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
|
-
|
|
319
|
-
|
|
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
|
|
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.
|
|
3
|
+
"version": "2.1.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": {
|