inputlayer-js-dev 0.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.
@@ -0,0 +1,116 @@
1
+ // src/ast.ts
2
+ function column(relation, name, refAlias) {
3
+ return { _tag: "Column", relation, name, refAlias };
4
+ }
5
+ function literal(value) {
6
+ return { _tag: "Literal", value };
7
+ }
8
+ function arithmetic(op, left, right) {
9
+ return { _tag: "Arithmetic", op, left, right };
10
+ }
11
+ function funcCall(name, args) {
12
+ return { _tag: "FuncCall", name, args };
13
+ }
14
+ function aggExpr(opts) {
15
+ return {
16
+ _tag: "AggExpr",
17
+ func: opts.func,
18
+ column: opts.column,
19
+ params: opts.params ?? [],
20
+ passthrough: opts.passthrough ?? [],
21
+ orderColumn: opts.orderColumn,
22
+ desc: opts.desc ?? true
23
+ };
24
+ }
25
+ function orderedColumn(col, descending) {
26
+ return { _tag: "OrderedColumn", column: col, descending };
27
+ }
28
+ function comparison(op, left, right) {
29
+ return { _tag: "Comparison", op, left, right };
30
+ }
31
+ function and(left, right) {
32
+ return { _tag: "And", left, right };
33
+ }
34
+ function or(left, right) {
35
+ return { _tag: "Or", left, right };
36
+ }
37
+ function not(operand) {
38
+ return { _tag: "Not", operand };
39
+ }
40
+ function inExpr(col, target) {
41
+ return { _tag: "InExpr", column: col, targetColumn: target };
42
+ }
43
+ function negatedIn(col, target) {
44
+ return { _tag: "NegatedIn", column: col, targetColumn: target };
45
+ }
46
+ function matchExpr(relation, bindings, negated) {
47
+ return { _tag: "MatchExpr", relation, bindings, negated };
48
+ }
49
+ function isColumn(e) {
50
+ return e._tag === "Column";
51
+ }
52
+ function isLiteral(e) {
53
+ return e._tag === "Literal";
54
+ }
55
+ function isArithmetic(e) {
56
+ return e._tag === "Arithmetic";
57
+ }
58
+ function isFuncCall(e) {
59
+ return e._tag === "FuncCall";
60
+ }
61
+ function isAggExpr(e) {
62
+ return e._tag === "AggExpr";
63
+ }
64
+ function isOrderedColumn(e) {
65
+ return e._tag === "OrderedColumn";
66
+ }
67
+ function isComparison(e) {
68
+ return e._tag === "Comparison";
69
+ }
70
+ function isAnd(e) {
71
+ return e._tag === "And";
72
+ }
73
+ function isOr(e) {
74
+ return e._tag === "Or";
75
+ }
76
+ function isNot(e) {
77
+ return e._tag === "Not";
78
+ }
79
+ function isInExpr(e) {
80
+ return e._tag === "InExpr";
81
+ }
82
+ function isNegatedIn(e) {
83
+ return e._tag === "NegatedIn";
84
+ }
85
+ function isMatchExpr(e) {
86
+ return e._tag === "MatchExpr";
87
+ }
88
+
89
+ export {
90
+ column,
91
+ literal,
92
+ arithmetic,
93
+ funcCall,
94
+ aggExpr,
95
+ orderedColumn,
96
+ comparison,
97
+ and,
98
+ or,
99
+ not,
100
+ inExpr,
101
+ negatedIn,
102
+ matchExpr,
103
+ isColumn,
104
+ isLiteral,
105
+ isArithmetic,
106
+ isFuncCall,
107
+ isAggExpr,
108
+ isOrderedColumn,
109
+ isComparison,
110
+ isAnd,
111
+ isOr,
112
+ isNot,
113
+ isInExpr,
114
+ isNegatedIn,
115
+ isMatchExpr
116
+ };
@@ -0,0 +1,76 @@
1
+ import { C as ColumnProxy, E as Expr, F as FuncCall } from './proxy-CPWAPhZZ.mjs';
2
+
3
+ /**
4
+ * Built-in functions that compile to IQL function calls.
5
+ *
6
+ * Each function returns a FuncCall AST node (an Expr) that the compiler
7
+ * serializes as func_name(arg1, arg2, ...).
8
+ */
9
+
10
+ type ExprArg = ColumnProxy | Expr | number | string | number[];
11
+ declare function euclidean(v1: ExprArg, v2: ExprArg): FuncCall;
12
+ declare function cosine(v1: ExprArg, v2: ExprArg): FuncCall;
13
+ declare function dot(v1: ExprArg, v2: ExprArg): FuncCall;
14
+ declare function manhattan(v1: ExprArg, v2: ExprArg): FuncCall;
15
+ declare function normalize(v: ExprArg): FuncCall;
16
+ declare function vecDim(v: ExprArg): FuncCall;
17
+ declare function vecAdd(v1: ExprArg, v2: ExprArg): FuncCall;
18
+ declare function vecScale(v: ExprArg, s: ExprArg): FuncCall;
19
+ declare function lshBucket(v: ExprArg, tableIdx: ExprArg, numHp: ExprArg): FuncCall;
20
+ declare function lshProbes(bucket: ExprArg, numHp: ExprArg, numProbes: ExprArg): FuncCall;
21
+ declare function lshMultiProbe(v: ExprArg, tableIdx: ExprArg, numHp: ExprArg, numProbes: ExprArg): FuncCall;
22
+ declare function quantizeLinear(v: ExprArg): FuncCall;
23
+ declare function quantizeSymmetric(v: ExprArg): FuncCall;
24
+ declare function dequantize(v: ExprArg): FuncCall;
25
+ declare function dequantizeScaled(v: ExprArg, s: ExprArg): FuncCall;
26
+ declare function euclideanInt8(v1: ExprArg, v2: ExprArg): FuncCall;
27
+ declare function cosineInt8(v1: ExprArg, v2: ExprArg): FuncCall;
28
+ declare function dotInt8(v1: ExprArg, v2: ExprArg): FuncCall;
29
+ declare function manhattanInt8(v1: ExprArg, v2: ExprArg): FuncCall;
30
+ declare function timeNow(): FuncCall;
31
+ declare function timeDiff(t1: ExprArg, t2: ExprArg): FuncCall;
32
+ declare function timeAdd(ts: ExprArg, dur: ExprArg): FuncCall;
33
+ declare function timeSub(ts: ExprArg, dur: ExprArg): FuncCall;
34
+ declare function timeDecay(ts: ExprArg, now: ExprArg, halfLife: ExprArg): FuncCall;
35
+ declare function timeDecayLinear(ts: ExprArg, now: ExprArg, maxAge: ExprArg): FuncCall;
36
+ declare function timeBefore(t1: ExprArg, t2: ExprArg): FuncCall;
37
+ declare function timeAfter(t1: ExprArg, t2: ExprArg): FuncCall;
38
+ declare function timeBetween(ts: ExprArg, start: ExprArg, end: ExprArg): FuncCall;
39
+ declare function withinLast(ts: ExprArg, now: ExprArg, dur: ExprArg): FuncCall;
40
+ declare function intervalsOverlap(s1: ExprArg, e1: ExprArg, s2: ExprArg, e2: ExprArg): FuncCall;
41
+ declare function intervalContains(s1: ExprArg, e1Arg: ExprArg, s2: ExprArg, e2: ExprArg): FuncCall;
42
+ declare function intervalDuration(s: ExprArg, end: ExprArg): FuncCall;
43
+ declare function pointInInterval(ts: ExprArg, s: ExprArg, end: ExprArg): FuncCall;
44
+ declare function abs(x: ExprArg): FuncCall;
45
+ declare function absInt64(x: ExprArg): FuncCall;
46
+ declare function absFloat64(x: ExprArg): FuncCall;
47
+ declare function sqrt(x: ExprArg): FuncCall;
48
+ declare function pow(base: ExprArg, exp: ExprArg): FuncCall;
49
+ declare function log(x: ExprArg): FuncCall;
50
+ declare function exp(x: ExprArg): FuncCall;
51
+ declare function sin(x: ExprArg): FuncCall;
52
+ declare function cos(x: ExprArg): FuncCall;
53
+ declare function tan(x: ExprArg): FuncCall;
54
+ declare function floor(x: ExprArg): FuncCall;
55
+ declare function ceil(x: ExprArg): FuncCall;
56
+ declare function sign(x: ExprArg): FuncCall;
57
+ declare function minVal(a: ExprArg, b: ExprArg): FuncCall;
58
+ declare function maxVal(a: ExprArg, b: ExprArg): FuncCall;
59
+ declare function len(s: ExprArg): FuncCall;
60
+ declare function upper(s: ExprArg): FuncCall;
61
+ declare function lower(s: ExprArg): FuncCall;
62
+ declare function trim(s: ExprArg): FuncCall;
63
+ declare function substr(s: ExprArg, start: ExprArg, length: ExprArg): FuncCall;
64
+ declare function replace(s: ExprArg, find: ExprArg, repl: ExprArg): FuncCall;
65
+ declare function concat(...args: ExprArg[]): FuncCall;
66
+ declare function toFloat(x: ExprArg): FuncCall;
67
+ declare function toInt(x: ExprArg): FuncCall;
68
+ /**
69
+ * Direct HNSW nearest-neighbor search.
70
+ * IQL: hnsw_nearest("idx", [0.1, 0.2], 10, Id, Dist)
71
+ */
72
+ declare function hnswNearest(indexName: string, queryVec: ExprArg, k: number, opts?: {
73
+ efSearch?: number;
74
+ }): FuncCall;
75
+
76
+ export { abs, absFloat64, absInt64, ceil, concat, cos, cosine, cosineInt8, dequantize, dequantizeScaled, dot, dotInt8, euclidean, euclideanInt8, exp, floor, hnswNearest, intervalContains, intervalDuration, intervalsOverlap, len, log, lower, lshBucket, lshMultiProbe, lshProbes, manhattan, manhattanInt8, maxVal, minVal, normalize, pointInInterval, pow, quantizeLinear, quantizeSymmetric, replace, sign, sin, sqrt, substr, tan, timeAdd, timeAfter, timeBefore, timeBetween, timeDecay, timeDecayLinear, timeDiff, timeNow, timeSub, toFloat, toInt, trim, upper, vecAdd, vecDim, vecScale, withinLast };
@@ -0,0 +1,76 @@
1
+ import { C as ColumnProxy, E as Expr, F as FuncCall } from './proxy-CPWAPhZZ.js';
2
+
3
+ /**
4
+ * Built-in functions that compile to IQL function calls.
5
+ *
6
+ * Each function returns a FuncCall AST node (an Expr) that the compiler
7
+ * serializes as func_name(arg1, arg2, ...).
8
+ */
9
+
10
+ type ExprArg = ColumnProxy | Expr | number | string | number[];
11
+ declare function euclidean(v1: ExprArg, v2: ExprArg): FuncCall;
12
+ declare function cosine(v1: ExprArg, v2: ExprArg): FuncCall;
13
+ declare function dot(v1: ExprArg, v2: ExprArg): FuncCall;
14
+ declare function manhattan(v1: ExprArg, v2: ExprArg): FuncCall;
15
+ declare function normalize(v: ExprArg): FuncCall;
16
+ declare function vecDim(v: ExprArg): FuncCall;
17
+ declare function vecAdd(v1: ExprArg, v2: ExprArg): FuncCall;
18
+ declare function vecScale(v: ExprArg, s: ExprArg): FuncCall;
19
+ declare function lshBucket(v: ExprArg, tableIdx: ExprArg, numHp: ExprArg): FuncCall;
20
+ declare function lshProbes(bucket: ExprArg, numHp: ExprArg, numProbes: ExprArg): FuncCall;
21
+ declare function lshMultiProbe(v: ExprArg, tableIdx: ExprArg, numHp: ExprArg, numProbes: ExprArg): FuncCall;
22
+ declare function quantizeLinear(v: ExprArg): FuncCall;
23
+ declare function quantizeSymmetric(v: ExprArg): FuncCall;
24
+ declare function dequantize(v: ExprArg): FuncCall;
25
+ declare function dequantizeScaled(v: ExprArg, s: ExprArg): FuncCall;
26
+ declare function euclideanInt8(v1: ExprArg, v2: ExprArg): FuncCall;
27
+ declare function cosineInt8(v1: ExprArg, v2: ExprArg): FuncCall;
28
+ declare function dotInt8(v1: ExprArg, v2: ExprArg): FuncCall;
29
+ declare function manhattanInt8(v1: ExprArg, v2: ExprArg): FuncCall;
30
+ declare function timeNow(): FuncCall;
31
+ declare function timeDiff(t1: ExprArg, t2: ExprArg): FuncCall;
32
+ declare function timeAdd(ts: ExprArg, dur: ExprArg): FuncCall;
33
+ declare function timeSub(ts: ExprArg, dur: ExprArg): FuncCall;
34
+ declare function timeDecay(ts: ExprArg, now: ExprArg, halfLife: ExprArg): FuncCall;
35
+ declare function timeDecayLinear(ts: ExprArg, now: ExprArg, maxAge: ExprArg): FuncCall;
36
+ declare function timeBefore(t1: ExprArg, t2: ExprArg): FuncCall;
37
+ declare function timeAfter(t1: ExprArg, t2: ExprArg): FuncCall;
38
+ declare function timeBetween(ts: ExprArg, start: ExprArg, end: ExprArg): FuncCall;
39
+ declare function withinLast(ts: ExprArg, now: ExprArg, dur: ExprArg): FuncCall;
40
+ declare function intervalsOverlap(s1: ExprArg, e1: ExprArg, s2: ExprArg, e2: ExprArg): FuncCall;
41
+ declare function intervalContains(s1: ExprArg, e1Arg: ExprArg, s2: ExprArg, e2: ExprArg): FuncCall;
42
+ declare function intervalDuration(s: ExprArg, end: ExprArg): FuncCall;
43
+ declare function pointInInterval(ts: ExprArg, s: ExprArg, end: ExprArg): FuncCall;
44
+ declare function abs(x: ExprArg): FuncCall;
45
+ declare function absInt64(x: ExprArg): FuncCall;
46
+ declare function absFloat64(x: ExprArg): FuncCall;
47
+ declare function sqrt(x: ExprArg): FuncCall;
48
+ declare function pow(base: ExprArg, exp: ExprArg): FuncCall;
49
+ declare function log(x: ExprArg): FuncCall;
50
+ declare function exp(x: ExprArg): FuncCall;
51
+ declare function sin(x: ExprArg): FuncCall;
52
+ declare function cos(x: ExprArg): FuncCall;
53
+ declare function tan(x: ExprArg): FuncCall;
54
+ declare function floor(x: ExprArg): FuncCall;
55
+ declare function ceil(x: ExprArg): FuncCall;
56
+ declare function sign(x: ExprArg): FuncCall;
57
+ declare function minVal(a: ExprArg, b: ExprArg): FuncCall;
58
+ declare function maxVal(a: ExprArg, b: ExprArg): FuncCall;
59
+ declare function len(s: ExprArg): FuncCall;
60
+ declare function upper(s: ExprArg): FuncCall;
61
+ declare function lower(s: ExprArg): FuncCall;
62
+ declare function trim(s: ExprArg): FuncCall;
63
+ declare function substr(s: ExprArg, start: ExprArg, length: ExprArg): FuncCall;
64
+ declare function replace(s: ExprArg, find: ExprArg, repl: ExprArg): FuncCall;
65
+ declare function concat(...args: ExprArg[]): FuncCall;
66
+ declare function toFloat(x: ExprArg): FuncCall;
67
+ declare function toInt(x: ExprArg): FuncCall;
68
+ /**
69
+ * Direct HNSW nearest-neighbor search.
70
+ * IQL: hnsw_nearest("idx", [0.1, 0.2], 10, Id, Dist)
71
+ */
72
+ declare function hnswNearest(indexName: string, queryVec: ExprArg, k: number, opts?: {
73
+ efSearch?: number;
74
+ }): FuncCall;
75
+
76
+ export { abs, absFloat64, absInt64, ceil, concat, cos, cosine, cosineInt8, dequantize, dequantizeScaled, dot, dotInt8, euclidean, euclideanInt8, exp, floor, hnswNearest, intervalContains, intervalDuration, intervalsOverlap, len, log, lower, lshBucket, lshMultiProbe, lshProbes, manhattan, manhattanInt8, maxVal, minVal, normalize, pointInInterval, pow, quantizeLinear, quantizeSymmetric, replace, sign, sin, sqrt, substr, tan, timeAdd, timeAfter, timeBefore, timeBetween, timeDecay, timeDecayLinear, timeDiff, timeNow, timeSub, toFloat, toInt, trim, upper, vecAdd, vecDim, vecScale, withinLast };
@@ -0,0 +1,340 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/functions.ts
21
+ var functions_exports = {};
22
+ __export(functions_exports, {
23
+ abs: () => abs,
24
+ absFloat64: () => absFloat64,
25
+ absInt64: () => absInt64,
26
+ ceil: () => ceil,
27
+ concat: () => concat,
28
+ cos: () => cos,
29
+ cosine: () => cosine,
30
+ cosineInt8: () => cosineInt8,
31
+ dequantize: () => dequantize,
32
+ dequantizeScaled: () => dequantizeScaled,
33
+ dot: () => dot,
34
+ dotInt8: () => dotInt8,
35
+ euclidean: () => euclidean,
36
+ euclideanInt8: () => euclideanInt8,
37
+ exp: () => exp,
38
+ floor: () => floor,
39
+ hnswNearest: () => hnswNearest,
40
+ intervalContains: () => intervalContains,
41
+ intervalDuration: () => intervalDuration,
42
+ intervalsOverlap: () => intervalsOverlap,
43
+ len: () => len,
44
+ log: () => log,
45
+ lower: () => lower,
46
+ lshBucket: () => lshBucket,
47
+ lshMultiProbe: () => lshMultiProbe,
48
+ lshProbes: () => lshProbes,
49
+ manhattan: () => manhattan,
50
+ manhattanInt8: () => manhattanInt8,
51
+ maxVal: () => maxVal,
52
+ minVal: () => minVal,
53
+ normalize: () => normalize,
54
+ pointInInterval: () => pointInInterval,
55
+ pow: () => pow,
56
+ quantizeLinear: () => quantizeLinear,
57
+ quantizeSymmetric: () => quantizeSymmetric,
58
+ replace: () => replace,
59
+ sign: () => sign,
60
+ sin: () => sin,
61
+ sqrt: () => sqrt,
62
+ substr: () => substr,
63
+ tan: () => tan,
64
+ timeAdd: () => timeAdd,
65
+ timeAfter: () => timeAfter,
66
+ timeBefore: () => timeBefore,
67
+ timeBetween: () => timeBetween,
68
+ timeDecay: () => timeDecay,
69
+ timeDecayLinear: () => timeDecayLinear,
70
+ timeDiff: () => timeDiff,
71
+ timeNow: () => timeNow,
72
+ timeSub: () => timeSub,
73
+ toFloat: () => toFloat,
74
+ toInt: () => toInt,
75
+ trim: () => trim,
76
+ upper: () => upper,
77
+ vecAdd: () => vecAdd,
78
+ vecDim: () => vecDim,
79
+ vecScale: () => vecScale,
80
+ withinLast: () => withinLast
81
+ });
82
+ module.exports = __toCommonJS(functions_exports);
83
+
84
+ // src/ast.ts
85
+ function literal(value) {
86
+ return { _tag: "Literal", value };
87
+ }
88
+ function funcCall(name, args) {
89
+ return { _tag: "FuncCall", name, args };
90
+ }
91
+
92
+ // src/functions.ts
93
+ function e(v) {
94
+ if (typeof v === "object" && v !== null && "toAst" in v && typeof v.toAst === "function") {
95
+ return v.toAst();
96
+ }
97
+ if (typeof v === "object" && v !== null && !Array.isArray(v) && "_tag" in v) {
98
+ return v;
99
+ }
100
+ return literal(v);
101
+ }
102
+ function euclidean(v1, v2) {
103
+ return funcCall("euclidean", [e(v1), e(v2)]);
104
+ }
105
+ function cosine(v1, v2) {
106
+ return funcCall("cosine", [e(v1), e(v2)]);
107
+ }
108
+ function dot(v1, v2) {
109
+ return funcCall("dot", [e(v1), e(v2)]);
110
+ }
111
+ function manhattan(v1, v2) {
112
+ return funcCall("manhattan", [e(v1), e(v2)]);
113
+ }
114
+ function normalize(v) {
115
+ return funcCall("normalize", [e(v)]);
116
+ }
117
+ function vecDim(v) {
118
+ return funcCall("vec_dim", [e(v)]);
119
+ }
120
+ function vecAdd(v1, v2) {
121
+ return funcCall("vec_add", [e(v1), e(v2)]);
122
+ }
123
+ function vecScale(v, s) {
124
+ return funcCall("vec_scale", [e(v), e(s)]);
125
+ }
126
+ function lshBucket(v, tableIdx, numHp) {
127
+ return funcCall("lsh_bucket", [e(v), e(tableIdx), e(numHp)]);
128
+ }
129
+ function lshProbes(bucket, numHp, numProbes) {
130
+ return funcCall("lsh_probes", [e(bucket), e(numHp), e(numProbes)]);
131
+ }
132
+ function lshMultiProbe(v, tableIdx, numHp, numProbes) {
133
+ return funcCall("lsh_multi_probe", [e(v), e(tableIdx), e(numHp), e(numProbes)]);
134
+ }
135
+ function quantizeLinear(v) {
136
+ return funcCall("quantize_linear", [e(v)]);
137
+ }
138
+ function quantizeSymmetric(v) {
139
+ return funcCall("quantize_symmetric", [e(v)]);
140
+ }
141
+ function dequantize(v) {
142
+ return funcCall("dequantize", [e(v)]);
143
+ }
144
+ function dequantizeScaled(v, s) {
145
+ return funcCall("dequantize_scaled", [e(v), e(s)]);
146
+ }
147
+ function euclideanInt8(v1, v2) {
148
+ return funcCall("euclidean_int8", [e(v1), e(v2)]);
149
+ }
150
+ function cosineInt8(v1, v2) {
151
+ return funcCall("cosine_int8", [e(v1), e(v2)]);
152
+ }
153
+ function dotInt8(v1, v2) {
154
+ return funcCall("dot_int8", [e(v1), e(v2)]);
155
+ }
156
+ function manhattanInt8(v1, v2) {
157
+ return funcCall("manhattan_int8", [e(v1), e(v2)]);
158
+ }
159
+ function timeNow() {
160
+ return funcCall("time_now", []);
161
+ }
162
+ function timeDiff(t1, t2) {
163
+ return funcCall("time_diff", [e(t1), e(t2)]);
164
+ }
165
+ function timeAdd(ts, dur) {
166
+ return funcCall("time_add", [e(ts), e(dur)]);
167
+ }
168
+ function timeSub(ts, dur) {
169
+ return funcCall("time_sub", [e(ts), e(dur)]);
170
+ }
171
+ function timeDecay(ts, now, halfLife) {
172
+ return funcCall("time_decay", [e(ts), e(now), e(halfLife)]);
173
+ }
174
+ function timeDecayLinear(ts, now, maxAge) {
175
+ return funcCall("time_decay_linear", [e(ts), e(now), e(maxAge)]);
176
+ }
177
+ function timeBefore(t1, t2) {
178
+ return funcCall("time_before", [e(t1), e(t2)]);
179
+ }
180
+ function timeAfter(t1, t2) {
181
+ return funcCall("time_after", [e(t1), e(t2)]);
182
+ }
183
+ function timeBetween(ts, start, end) {
184
+ return funcCall("time_between", [e(ts), e(start), e(end)]);
185
+ }
186
+ function withinLast(ts, now, dur) {
187
+ return funcCall("within_last", [e(ts), e(now), e(dur)]);
188
+ }
189
+ function intervalsOverlap(s1, e1, s2, e2) {
190
+ return funcCall("intervals_overlap", [e(s1), e(e1), e(s2), e(e2)]);
191
+ }
192
+ function intervalContains(s1, e1Arg, s2, e2) {
193
+ return funcCall("interval_contains", [e(s1), e(e1Arg), e(s2), e(e2)]);
194
+ }
195
+ function intervalDuration(s, end) {
196
+ return funcCall("interval_duration", [e(s), e(end)]);
197
+ }
198
+ function pointInInterval(ts, s, end) {
199
+ return funcCall("point_in_interval", [e(ts), e(s), e(end)]);
200
+ }
201
+ function abs(x) {
202
+ return funcCall("abs", [e(x)]);
203
+ }
204
+ function absInt64(x) {
205
+ return funcCall("abs_int64", [e(x)]);
206
+ }
207
+ function absFloat64(x) {
208
+ return funcCall("abs_float64", [e(x)]);
209
+ }
210
+ function sqrt(x) {
211
+ return funcCall("sqrt", [e(x)]);
212
+ }
213
+ function pow(base, exp2) {
214
+ return funcCall("pow", [e(base), e(exp2)]);
215
+ }
216
+ function log(x) {
217
+ return funcCall("log", [e(x)]);
218
+ }
219
+ function exp(x) {
220
+ return funcCall("exp", [e(x)]);
221
+ }
222
+ function sin(x) {
223
+ return funcCall("sin", [e(x)]);
224
+ }
225
+ function cos(x) {
226
+ return funcCall("cos", [e(x)]);
227
+ }
228
+ function tan(x) {
229
+ return funcCall("tan", [e(x)]);
230
+ }
231
+ function floor(x) {
232
+ return funcCall("floor", [e(x)]);
233
+ }
234
+ function ceil(x) {
235
+ return funcCall("ceil", [e(x)]);
236
+ }
237
+ function sign(x) {
238
+ return funcCall("sign", [e(x)]);
239
+ }
240
+ function minVal(a, b) {
241
+ return funcCall("min_val", [e(a), e(b)]);
242
+ }
243
+ function maxVal(a, b) {
244
+ return funcCall("max_val", [e(a), e(b)]);
245
+ }
246
+ function len(s) {
247
+ return funcCall("len", [e(s)]);
248
+ }
249
+ function upper(s) {
250
+ return funcCall("upper", [e(s)]);
251
+ }
252
+ function lower(s) {
253
+ return funcCall("lower", [e(s)]);
254
+ }
255
+ function trim(s) {
256
+ return funcCall("trim", [e(s)]);
257
+ }
258
+ function substr(s, start, length) {
259
+ return funcCall("substr", [e(s), e(start), e(length)]);
260
+ }
261
+ function replace(s, find, repl) {
262
+ return funcCall("replace", [e(s), e(find), e(repl)]);
263
+ }
264
+ function concat(...args) {
265
+ return funcCall("concat", args.map(e));
266
+ }
267
+ function toFloat(x) {
268
+ return funcCall("to_float", [e(x)]);
269
+ }
270
+ function toInt(x) {
271
+ return funcCall("to_int", [e(x)]);
272
+ }
273
+ function hnswNearest(indexName, queryVec, k, opts) {
274
+ const args = [literal(indexName), e(queryVec), literal(k)];
275
+ if (opts?.efSearch !== void 0) {
276
+ args.push(literal(opts.efSearch));
277
+ }
278
+ return funcCall("hnsw_nearest", args);
279
+ }
280
+ // Annotate the CommonJS export names for ESM import in node:
281
+ 0 && (module.exports = {
282
+ abs,
283
+ absFloat64,
284
+ absInt64,
285
+ ceil,
286
+ concat,
287
+ cos,
288
+ cosine,
289
+ cosineInt8,
290
+ dequantize,
291
+ dequantizeScaled,
292
+ dot,
293
+ dotInt8,
294
+ euclidean,
295
+ euclideanInt8,
296
+ exp,
297
+ floor,
298
+ hnswNearest,
299
+ intervalContains,
300
+ intervalDuration,
301
+ intervalsOverlap,
302
+ len,
303
+ log,
304
+ lower,
305
+ lshBucket,
306
+ lshMultiProbe,
307
+ lshProbes,
308
+ manhattan,
309
+ manhattanInt8,
310
+ maxVal,
311
+ minVal,
312
+ normalize,
313
+ pointInInterval,
314
+ pow,
315
+ quantizeLinear,
316
+ quantizeSymmetric,
317
+ replace,
318
+ sign,
319
+ sin,
320
+ sqrt,
321
+ substr,
322
+ tan,
323
+ timeAdd,
324
+ timeAfter,
325
+ timeBefore,
326
+ timeBetween,
327
+ timeDecay,
328
+ timeDecayLinear,
329
+ timeDiff,
330
+ timeNow,
331
+ timeSub,
332
+ toFloat,
333
+ toInt,
334
+ trim,
335
+ upper,
336
+ vecAdd,
337
+ vecDim,
338
+ vecScale,
339
+ withinLast
340
+ });