@lokascript/compilation-service 2.10.0 → 2.11.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.
- package/dist/{chunk-SB5NPMTN.js → chunk-BDISUJ32.js} +2 -2
- package/dist/{chunk-4ML32LEX.js → chunk-HRUSP6F2.js} +128 -2
- package/dist/chunk-HRUSP6F2.js.map +1 -0
- package/dist/{core-parser-adapter-VCJB52SO-3GSEHXCZ.js → core-parser-adapter-VCJB52SO-W3GDT5C6.js} +2 -2
- package/dist/{dist-CIDZTZVT.js → dist-4JWIJVFR.js} +3 -3
- package/dist/{dist-I7VYJWBF.js → dist-MGUUIWYB.js} +221 -34
- package/dist/dist-MGUUIWYB.js.map +1 -0
- package/dist/http.cjs +349 -37
- 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 +351 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/{service-ZMZn7WPv.d.cts → service-IyB2DZOm.d.cts} +48 -1
- package/dist/{service-ZMZn7WPv.d.ts → service-IyB2DZOm.d.ts} +48 -1
- package/package.json +6 -6
- package/dist/chunk-4ML32LEX.js.map +0 -1
- package/dist/dist-I7VYJWBF.js.map +0 -1
- /package/dist/{chunk-SB5NPMTN.js.map → chunk-BDISUJ32.js.map} +0 -0
- /package/dist/{core-parser-adapter-VCJB52SO-3GSEHXCZ.js.map → core-parser-adapter-VCJB52SO-W3GDT5C6.js.map} +0 -0
- /package/dist/{dist-CIDZTZVT.js.map → dist-4JWIJVFR.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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-
|
|
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
|
|
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-IyB2DZOm.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 ScoreRequest, u as ScoreResponse, v as SemanticJSON, w as SemanticJSONValue, x as ServiceOptions, y as SetContentOp, z as SetVariableOp, E as ShowOp, J as TargetRef, K as TestRequest, M as TestResponse, P as ToggleClassOp, Q as TranslateRequest, U as TranslateResponse, V as TriggerEventOp, W as ValidationResponse, X as WaitOp } from './service-IyB2DZOm.cjs';
|
|
3
3
|
export { jsonToSemanticNode, validateSemanticJSON } from '@lokascript/framework/ir';
|
|
4
|
+
export { FidelityReport, FidelityScores, scoreNodes } from '@lokascript/semantic/fidelity';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Input format detection.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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-
|
|
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
|
|
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-IyB2DZOm.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 ScoreRequest, u as ScoreResponse, v as SemanticJSON, w as SemanticJSONValue, x as ServiceOptions, y as SetContentOp, z as SetVariableOp, E as ShowOp, J as TargetRef, K as TestRequest, M as TestResponse, P as ToggleClassOp, Q as TranslateRequest, U as TranslateResponse, V as TriggerEventOp, W as ValidationResponse, X as WaitOp } from './service-IyB2DZOm.js';
|
|
3
3
|
export { jsonToSemanticNode, validateSemanticJSON } from '@lokascript/framework/ir';
|
|
4
|
+
export { FidelityReport, FidelityScores, scoreNodes } from '@lokascript/semantic/fidelity';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Input format detection.
|
package/dist/index.js
CHANGED
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
detectFormat,
|
|
10
10
|
diffBehaviors,
|
|
11
11
|
extractOperations,
|
|
12
|
-
generateCacheKey
|
|
13
|
-
|
|
12
|
+
generateCacheKey,
|
|
13
|
+
scoreNodes
|
|
14
|
+
} from "./chunk-HRUSP6F2.js";
|
|
14
15
|
import "./chunk-GBPMR66W.js";
|
|
15
16
|
|
|
16
17
|
// src/input/json-schema.ts
|
|
@@ -32,6 +33,7 @@ export {
|
|
|
32
33
|
extractOperations,
|
|
33
34
|
generateCacheKey,
|
|
34
35
|
jsonToSemanticNode,
|
|
36
|
+
scoreNodes,
|
|
35
37
|
validateSemanticJSON
|
|
36
38
|
};
|
|
37
39
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,4 @@
|
|
|
1
|
+
import { FidelityReport } from '@lokascript/semantic/fidelity';
|
|
1
2
|
import { SemanticJSON as SemanticJSON$1, SemanticJSONValue as SemanticJSONValue$1 } from '@lokascript/framework/ir';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -276,6 +277,31 @@ interface OperationDiff {
|
|
|
276
277
|
changes?: string[];
|
|
277
278
|
}
|
|
278
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Structural fidelity scoring — `scoreFidelity()` (agent-era arc 4).
|
|
282
|
+
*
|
|
283
|
+
* The scorer itself (`scoreNodes` and its report types) lives in
|
|
284
|
+
* `@lokascript/semantic/fidelity` since arc 5 slice 2, so the language
|
|
285
|
+
* server's translate-with-verification request and this service share ONE
|
|
286
|
+
* implementation; this module re-exports it for API compatibility and adds
|
|
287
|
+
* the service-level request/response shapes. See that module for signal
|
|
288
|
+
* semantics; docs/FIDELITY.md for the methodology.
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
/** Score request — a candidate scored against a reference. Sides accept the
|
|
292
|
+
* same input formats as diff/compile and may be in different languages. */
|
|
293
|
+
interface ScoreRequest {
|
|
294
|
+
reference: DiffInput;
|
|
295
|
+
candidate: DiffInput;
|
|
296
|
+
/** Minimum confidence for natural language parsing (default 0.7) */
|
|
297
|
+
confidence?: number;
|
|
298
|
+
}
|
|
299
|
+
interface ScoreResponse extends Partial<FidelityReport> {
|
|
300
|
+
/** Whether both sides parsed successfully. */
|
|
301
|
+
ok: boolean;
|
|
302
|
+
diagnostics: Diagnostic[];
|
|
303
|
+
}
|
|
304
|
+
|
|
279
305
|
/**
|
|
280
306
|
* Types for the Compilation Service.
|
|
281
307
|
*
|
|
@@ -315,6 +341,8 @@ interface TranslateRequest {
|
|
|
315
341
|
from: string;
|
|
316
342
|
/** Target language */
|
|
317
343
|
to: string;
|
|
344
|
+
/** Verify the translation against the source via scoreFidelity (default true). */
|
|
345
|
+
verify?: boolean;
|
|
318
346
|
}
|
|
319
347
|
|
|
320
348
|
type SemanticJSON = SemanticJSON$1;
|
|
@@ -359,6 +387,16 @@ interface TranslateResponse {
|
|
|
359
387
|
ok: boolean;
|
|
360
388
|
/** Translated code */
|
|
361
389
|
code?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Fidelity verification of the translation against its source (arc 5's
|
|
392
|
+
* verified-translation badge): the output scored as candidate against the
|
|
393
|
+
* input as reference via scoreFidelity(). ADVISORY — a verification that
|
|
394
|
+
* fails to parse never flips `ok`, and its diagnostics stay inside this
|
|
395
|
+
* object. `verification.faithful === true` is the claim "this rendering is
|
|
396
|
+
* structurally exact"; absent when the caller passed `verify: false` or
|
|
397
|
+
* translation itself failed.
|
|
398
|
+
*/
|
|
399
|
+
verification?: ScoreResponse;
|
|
362
400
|
/** Diagnostics */
|
|
363
401
|
diagnostics: Diagnostic[];
|
|
364
402
|
}
|
|
@@ -593,6 +631,15 @@ declare class CompilationService {
|
|
|
593
631
|
* as abstract operations. Same behavior in different languages → identical.
|
|
594
632
|
*/
|
|
595
633
|
diff(request: DiffRequest): DiffResponse;
|
|
634
|
+
/**
|
|
635
|
+
* Score a candidate against a reference for structural fidelity — the
|
|
636
|
+
* multilingual ratchet's scorers (docs/FIDELITY.md) applied to one pair of
|
|
637
|
+
* inputs. Sides accept any input format and may be in different languages;
|
|
638
|
+
* see src/scoring/score.ts for signal semantics. Complementary to diff():
|
|
639
|
+
* diff answers "identical, and where not?", this answers "how faithful, and
|
|
640
|
+
* what exactly is missing or hallucinated?".
|
|
641
|
+
*/
|
|
642
|
+
scoreFidelity(request: ScoreRequest): ScoreResponse;
|
|
596
643
|
/**
|
|
597
644
|
* Generate a target-specific output from LSE (bracket syntax or protocol JSON).
|
|
598
645
|
*
|
|
@@ -622,4 +669,4 @@ declare class CompilationService {
|
|
|
622
669
|
clearCache(): void;
|
|
623
670
|
}
|
|
624
671
|
|
|
625
|
-
export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type DecrementOp as D, type
|
|
672
|
+
export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type DecrementOp as D, type ShowOp as E, type FetchOp as F, type GeneratedTest as G, type HideOp as H, type InputFormat as I, type TargetRef as J, type TestRequest as K, type LogOp as L, type TestResponse as M, type NavigateOp as N, type OperationDiff as O, type ToggleClassOp as P, type TranslateRequest as Q, type RemoveClassOp as R, type ScoreRequest as S, type TriggerDiff as T, type TranslateResponse as U, type TriggerEventOp as V, type ValidationResponse as W, type WaitOp as X, 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 ScoreResponse as u, type SemanticJSON as v, type SemanticJSONValue as w, type ServiceOptions as x, type SetContentOp as y, type SetVariableOp as z };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FidelityReport } from '@lokascript/semantic/fidelity';
|
|
1
2
|
import { SemanticJSON as SemanticJSON$1, SemanticJSONValue as SemanticJSONValue$1 } from '@lokascript/framework/ir';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -276,6 +277,31 @@ interface OperationDiff {
|
|
|
276
277
|
changes?: string[];
|
|
277
278
|
}
|
|
278
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Structural fidelity scoring — `scoreFidelity()` (agent-era arc 4).
|
|
282
|
+
*
|
|
283
|
+
* The scorer itself (`scoreNodes` and its report types) lives in
|
|
284
|
+
* `@lokascript/semantic/fidelity` since arc 5 slice 2, so the language
|
|
285
|
+
* server's translate-with-verification request and this service share ONE
|
|
286
|
+
* implementation; this module re-exports it for API compatibility and adds
|
|
287
|
+
* the service-level request/response shapes. See that module for signal
|
|
288
|
+
* semantics; docs/FIDELITY.md for the methodology.
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
/** Score request — a candidate scored against a reference. Sides accept the
|
|
292
|
+
* same input formats as diff/compile and may be in different languages. */
|
|
293
|
+
interface ScoreRequest {
|
|
294
|
+
reference: DiffInput;
|
|
295
|
+
candidate: DiffInput;
|
|
296
|
+
/** Minimum confidence for natural language parsing (default 0.7) */
|
|
297
|
+
confidence?: number;
|
|
298
|
+
}
|
|
299
|
+
interface ScoreResponse extends Partial<FidelityReport> {
|
|
300
|
+
/** Whether both sides parsed successfully. */
|
|
301
|
+
ok: boolean;
|
|
302
|
+
diagnostics: Diagnostic[];
|
|
303
|
+
}
|
|
304
|
+
|
|
279
305
|
/**
|
|
280
306
|
* Types for the Compilation Service.
|
|
281
307
|
*
|
|
@@ -315,6 +341,8 @@ interface TranslateRequest {
|
|
|
315
341
|
from: string;
|
|
316
342
|
/** Target language */
|
|
317
343
|
to: string;
|
|
344
|
+
/** Verify the translation against the source via scoreFidelity (default true). */
|
|
345
|
+
verify?: boolean;
|
|
318
346
|
}
|
|
319
347
|
|
|
320
348
|
type SemanticJSON = SemanticJSON$1;
|
|
@@ -359,6 +387,16 @@ interface TranslateResponse {
|
|
|
359
387
|
ok: boolean;
|
|
360
388
|
/** Translated code */
|
|
361
389
|
code?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Fidelity verification of the translation against its source (arc 5's
|
|
392
|
+
* verified-translation badge): the output scored as candidate against the
|
|
393
|
+
* input as reference via scoreFidelity(). ADVISORY — a verification that
|
|
394
|
+
* fails to parse never flips `ok`, and its diagnostics stay inside this
|
|
395
|
+
* object. `verification.faithful === true` is the claim "this rendering is
|
|
396
|
+
* structurally exact"; absent when the caller passed `verify: false` or
|
|
397
|
+
* translation itself failed.
|
|
398
|
+
*/
|
|
399
|
+
verification?: ScoreResponse;
|
|
362
400
|
/** Diagnostics */
|
|
363
401
|
diagnostics: Diagnostic[];
|
|
364
402
|
}
|
|
@@ -593,6 +631,15 @@ declare class CompilationService {
|
|
|
593
631
|
* as abstract operations. Same behavior in different languages → identical.
|
|
594
632
|
*/
|
|
595
633
|
diff(request: DiffRequest): DiffResponse;
|
|
634
|
+
/**
|
|
635
|
+
* Score a candidate against a reference for structural fidelity — the
|
|
636
|
+
* multilingual ratchet's scorers (docs/FIDELITY.md) applied to one pair of
|
|
637
|
+
* inputs. Sides accept any input format and may be in different languages;
|
|
638
|
+
* see src/scoring/score.ts for signal semantics. Complementary to diff():
|
|
639
|
+
* diff answers "identical, and where not?", this answers "how faithful, and
|
|
640
|
+
* what exactly is missing or hallucinated?".
|
|
641
|
+
*/
|
|
642
|
+
scoreFidelity(request: ScoreRequest): ScoreResponse;
|
|
596
643
|
/**
|
|
597
644
|
* Generate a target-specific output from LSE (bracket syntax or protocol JSON).
|
|
598
645
|
*
|
|
@@ -622,4 +669,4 @@ declare class CompilationService {
|
|
|
622
669
|
clearCache(): void;
|
|
623
670
|
}
|
|
624
671
|
|
|
625
|
-
export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type DecrementOp as D, type
|
|
672
|
+
export { type AbstractOperation as A, type BehaviorSpec as B, CompilationService as C, type DecrementOp as D, type ShowOp as E, type FetchOp as F, type GeneratedTest as G, type HideOp as H, type InputFormat as I, type TargetRef as J, type TestRequest as K, type LogOp as L, type TestResponse as M, type NavigateOp as N, type OperationDiff as O, type ToggleClassOp as P, type TranslateRequest as Q, type RemoveClassOp as R, type ScoreRequest as S, type TriggerDiff as T, type TranslateResponse as U, type TriggerEventOp as V, type ValidationResponse as W, type WaitOp as X, 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 ScoreResponse as u, type SemanticJSON as v, type SemanticJSONValue as w, type ServiceOptions as x, type SetContentOp as y, type SetVariableOp as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokascript/compilation-service",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.1",
|
|
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
6
|
"sideEffects": false,
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
"clean": "rm -rf dist"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@lokascript/framework": "^2.
|
|
39
|
-
"hono": "^4.
|
|
38
|
+
"@lokascript/framework": "^2.11.1",
|
|
39
|
+
"hono": "^4.13.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@hono/node-server": "^2.0.11",
|
|
43
|
-
"@hyperfixi/aot-compiler": "^2.
|
|
44
|
-
"@lokascript/semantic": "^2.
|
|
43
|
+
"@hyperfixi/aot-compiler": "^2.11.1",
|
|
44
|
+
"@lokascript/semantic": "^2.11.1",
|
|
45
45
|
"@types/node": "^26.1.2",
|
|
46
46
|
"tsup": "^8.0.1",
|
|
47
47
|
"typescript": "^5.3.3",
|
|
48
48
|
"vitest": "^4.1.5"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@lokascript/semantic": "^2.
|
|
51
|
+
"@lokascript/semantic": "^2.11.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"@lokascript/semantic": {
|