@lemmabase/lemma-engine 0.9.2 → 0.9.3
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/README.md +1 -0
- package/lemma.bindings.d.ts +10 -3
- package/lemma.bindings.js +42 -9
- package/lemma.d.ts +12 -0
- package/lemma.iife.js +1 -1
- package/lemma_bg.wasm +0 -0
- package/lemma_bg.wasm.d.ts +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,7 @@ A pre-wired Monaco adapter ships at `@lemmabase/lemma-engine/monaco`.
|
|
|
119
119
|
| `source(repo, spec?, effective?)` | Canonical Lemma source text. Omit `spec` for whole repository. |
|
|
120
120
|
| `run({ spec, repository?, effective?, data?, rules?, explain? })` | Evaluate. Omit `rules` for all rules; pass a non-empty array to scope. `[]` errors. Returns a `Response`. `explain: true` adds per-rule explanation trees. |
|
|
121
121
|
| `remove(repo, name, effective?)` | Remove a temporal spec slice. |
|
|
122
|
+
| `update(repo, name, effective?, code, attribute?)` | Replace a temporal spec slice (atomic remove + load). |
|
|
122
123
|
| `limits()` | Resource limits for this engine. |
|
|
123
124
|
| `format(code, attribute?)` | Canonical formatting; throws `EngineError` on parse error. |
|
|
124
125
|
|
package/lemma.bindings.d.ts
CHANGED
|
@@ -56,6 +56,12 @@ export class Engine {
|
|
|
56
56
|
* Formatted canonical Lemma source. Omit `spec` for whole-repository text.
|
|
57
57
|
*/
|
|
58
58
|
source(repository?: string | null, spec?: string | null, effective?: string | null): string;
|
|
59
|
+
/**
|
|
60
|
+
* Replace a temporal spec slice with new source (atomic remove + load).
|
|
61
|
+
*
|
|
62
|
+
* `attribute` is the source label (path or `@owner/repo`). Omit for a volatile source.
|
|
63
|
+
*/
|
|
64
|
+
update(repository: string | null | undefined, spec: string, effective: string | null | undefined, code: string, attribute?: string | null): void;
|
|
59
65
|
}
|
|
60
66
|
|
|
61
67
|
export class IntoUnderlyingByteSource {
|
|
@@ -129,9 +135,10 @@ export interface InitOutput {
|
|
|
129
135
|
readonly engine_run: (a: number, b: number, c: number) => void;
|
|
130
136
|
readonly engine_show: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
131
137
|
readonly engine_source: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
132
|
-
readonly
|
|
133
|
-
readonly
|
|
134
|
-
readonly
|
|
138
|
+
readonly engine_update: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
139
|
+
readonly __wasm_bindgen_func_elem_12478: (a: number, b: number, c: number, d: number) => void;
|
|
140
|
+
readonly __wasm_bindgen_func_elem_2738: (a: number, b: number, c: number, d: number) => void;
|
|
141
|
+
readonly __wasm_bindgen_func_elem_12485: (a: number, b: number, c: number, d: number) => void;
|
|
135
142
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
136
143
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
137
144
|
readonly __wbindgen_export3: (a: number) => void;
|
package/lemma.bindings.js
CHANGED
|
@@ -226,6 +226,39 @@ export class Engine {
|
|
|
226
226
|
wasm.__wbindgen_export4(deferred5_0, deferred5_1, 1);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Replace a temporal spec slice with new source (atomic remove + load).
|
|
231
|
+
*
|
|
232
|
+
* `attribute` is the source label (path or `@owner/repo`). Omit for a volatile source.
|
|
233
|
+
* @param {string | null | undefined} repository
|
|
234
|
+
* @param {string} spec
|
|
235
|
+
* @param {string | null | undefined} effective
|
|
236
|
+
* @param {string} code
|
|
237
|
+
* @param {string | null} [attribute]
|
|
238
|
+
*/
|
|
239
|
+
update(repository, spec, effective, code, attribute) {
|
|
240
|
+
try {
|
|
241
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
242
|
+
var ptr0 = isLikeNone(repository) ? 0 : passStringToWasm0(repository, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
243
|
+
var len0 = WASM_VECTOR_LEN;
|
|
244
|
+
const ptr1 = passStringToWasm0(spec, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
245
|
+
const len1 = WASM_VECTOR_LEN;
|
|
246
|
+
var ptr2 = isLikeNone(effective) ? 0 : passStringToWasm0(effective, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
247
|
+
var len2 = WASM_VECTOR_LEN;
|
|
248
|
+
const ptr3 = passStringToWasm0(code, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
249
|
+
const len3 = WASM_VECTOR_LEN;
|
|
250
|
+
var ptr4 = isLikeNone(attribute) ? 0 : passStringToWasm0(attribute, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
251
|
+
var len4 = WASM_VECTOR_LEN;
|
|
252
|
+
wasm.engine_update(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
253
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
254
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
255
|
+
if (r1) {
|
|
256
|
+
throw takeObject(r0);
|
|
257
|
+
}
|
|
258
|
+
} finally {
|
|
259
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
229
262
|
}
|
|
230
263
|
if (Symbol.dispose) Engine.prototype[Symbol.dispose] = Engine.prototype.free;
|
|
231
264
|
|
|
@@ -690,7 +723,7 @@ function __wbg_get_imports() {
|
|
|
690
723
|
const a = state0.a;
|
|
691
724
|
state0.a = 0;
|
|
692
725
|
try {
|
|
693
|
-
return
|
|
726
|
+
return __wasm_bindgen_func_elem_12485(a, state0.b, arg0, arg1);
|
|
694
727
|
} finally {
|
|
695
728
|
state0.a = a;
|
|
696
729
|
}
|
|
@@ -850,12 +883,12 @@ function __wbg_get_imports() {
|
|
|
850
883
|
},
|
|
851
884
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
852
885
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1397, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
853
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
886
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12478);
|
|
854
887
|
return addHeapObject(ret);
|
|
855
888
|
},
|
|
856
889
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
857
890
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("IteratorResult<any>")], shim_idx: 7, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
858
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
891
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_2738);
|
|
859
892
|
return addHeapObject(ret);
|
|
860
893
|
},
|
|
861
894
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -892,10 +925,10 @@ function __wbg_get_imports() {
|
|
|
892
925
|
};
|
|
893
926
|
}
|
|
894
927
|
|
|
895
|
-
function
|
|
928
|
+
function __wasm_bindgen_func_elem_12478(arg0, arg1, arg2) {
|
|
896
929
|
try {
|
|
897
930
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
898
|
-
wasm.
|
|
931
|
+
wasm.__wasm_bindgen_func_elem_12478(retptr, arg0, arg1, addHeapObject(arg2));
|
|
899
932
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
900
933
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
901
934
|
if (r1) {
|
|
@@ -906,10 +939,10 @@ function __wasm_bindgen_func_elem_12434(arg0, arg1, arg2) {
|
|
|
906
939
|
}
|
|
907
940
|
}
|
|
908
941
|
|
|
909
|
-
function
|
|
942
|
+
function __wasm_bindgen_func_elem_2738(arg0, arg1, arg2) {
|
|
910
943
|
try {
|
|
911
944
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
912
|
-
wasm.
|
|
945
|
+
wasm.__wasm_bindgen_func_elem_2738(retptr, arg0, arg1, addHeapObject(arg2));
|
|
913
946
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
914
947
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
915
948
|
if (r1) {
|
|
@@ -920,8 +953,8 @@ function __wasm_bindgen_func_elem_2732(arg0, arg1, arg2) {
|
|
|
920
953
|
}
|
|
921
954
|
}
|
|
922
955
|
|
|
923
|
-
function
|
|
924
|
-
wasm.
|
|
956
|
+
function __wasm_bindgen_func_elem_12485(arg0, arg1, arg2, arg3) {
|
|
957
|
+
wasm.__wasm_bindgen_func_elem_12485(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
925
958
|
}
|
|
926
959
|
|
|
927
960
|
|
package/lemma.d.ts
CHANGED
|
@@ -60,6 +60,18 @@ declare module './lemma.bindings.js' {
|
|
|
60
60
|
effective?: string | null,
|
|
61
61
|
): void;
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Replace a temporal spec slice with new source (atomic remove + load).
|
|
65
|
+
* `attribute` is the source label (path or `@owner/repo`); omit for volatile.
|
|
66
|
+
*/
|
|
67
|
+
update(
|
|
68
|
+
repository: string | null | undefined,
|
|
69
|
+
spec: string,
|
|
70
|
+
effective: string | null | undefined,
|
|
71
|
+
code: string,
|
|
72
|
+
attribute?: string | null,
|
|
73
|
+
): void;
|
|
74
|
+
|
|
63
75
|
/** Resource limits configured for this engine. */
|
|
64
76
|
limits(): ResourceLimits;
|
|
65
77
|
|