@usine/expression 0.0.1 → 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.
- package/README.md +6 -2
- package/dist/expression-engine.d.ts +14 -0
- package/dist/expression-engine.d.ts.map +1 -0
- package/dist/expression-engine.js +4 -0
- package/dist/expression-engine.js.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/marcbachmann-cel.d.ts +5 -0
- package/dist/marcbachmann-cel.d.ts.map +1 -0
- package/dist/marcbachmann-cel.js +133 -0
- package/dist/marcbachmann-cel.js.map +1 -0
- package/dist/model.d.ts +61 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +66 -0
- package/dist/model.js.map +1 -0
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @usine/expression
|
|
2
2
|
|
|
3
|
-
CEL
|
|
3
|
+
Typed CEL checking and evaluation for [usine](https://github.com/basaltbytes/usine). Callers describe object types and root variables with `Environment`, then use `ExpressionEngine` to check boolean trigger expressions, check scalar prompt expressions, or evaluate either form over plain JSON.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Unknown variables and object paths fail during checking, including paths inside CEL macros such as `exists`. Failures are typed values: `ExpressionCheckError` from parsing, type checking, or result-type checking, `ExpressionEvaluationError` from evaluation, and the `ExpressionError` union covering both. JSON integers declared as CEL `int` or `uint` are converted to `bigint` before evaluation so GraphQL payloads keep CEL integer semantics.
|
|
6
|
+
|
|
7
|
+
`MarcbachmannCelLayer` uses `@marcbachmann/cel-js@8.0.0`. The exported `ExpressionEngine` contract contains CEL type names and usine-owned descriptors rather than library objects; an `@bufbuild/cel` adapter can provide the same service tag without changing callers.
|
|
8
|
+
|
|
9
|
+
All APIs remain 0.x and can change between minor releases.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context, type Effect, type Schema } from "effect";
|
|
2
|
+
import type { Environment, ExpressionCheckError, ExpressionError, Scalar, Source } from "./model.ts";
|
|
3
|
+
/** Backend-neutral CEL operations used by config parsing and prompt rendering. */
|
|
4
|
+
export interface ExpressionEngineService {
|
|
5
|
+
readonly checkBoolean: (source: Source, environment: Environment) => Effect.Effect<void, ExpressionCheckError>;
|
|
6
|
+
readonly checkScalar: (source: Source, environment: Environment) => Effect.Effect<void, ExpressionCheckError>;
|
|
7
|
+
readonly evaluateBoolean: (source: Source, environment: Environment, context: Schema.JsonObject) => Effect.Effect<boolean, ExpressionError>;
|
|
8
|
+
readonly evaluateScalar: (source: Source, environment: Environment, context: Schema.JsonObject) => Effect.Effect<Scalar, ExpressionError>;
|
|
9
|
+
}
|
|
10
|
+
declare const ExpressionEngine_base: Context.ServiceClass<ExpressionEngine, "@usine/expression/ExpressionEngine", ExpressionEngineService>;
|
|
11
|
+
export declare class ExpressionEngine extends ExpressionEngine_base {
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=expression-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression-engine.d.ts","sourceRoot":"","sources":["../src/expression-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,KAAK,EACV,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,MAAM,EACN,MAAM,EACP,MAAM,YAAY,CAAC;AAEpB,kFAAkF;AAClF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,YAAY,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,KACrB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,CACpB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,KACrB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC/C,QAAQ,CAAC,eAAe,EAAE,CACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,CAAC,UAAU,KACvB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,CACvB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,CAAC,UAAU,KACvB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC7C;;AAED,qBAAa,gBAAiB,SAAQ,qBAErC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression-engine.js","sourceRoot":"","sources":["../src/expression-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4B,MAAM,QAAQ,CAAC;AA+B3D,MAAM,OAAO,gBAAiB,SAAQ,OAAO,CAAC,OAAO,EAA6C,CAChG,oCAAoC,CACrC;CAAG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @usine/expression —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* engine grows.
|
|
2
|
+
* @usine/expression — a vendor-neutral CEL check/evaluation seam. The live
|
|
3
|
+
* layer exact-pins @marcbachmann/cel-js; callers depend only on CEL types and
|
|
4
|
+
* typed Effect failures, so another backend can implement the service.
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
6
|
+
export * from "./expression-engine.ts";
|
|
7
|
+
export * from "./marcbachmann-cel.ts";
|
|
8
|
+
export * from "./model.ts";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @usine/expression —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* engine grows.
|
|
2
|
+
* @usine/expression — a vendor-neutral CEL check/evaluation seam. The live
|
|
3
|
+
* layer exact-pins @marcbachmann/cel-js; callers depend only on CEL types and
|
|
4
|
+
* typed Effect failures, so another backend can implement the service.
|
|
6
5
|
*/
|
|
7
|
-
export
|
|
6
|
+
export * from "./expression-engine.js";
|
|
7
|
+
export * from "./marcbachmann-cel.js";
|
|
8
|
+
export * from "./model.js";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
import { ExpressionEngine } from "./expression-engine.ts";
|
|
3
|
+
/** Live CEL adapter backed by the exact-pinned @marcbachmann/cel-js implementation. */
|
|
4
|
+
export declare const MarcbachmannCelLayer: Layer.Layer<ExpressionEngine, never, never>;
|
|
5
|
+
//# sourceMappingURL=marcbachmann-cel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marcbachmann-cel.d.ts","sourceRoot":"","sources":["../src/marcbachmann-cel.ts"],"names":[],"mappings":"AAKA,OAAO,EAAU,KAAK,EAAkB,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAsN1D,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,6CAK/B,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Environment as CelEnvironment, ParseError as CelParseError, TypeError as CelTypeError, } from "@marcbachmann/cel-js";
|
|
2
|
+
import { Effect, Layer, Option, Schema } from "effect";
|
|
3
|
+
import { ExpressionEngine } from "./expression-engine.js";
|
|
4
|
+
import { ExpressionCheckError, ExpressionEvaluationError, Scalar, TypeReference, } from "./model.js";
|
|
5
|
+
const decodeTypeReference = Schema.decodeUnknownSync(TypeReference);
|
|
6
|
+
const acceptedScalarTypes = new Set([
|
|
7
|
+
"bool",
|
|
8
|
+
"double",
|
|
9
|
+
"int",
|
|
10
|
+
"null_type",
|
|
11
|
+
"string",
|
|
12
|
+
"uint",
|
|
13
|
+
]);
|
|
14
|
+
const messageFromCause = (cause, fallback) => Option.match(Schema.decodeUnknownOption(Schema.Struct({ message: Schema.NonEmptyString }))(cause), {
|
|
15
|
+
onNone: () => fallback,
|
|
16
|
+
onSome: ({ message }) => message,
|
|
17
|
+
});
|
|
18
|
+
const checkFailure = (source, error) => error === undefined
|
|
19
|
+
? new ExpressionCheckError({
|
|
20
|
+
source,
|
|
21
|
+
code: "check_failed",
|
|
22
|
+
message: "CEL check failed without an error detail",
|
|
23
|
+
position: Option.none(),
|
|
24
|
+
})
|
|
25
|
+
: new ExpressionCheckError({
|
|
26
|
+
source,
|
|
27
|
+
code: error instanceof CelParseError ? "parse_error" : "type_error",
|
|
28
|
+
message: error.message,
|
|
29
|
+
position: Option.fromNullishOr(error.range?.start),
|
|
30
|
+
});
|
|
31
|
+
const makeEnvironment = (descriptor) => {
|
|
32
|
+
const environment = new CelEnvironment({ unlistedVariablesAreDyn: false });
|
|
33
|
+
for (const objectType of descriptor.types) {
|
|
34
|
+
environment.registerType(objectType.name, {
|
|
35
|
+
fields: Object.fromEntries(objectType.fields.map((field) => [field.name, field.type])),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
for (const variable of descriptor.variables) {
|
|
39
|
+
environment.registerVariable(variable.name, variable.type);
|
|
40
|
+
}
|
|
41
|
+
return environment;
|
|
42
|
+
};
|
|
43
|
+
const normalizeValue = (value, type, objectTypes) => {
|
|
44
|
+
if ((type === "int" || type === "uint") &&
|
|
45
|
+
Schema.is(Schema.Number)(value) &&
|
|
46
|
+
Number.isInteger(value)) {
|
|
47
|
+
return BigInt(value);
|
|
48
|
+
}
|
|
49
|
+
if (type.startsWith("list<") && type.endsWith(">") && Array.isArray(value)) {
|
|
50
|
+
const itemType = decodeTypeReference(type.slice(5, -1));
|
|
51
|
+
return value.map((item) => normalizeValue(item, itemType, objectTypes));
|
|
52
|
+
}
|
|
53
|
+
const objectType = objectTypes.get(type);
|
|
54
|
+
if (objectType !== undefined && Schema.is(Schema.JsonObject)(value)) {
|
|
55
|
+
return Object.fromEntries(Object.entries(value).map(([key, fieldValue]) => {
|
|
56
|
+
const field = objectType.fields.find(({ name }) => name === key);
|
|
57
|
+
return [
|
|
58
|
+
key,
|
|
59
|
+
field === undefined ? fieldValue : normalizeValue(fieldValue, field.type, objectTypes),
|
|
60
|
+
];
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
};
|
|
65
|
+
const normalizeContext = (context, descriptor) => {
|
|
66
|
+
const objectTypes = new Map(descriptor.types.map((type) => [type.name, type]));
|
|
67
|
+
return Object.fromEntries(Object.entries(context).map(([key, value]) => {
|
|
68
|
+
const variable = descriptor.variables.find(({ name }) => name === key);
|
|
69
|
+
return [
|
|
70
|
+
key,
|
|
71
|
+
variable === undefined ? value : normalizeValue(value, variable.type, objectTypes),
|
|
72
|
+
];
|
|
73
|
+
}));
|
|
74
|
+
};
|
|
75
|
+
const checkExpected = (source, environment, accepts, expected) => Effect.gen(function* () {
|
|
76
|
+
const result = yield* Effect.try({
|
|
77
|
+
try: () => makeEnvironment(environment).check(source),
|
|
78
|
+
catch: (cause) => new ExpressionCheckError({
|
|
79
|
+
source,
|
|
80
|
+
code: "check_failed",
|
|
81
|
+
message: messageFromCause(cause, "CEL check failed"),
|
|
82
|
+
position: Option.none(),
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
if (!result.valid)
|
|
86
|
+
return yield* checkFailure(source, result.error);
|
|
87
|
+
const resultType = result.type;
|
|
88
|
+
if (resultType === undefined || !accepts(resultType)) {
|
|
89
|
+
return yield* new ExpressionCheckError({
|
|
90
|
+
source,
|
|
91
|
+
code: "unexpected_result_type",
|
|
92
|
+
message: `Expected ${expected}, got ${resultType ?? "an unknown type"}`,
|
|
93
|
+
position: Option.none(),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const evaluateRaw = (source, environment, context) => Effect.try({
|
|
98
|
+
try: () =>
|
|
99
|
+
// SAFETY: CEL evaluation yields the same value vocabulary the context is
|
|
100
|
+
// built from; the callers below still decode the expected result type
|
|
101
|
+
// before anything leaves the seam.
|
|
102
|
+
makeEnvironment(environment).evaluate(source, normalizeContext(context, environment)),
|
|
103
|
+
catch: (cause) => new ExpressionEvaluationError({
|
|
104
|
+
source,
|
|
105
|
+
message: messageFromCause(cause, "CEL evaluation failed"),
|
|
106
|
+
}),
|
|
107
|
+
});
|
|
108
|
+
const unexpectedResult = (source, expected) => () => new ExpressionEvaluationError({
|
|
109
|
+
source,
|
|
110
|
+
message: `CEL evaluation returned a value that is not ${expected}`,
|
|
111
|
+
});
|
|
112
|
+
const checkBoolean = Effect.fn("ExpressionEngine.checkBoolean")((source, environment) => checkExpected(source, environment, (resultType) => resultType === "bool", "bool"));
|
|
113
|
+
const checkScalar = Effect.fn("ExpressionEngine.checkScalar")((source, environment) => checkExpected(source, environment, (resultType) => acceptedScalarTypes.has(resultType), "a scalar value"));
|
|
114
|
+
const decodeBoolean = Schema.decodeUnknownEffect(Schema.Boolean);
|
|
115
|
+
const decodeScalar = Schema.decodeUnknownEffect(Scalar);
|
|
116
|
+
const evaluateBoolean = Effect.fn("ExpressionEngine.evaluateBoolean")(function* (source, environment, context) {
|
|
117
|
+
yield* checkBoolean(source, environment);
|
|
118
|
+
const value = yield* evaluateRaw(source, environment, context);
|
|
119
|
+
return yield* decodeBoolean(value).pipe(Effect.mapError(unexpectedResult(source, "a boolean")));
|
|
120
|
+
});
|
|
121
|
+
const evaluateScalar = Effect.fn("ExpressionEngine.evaluateScalar")(function* (source, environment, context) {
|
|
122
|
+
yield* checkScalar(source, environment);
|
|
123
|
+
const value = yield* evaluateRaw(source, environment, context);
|
|
124
|
+
return yield* decodeScalar(value).pipe(Effect.mapError(unexpectedResult(source, "a scalar value")));
|
|
125
|
+
});
|
|
126
|
+
/** Live CEL adapter backed by the exact-pinned @marcbachmann/cel-js implementation. */
|
|
127
|
+
export const MarcbachmannCelLayer = Layer.succeed(ExpressionEngine, {
|
|
128
|
+
checkBoolean,
|
|
129
|
+
checkScalar,
|
|
130
|
+
evaluateBoolean,
|
|
131
|
+
evaluateScalar,
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=marcbachmann-cel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marcbachmann-cel.js","sourceRoot":"","sources":["../src/marcbachmann-cel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,IAAI,cAAc,EAC7B,UAAU,IAAI,aAAa,EAC3B,SAAS,IAAI,YAAY,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAEL,oBAAoB,EACpB,yBAAyB,EAEzB,MAAM,EAEN,aAAa,GACd,MAAM,YA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M,CAAC,EAAE,CAAC,kCAAkC,CAAC,CAAC,QAAQ,CAAC,EAC7E,MAAc,EACd,WAAwB,EACxB,OAA0B;IAE1B,KAAK,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;AAClG,CAAC,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,iCAAiC,CAAC,CAAC,QAAQ,CAAC,EAC3E,MAAc,EACd,WAAwB,EACxB,OAA0B;IAE1B,KAAK,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,CACpC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAC5D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uFAAuF;AACvF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE;IAClE,YAAY;IACZ,WAAW;IACX,eAAe;IACf,cAAc;CACf,CAAC,CAAC"}
|
package/dist/model.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** CEL source accepted at the config boundary. */
|
|
3
|
+
export declare const Source: Schema.brand<Schema.String, "ExpressionSource">;
|
|
4
|
+
export type Source = typeof Source.Type;
|
|
5
|
+
/** A CEL-spec type reference such as `string`, `Issue`, or `list<Label>`. */
|
|
6
|
+
export declare const TypeReference: Schema.brand<Schema.String, "CelTypeReference">;
|
|
7
|
+
export type TypeReference = typeof TypeReference.Type;
|
|
8
|
+
declare const ObjectField_base: Schema.Class<ObjectField, Schema.Struct<{
|
|
9
|
+
readonly name: Schema.String;
|
|
10
|
+
readonly type: Schema.brand<Schema.String, "CelTypeReference">;
|
|
11
|
+
}>, {}>;
|
|
12
|
+
/** One field in a backend-neutral CEL object-type declaration. */
|
|
13
|
+
export declare class ObjectField extends ObjectField_base {
|
|
14
|
+
}
|
|
15
|
+
declare const ObjectType_base: Schema.Class<ObjectType, Schema.Struct<{
|
|
16
|
+
readonly name: Schema.String;
|
|
17
|
+
readonly fields: Schema.$Array<typeof ObjectField>;
|
|
18
|
+
}>, {}>;
|
|
19
|
+
/** A CEL object type. Types are registered in declaration order. */
|
|
20
|
+
export declare class ObjectType extends ObjectType_base {
|
|
21
|
+
}
|
|
22
|
+
declare const Variable_base: Schema.Class<Variable, Schema.Struct<{
|
|
23
|
+
readonly name: Schema.String;
|
|
24
|
+
readonly type: Schema.brand<Schema.String, "CelTypeReference">;
|
|
25
|
+
}>, {}>;
|
|
26
|
+
/** One root variable available to a CEL expression. */
|
|
27
|
+
export declare class Variable extends Variable_base {
|
|
28
|
+
}
|
|
29
|
+
declare const Environment_base: Schema.Class<Environment, Schema.Struct<{
|
|
30
|
+
readonly types: Schema.$Array<typeof ObjectType>;
|
|
31
|
+
readonly variables: Schema.$Array<typeof Variable>;
|
|
32
|
+
}>, {}>;
|
|
33
|
+
/** The checked namespace for one expression family, expressed in CEL's type vocabulary. */
|
|
34
|
+
export declare class Environment extends Environment_base {
|
|
35
|
+
}
|
|
36
|
+
export declare const CheckErrorCode: Schema.Literals<readonly ["check_failed", "parse_error", "type_error", "unexpected_result_type"]>;
|
|
37
|
+
export type CheckErrorCode = typeof CheckErrorCode.Type;
|
|
38
|
+
declare const ExpressionCheckError_base: Schema.Class<ExpressionCheckError, Schema.TaggedStruct<"ExpressionCheckError", {
|
|
39
|
+
readonly source: Schema.brand<Schema.String, "ExpressionSource">;
|
|
40
|
+
readonly code: Schema.Literals<readonly ["check_failed", "parse_error", "type_error", "unexpected_result_type"]>;
|
|
41
|
+
readonly message: Schema.NonEmptyString;
|
|
42
|
+
readonly position: Schema.Option<Schema.Int>;
|
|
43
|
+
}>, import("effect/Cause").YieldableError>;
|
|
44
|
+
/** Typed failure from CEL parsing, type checking, or expected-result checking. */
|
|
45
|
+
export declare class ExpressionCheckError extends ExpressionCheckError_base {
|
|
46
|
+
}
|
|
47
|
+
declare const ExpressionEvaluationError_base: Schema.Class<ExpressionEvaluationError, Schema.TaggedStruct<"ExpressionEvaluationError", {
|
|
48
|
+
readonly source: Schema.brand<Schema.String, "ExpressionSource">;
|
|
49
|
+
readonly message: Schema.NonEmptyString;
|
|
50
|
+
}>, import("effect/Cause").YieldableError>;
|
|
51
|
+
/** Typed failure from evaluating an expression that previously checked. */
|
|
52
|
+
export declare class ExpressionEvaluationError extends ExpressionEvaluationError_base {
|
|
53
|
+
}
|
|
54
|
+
/** Every failure mode this package's service can produce. */
|
|
55
|
+
export declare const ExpressionError: Schema.Union<readonly [typeof ExpressionCheckError, typeof ExpressionEvaluationError]>;
|
|
56
|
+
export type ExpressionError = typeof ExpressionError.Type;
|
|
57
|
+
/** Values admitted by prompt interpolation. CEL ints deliberately remain bigint here. */
|
|
58
|
+
export declare const Scalar: Schema.Union<readonly [Schema.String, Schema.Number, Schema.BigInt, Schema.Boolean, Schema.Null]>;
|
|
59
|
+
export type Scalar = typeof Scalar.Type;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,kDAAkD;AAClD,eAAO,MAAM,MAAM,iDAEqB,CAAC;AACzC,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAC;AAExC,6EAA6E;AAC7E,eAAO,MAAM,aAAa,iDAKc,CAAC;AACzC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;;;;;AAkBtD,kEAAkE;AAClE,qBAAa,WAAY,SAAQ,gBAG/B;CAAG;;;;;AAEL,oEAAoE;AACpE,qBAAa,UAAW,SAAQ,eAG9B;CAAG;;;;;AAEL,uDAAuD;AACvD,qBAAa,QAAS,SAAQ,aAG5B;CAAG;;;;;AAEL,2FAA2F;AAC3F,qBAAa,WAAY,SAAQ,gBAG/B;CAAG;AAIL,eAAO,MAAM,cAAc,mGAKzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAC;;;;;;;AAExD,kFAAkF;AAClF,qBAAa,oBAAqB,SAAQ,yBAOxC;CAAG;;;;;AAEL,2EAA2E;AAC3E,qBAAa,yBAA0B,SAAQ,8BAK7C;CAAG;AAEL,6DAA6D;AAC7D,eAAO,MAAM,eAAe,wFAAkE,CAAC;AAC/F,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC;AAE1D,yFAAyF;AACzF,eAAO,MAAM,MAAM,mGAMjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAC"}
|
package/dist/model.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
/** CEL source accepted at the config boundary. */
|
|
3
|
+
export const Source = Schema.String.check(Schema.isPattern(/\S/u, { message: "Expected a non-blank CEL expression" })).pipe(Schema.brand("ExpressionSource"));
|
|
4
|
+
/** A CEL-spec type reference such as `string`, `Issue`, or `list<Label>`. */
|
|
5
|
+
export const TypeReference = Schema.String.check(Schema.isPattern(/^(?:[A-Za-z_][A-Za-z0-9_.]*|list<[A-Za-z_][A-Za-z0-9_.]*>|map<[A-Za-z_][A-Za-z0-9_.]*,[A-Za-z_][A-Za-z0-9_.]*>)$/u, { message: "Expected a CEL type reference" })).pipe(Schema.brand("CelTypeReference"));
|
|
6
|
+
const Identifier = Schema.String.check(Schema.isPattern(/^[A-Za-z_][A-Za-z0-9_]*$/u, { message: "Expected a CEL identifier" }));
|
|
7
|
+
const ObjectTypeName = Schema.String.check(Schema.isPattern(/^[A-Za-z_][A-Za-z0-9_.]*$/u, {
|
|
8
|
+
message: "Expected a CEL object-type name",
|
|
9
|
+
}));
|
|
10
|
+
const uniqueNames = (message) => Schema.makeFilter((values) => new Set(values.map(({ name }) => name)).size === values.length, { message });
|
|
11
|
+
/** One field in a backend-neutral CEL object-type declaration. */
|
|
12
|
+
export class ObjectField extends Schema.Class("@usine/expression/ObjectField")({
|
|
13
|
+
name: Identifier,
|
|
14
|
+
type: TypeReference,
|
|
15
|
+
}) {
|
|
16
|
+
}
|
|
17
|
+
/** A CEL object type. Types are registered in declaration order. */
|
|
18
|
+
export class ObjectType extends Schema.Class("@usine/expression/ObjectType")({
|
|
19
|
+
name: ObjectTypeName,
|
|
20
|
+
fields: Schema.Array(ObjectField).check(uniqueNames("Expected unique CEL object-field names")),
|
|
21
|
+
}) {
|
|
22
|
+
}
|
|
23
|
+
/** One root variable available to a CEL expression. */
|
|
24
|
+
export class Variable extends Schema.Class("@usine/expression/Variable")({
|
|
25
|
+
name: Identifier,
|
|
26
|
+
type: TypeReference,
|
|
27
|
+
}) {
|
|
28
|
+
}
|
|
29
|
+
/** The checked namespace for one expression family, expressed in CEL's type vocabulary. */
|
|
30
|
+
export class Environment extends Schema.Class("@usine/expression/Environment")({
|
|
31
|
+
types: Schema.Array(ObjectType).check(uniqueNames("Expected unique CEL object-type names")),
|
|
32
|
+
variables: Schema.Array(Variable).check(uniqueNames("Expected unique CEL variable names")),
|
|
33
|
+
}) {
|
|
34
|
+
}
|
|
35
|
+
const Position = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
36
|
+
export const CheckErrorCode = Schema.Literals([
|
|
37
|
+
"check_failed",
|
|
38
|
+
"parse_error",
|
|
39
|
+
"type_error",
|
|
40
|
+
"unexpected_result_type",
|
|
41
|
+
]);
|
|
42
|
+
/** Typed failure from CEL parsing, type checking, or expected-result checking. */
|
|
43
|
+
export class ExpressionCheckError extends Schema.TaggedError("@usine/expression/ExpressionCheckError")("ExpressionCheckError", {
|
|
44
|
+
source: Source,
|
|
45
|
+
code: CheckErrorCode,
|
|
46
|
+
message: Schema.NonEmptyString,
|
|
47
|
+
position: Schema.Option(Position),
|
|
48
|
+
}) {
|
|
49
|
+
}
|
|
50
|
+
/** Typed failure from evaluating an expression that previously checked. */
|
|
51
|
+
export class ExpressionEvaluationError extends Schema.TaggedError("@usine/expression/ExpressionEvaluationError")("ExpressionEvaluationError", {
|
|
52
|
+
source: Source,
|
|
53
|
+
message: Schema.NonEmptyString,
|
|
54
|
+
}) {
|
|
55
|
+
}
|
|
56
|
+
/** Every failure mode this package's service can produce. */
|
|
57
|
+
export const ExpressionError = Schema.Union([ExpressionCheckError, ExpressionEvaluationError]);
|
|
58
|
+
/** Values admitted by prompt interpolation. CEL ints deliberately remain bigint here. */
|
|
59
|
+
export const Scalar = Schema.Union([
|
|
60
|
+
Schema.String,
|
|
61
|
+
Schema.Number,
|
|
62
|
+
Schema.BigInt,
|
|
63
|
+
Schema.Boolean,
|
|
64
|
+
Schema.Null,
|
|
65
|
+
]);
|
|
66
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,kDAAkD;AAClD,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACvC,MAAM,CAAC,SAAS,CAAC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AE,MAAM;IACd,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC;CAAG;AAEL,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC,CAAC;AAG/F,yFAAyF;AACzF,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC;IACjC,MAAM,CAAC,MAAM;IACb,MAAM,CAAC,MAAM;IACb,MAAM,CAAC,MAAM;IACb,MAAM,CAAC,OAAO;IACd,MAAM,CAAC,IAAI;CACZ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usine/expression",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "CEL expression seam for usine: check and evaluate the selection expressions loop files use.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,8 +22,14 @@
|
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@marcbachmann/cel-js": "8.0.0"
|
|
27
|
+
},
|
|
25
28
|
"devDependencies": {
|
|
29
|
+
"@effect/vitest": "4.0.0-rc.111",
|
|
30
|
+
"effect": "4.0.0-rc.111",
|
|
26
31
|
"typescript": "7.0.2",
|
|
32
|
+
"vitest": "4.1.11",
|
|
27
33
|
"@usine/tsconfig": "0.0.0"
|
|
28
34
|
},
|
|
29
35
|
"peerDependencies": {
|
|
@@ -33,6 +39,8 @@
|
|
|
33
39
|
"node": ">=22"
|
|
34
40
|
},
|
|
35
41
|
"scripts": {
|
|
36
|
-
"build": "tsc -b"
|
|
42
|
+
"build": "tsc -b",
|
|
43
|
+
"check": "tsc -p tsconfig.check.json",
|
|
44
|
+
"test": "vitest run"
|
|
37
45
|
}
|
|
38
46
|
}
|