@usine/expression 0.2.0 → 0.3.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 CHANGED
@@ -1,17 +1,17 @@
1
1
  # @usine/expression
2
2
 
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.
3
+ Typed CEL checking and evaluation for [usine](https://github.com/basaltbytes/usine). Describe types and root variables with `Environment`. `ExpressionEngine` then checks boolean trigger and scalar prompt expressions, and evaluates them over plain JSON.
4
4
 
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.
5
+ Import `ExpressionEngine`, `Source`, `Environment`, the environment descriptors, `Scalar`, and the typed errors from `@usine/expression/expression-engine`, which replaces `@usine/expression/model`. The CEL adapter layer is in `@usine/expression/marcbachmann-cel`.
6
6
 
7
- `relatedStringLiterals(source, memberPath)` reports string literals from the smallest expression subtrees that use a member path. Config validation uses it to diagnose undeclared GitHub labels without coupling `@usine/config` to the CEL adapter's AST.
7
+ A `nullable` `ObjectField` can be `null`, and an absent key reads as `null`. Expressions compare it with `null` in either order, and paths below it stay type-checked. Unknown variables and paths fail checking, also inside macros such as `exists`.
8
8
 
9
- `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.
9
+ Expressions can use CEL optional values: `.?` and `[?]` select a value that might be missing, and `optional` helpers such as `orValue` give a fallback. `item.?milestone.?title.orValue("none")` is `"none"` if `milestone` is null or absent. A null field counts as present, so `item.?milestone` holds `null`, not an empty optional.
10
10
 
11
- All APIs remain 0.x and can change between minor releases.
11
+ Errors: `ExpressionCheckError` (parse, type, or result type), `ExpressionEvaluationError`, and the union `ExpressionError`. JSON integers declared as CEL `int` or `uint` become `bigint` before evaluation, so GraphQL payloads keep CEL integer semantics.
12
12
 
13
- Import `ExpressionEngine`, `Source`, `Environment`, the environment descriptors,
14
- `Scalar`, and the typed expression errors from `@usine/expression/expression-engine`.
15
- This entry point replaces `@usine/expression/model`; existing imports from that
16
- subpath must use `/expression-engine`. Import the CEL adapter layer separately
17
- from `@usine/expression/marcbachmann-cel`.
13
+ `relatedStringLiterals(source, memberPath)` returns string literals from the smallest subtrees that use a member path. It accepts the same syntax as the checks, including `.?`. Config validation uses it to report undeclared labels without depending on the CEL AST.
14
+
15
+ `MarcbachmannCelLayer` uses `@marcbachmann/cel-js@8.0.0`. The contract uses CEL type names and usine descriptors, not library objects; an `@bufbuild/cel` adapter can provide the same tag.
16
+
17
+ The 0.x APIs can change between minor releases.
@@ -1,33 +1,43 @@
1
1
  import { Schema } from "effect";
2
- /** A type name in CEL syntax such as `string`, `Issue`, or `list<Label>`. */
2
+ /**
3
+ * A CEL type name without spaces, such as `string`, `Label`, `list<T>`, or `map<K,V>`.
4
+ * Decoding checks only the syntax; an undeclared object type fails when an expression is checked.
5
+ */
3
6
  export declare const TypeReference: Schema.brand<Schema.String, "CelTypeReference">;
4
7
  export type TypeReference = typeof TypeReference.Type;
5
8
  declare const ObjectField_base: Schema.Class<ObjectField, Schema.Struct<{
6
9
  readonly name: Schema.String;
10
+ /** The CEL type of a non-`null` value. */
7
11
  readonly type: Schema.brand<Schema.String, "CelTypeReference">;
12
+ /** Whether the value can be `null` or absent. Reading an absent non-nullable field fails evaluation. */
13
+ readonly nullable: Schema.withConstructorDefault<Schema.Boolean>;
8
14
  }>, {}>;
9
- /** One named field and its CEL type within an object descriptor. */
15
+ /** A field of an {@link ObjectType}. If the field is nullable and its key is absent, it evaluates to `null`. */
10
16
  export declare class ObjectField extends ObjectField_base {
11
17
  }
12
18
  declare const ObjectType_base: Schema.Class<ObjectType, Schema.Struct<{
13
19
  readonly name: Schema.String;
14
20
  readonly fields: Schema.$Array<typeof ObjectField>;
15
21
  }>, {}>;
16
- /** A CEL object type. Declare a type before the types that reference it. */
22
+ /** An object type that expressions can read fields from, such as `IssuePayload`. */
17
23
  export declare class ObjectType extends ObjectType_base {
18
24
  }
19
25
  declare const Variable_base: Schema.Class<Variable, Schema.Struct<{
20
26
  readonly name: Schema.String;
21
27
  readonly type: Schema.brand<Schema.String, "CelTypeReference">;
22
28
  }>, {}>;
23
- /** A root variable available to CEL expressions in an Environment. */
29
+ /** A root variable, such as `repo` or `item`, whose value is the `context` entry with the same name. */
24
30
  export declare class Variable extends Variable_base {
25
31
  }
26
32
  declare const Environment_base: Schema.Class<Environment, Schema.Struct<{
33
+ /** The object types, each declared before any type whose fields reference it. */
27
34
  readonly types: Schema.$Array<typeof ObjectType>;
28
35
  readonly variables: Schema.$Array<typeof Variable>;
29
36
  }>, {}>;
30
- /** The types and root variables an expression is checked and evaluated against. */
37
+ /**
38
+ * The types and root variables that expressions are checked and evaluated against. An
39
+ * expression that references anything else fails checking.
40
+ */
31
41
  export declare class Environment extends Environment_base {
32
42
  }
33
43
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,6EAA6E;AAC7E,eAAO,MAAM,aAAa,iDAKc,CAAC;AACzC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;;;;;AAkBtD,oEAAoE;AACpE,qBAAa,WAAY,SAAQ,gBAG/B;CAAG;;;;;AAEL,4EAA4E;AAC5E,qBAAa,UAAW,SAAQ,eAG9B;CAAG;;;;;AAEL,sEAAsE;AACtE,qBAAa,QAAS,SAAQ,aAG5B;CAAG;;;;;AAEL,mFAAmF;AACnF,qBAAa,WAAY,SAAQ,gBAG/B;CAAG"}
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,aAAa,iDAKc,CAAC;AACzC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;;;IAqBpD,0CAA0C;;IAE1C,wGAAwG;;;AAL1G,gHAAgH;AAChH,qBAAa,WAAY,SAAQ,gBAM/B;CAAG;;;;;AAEL,oFAAoF;AACpF,qBAAa,UAAW,SAAQ,eAG9B;CAAG;;;;;AAEL,wGAAwG;AACxG,qBAAa,QAAS,SAAQ,aAG5B;CAAG;;IAOH,iFAAiF;;;;AALnF;;;GAGG;AACH,qBAAa,WAAY,SAAQ,gBAI/B;CAAG"}
@@ -1,31 +1,41 @@
1
- import { Schema } from "effect";
2
- /** A type name in CEL syntax such as `string`, `Issue`, or `list<Label>`. */
1
+ import { Effect, Schema } from "effect";
2
+ /**
3
+ * A CEL type name without spaces, such as `string`, `Label`, `list<T>`, or `map<K,V>`.
4
+ * Decoding checks only the syntax; an undeclared object type fails when an expression is checked.
5
+ */
3
6
  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"));
4
7
  const Identifier = Schema.String.check(Schema.isPattern(/^[A-Za-z_][A-Za-z0-9_]*$/u, { message: "Expected a CEL identifier" }));
5
8
  const ObjectTypeName = Schema.String.check(Schema.isPattern(/^[A-Za-z_][A-Za-z0-9_.]*$/u, {
6
9
  message: "Expected a CEL object-type name",
7
10
  }));
8
11
  const uniqueNames = (message) => Schema.makeFilter((values) => new Set(values.map(({ name }) => name)).size === values.length, { message });
9
- /** One named field and its CEL type within an object descriptor. */
12
+ /** A field of an {@link ObjectType}. If the field is nullable and its key is absent, it evaluates to `null`. */
10
13
  export class ObjectField extends Schema.Class("@usine/expression/ObjectField")({
11
14
  name: Identifier,
15
+ /** The CEL type of a non-`null` value. */
12
16
  type: TypeReference,
17
+ /** Whether the value can be `null` or absent. Reading an absent non-nullable field fails evaluation. */
18
+ nullable: Schema.Boolean.pipe(Schema.withConstructorDefault(Effect.succeed(false))),
13
19
  }) {
14
20
  }
15
- /** A CEL object type. Declare a type before the types that reference it. */
21
+ /** An object type that expressions can read fields from, such as `IssuePayload`. */
16
22
  export class ObjectType extends Schema.Class("@usine/expression/ObjectType")({
17
23
  name: ObjectTypeName,
18
24
  fields: Schema.Array(ObjectField).check(uniqueNames("Expected unique CEL object-field names")),
19
25
  }) {
20
26
  }
21
- /** A root variable available to CEL expressions in an Environment. */
27
+ /** A root variable, such as `repo` or `item`, whose value is the `context` entry with the same name. */
22
28
  export class Variable extends Schema.Class("@usine/expression/Variable")({
23
29
  name: Identifier,
24
30
  type: TypeReference,
25
31
  }) {
26
32
  }
27
- /** The types and root variables an expression is checked and evaluated against. */
33
+ /**
34
+ * The types and root variables that expressions are checked and evaluated against. An
35
+ * expression that references anything else fails checking.
36
+ */
28
37
  export class Environment extends Schema.Class("@usine/expression/Environment")({
38
+ /** The object types, each declared before any type whose fields reference it. */
29
39
  types: Schema.Array(ObjectType).check(uniqueNames("Expected unique CEL object-type names")),
30
40
  variables: Schema.Array(Variable).check(uniqueNames("Expected unique CEL variable names")),
31
41
  }) {
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAC9C,MAAM,CAAC,SAAS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AAC,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,EAC1E,EAAE,OAAO,EAAE,CACZ,CAAC;AAEJ,gHAAgH;AAChH,MAAM,OAAO,WAAY,SAAQ,MAAM,CAAC,KAAK,CAAc,+BAA+B,CAAC,CAAC;IAC1F,IAAI,EAAE,UAAU;IAChB,0CAA0C;IAC1C,IAAI,EAAE,aAAa;IACnB,wGAAwG;IACxG,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;CACpF,CAAC;CAAG;AAEL,oFAAoF;AACpF,MAAM,OAAO,UAAW,SAAQ,MAAM,CAAC,KAAK,CAAa,8BAA8B,CAAC,CAAC;IACvF,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,wCAAwC,CAAC,CAAC;CAC/F,CAAC;CAAG;AAEL,wGAAwG;AACxG,MAAM,OAAO,QAAS,SAAQ,MAAM,CAAC,KAAK,CAAW,4BAA4B,CAAC,CAAC;IACjF,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,aAAa;CACpB,CAAC;CAAG;AAEL;;;GAGG;AACH,MAAM,OAAO,WAAY,SAAQ,MAAM,CAAC,KAAK,CAAc,+BAA+B,CAAC,CAAC;IAC1F,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,uCAAuC,CAAC,CAAC;IAC3F,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,oCAAoC,CAAC,CAAC;CAC3F,CAAC;CAAG"}
@@ -1,52 +1,82 @@
1
- import { Context, type Effect, Schema } from "effect";
1
+ import { Context, type Effect, type Result, Schema } from "effect";
2
2
  import type { Environment } from "./environment.ts";
3
- /** Non-blank CEL source text. */
3
+ /**
4
+ * The text of a CEL expression, such as a Loop's `if:` condition or a `{{ }}` interpolation.
5
+ * Decoding rejects blank text; {@link ExpressionEngine} checks syntax and types.
6
+ */
4
7
  export declare const Source: Schema.brand<Schema.String, "ExpressionSource">;
5
8
  export type Source = typeof Source.Type;
6
- /** Whether checking failed during parsing, type resolution, or result-type validation. */
9
+ /**
10
+ * - `parse_error`: the source is not valid CEL syntax.
11
+ * - `type_error`: the source references an unknown variable or field, or combines
12
+ * incompatible types.
13
+ * - `unexpected_result_type`: the result type is wrong for the operation, such as a non-`bool`
14
+ * selection condition.
15
+ * - `check_failed`: the CEL implementation rejected the {@link Environment} itself, such as an
16
+ * undeclared type name, or failed without a detail.
17
+ */
7
18
  export declare const CheckErrorCode: Schema.Literals<readonly ["check_failed", "parse_error", "type_error", "unexpected_result_type"]>;
8
19
  export type CheckErrorCode = typeof CheckErrorCode.Type;
9
20
  declare const ExpressionCheckError_base: Schema.Class<ExpressionCheckError, Schema.TaggedStruct<"ExpressionCheckError", {
10
21
  readonly source: Schema.brand<Schema.String, "ExpressionSource">;
11
22
  readonly code: Schema.Literals<readonly ["check_failed", "parse_error", "type_error", "unexpected_result_type"]>;
23
+ /**
24
+ * A human-readable description, possibly multi-line with a marked excerpt of `source`. The
25
+ * wording isn't stable; branch on `code`.
26
+ */
12
27
  readonly message: Schema.NonEmptyString;
28
+ /**
29
+ * The zero-based offset in `source` where the failure starts. Always `None` for
30
+ * `unexpected_result_type` and `check_failed`.
31
+ */
13
32
  readonly position: Schema.Option<Schema.Int>;
14
33
  }>, import("effect/Cause").YieldableError>;
15
- /** The expression failed to parse, to type-check, or to produce the expected result type. */
34
+ /** An error from checking an expression against an {@link Environment}; checking never reads a payload. */
16
35
  export declare class ExpressionCheckError extends ExpressionCheckError_base {
17
36
  }
18
37
  declare const ExpressionEvaluationError_base: Schema.Class<ExpressionEvaluationError, Schema.TaggedStruct<"ExpressionEvaluationError", {
19
38
  readonly source: Schema.brand<Schema.String, "ExpressionSource">;
39
+ /** A human-readable description, possibly multi-line with a marked excerpt of `source`. The wording isn't stable. */
20
40
  readonly message: Schema.NonEmptyString;
21
41
  }>, import("effect/Cause").YieldableError>;
22
- /** Evaluation failed on an expression that had already checked. */
42
+ /**
43
+ * An error from evaluating a checked expression, such as a missing `context` key, a value of the
44
+ * wrong type, division by zero, or an out-of-range list index.
45
+ */
23
46
  export declare class ExpressionEvaluationError extends ExpressionEvaluationError_base {
24
47
  }
25
- /** The failures callers can receive when checking or evaluating a CEL expression. */
26
48
  export declare const ExpressionError: Schema.Union<readonly [typeof ExpressionCheckError, typeof ExpressionEvaluationError]>;
27
49
  export type ExpressionError = typeof ExpressionError.Type;
28
- /** Values prompt interpolation can render. CEL ints stay bigint. */
50
+ /**
51
+ * The result of a prompt interpolation; CEL `int` is a `bigint` and `double` is a `number`. A
52
+ * `uint` result passes `checkScalar`, but `evaluateScalar` fails with
53
+ * {@link ExpressionEvaluationError}; wrap it in `string(...)` or `double(...)`.
54
+ */
29
55
  export declare const Scalar: Schema.Union<readonly [Schema.String, Schema.Number, Schema.BigInt, Schema.Boolean, Schema.Null]>;
30
56
  export type Scalar = typeof Scalar.Type;
31
- /** Checks and evaluates the expressions used to select Items and fill Loop task templates. */
32
57
  export interface ExpressionEngineService {
33
58
  /**
34
- * The string literals the expression compares against the `name` field of
35
- * values reached from `memberPath`, following macro bindings and collection
36
- * transformations. Config validation uses it to spot undeclared labels.
59
+ * Returns the string literals compared with the `name` field of values under `memberPath`,
60
+ * following macro bindings and collection transformations. Accepts the same syntax as
61
+ * `checkBoolean` and `checkScalar`, including optional selection (`.?`).
37
62
  */
38
63
  readonly relatedStringLiterals: (source: Source, memberPath: ReadonlyArray<string>) => Effect.Effect<ReadonlyArray<string>, ExpressionCheckError>;
39
- /** Checks whether the expression can select Items, without evaluating a payload. */
64
+ /** Checks that the expression has type `bool`. */
40
65
  readonly checkBoolean: (source: Source, environment: Environment) => Effect.Effect<void, ExpressionCheckError>;
41
- /** Checks whether the expression can produce one value for prompt interpolation. */
66
+ /** Checks that the expression can be a prompt interpolation. */
42
67
  readonly checkScalar: (source: Source, environment: Environment) => Effect.Effect<void, ExpressionCheckError>;
43
- /** Checks and evaluates a selection condition; `context` supplies values for the environment's root variables. */
68
+ /** Checks and evaluates a selection condition against `context`. */
44
69
  readonly evaluateBoolean: (source: Source, environment: Environment, context: Schema.JsonObject) => Effect.Effect<boolean, ExpressionError>;
45
- /** Checks and evaluates a prompt interpolation; `context` supplies values for the environment's root variables. */
70
+ /**
71
+ * Checks the condition once and evaluates it against each of `contexts`, returning one
72
+ * `Result` per context in order. Fails with `ExpressionCheckError` if the check fails.
73
+ */
74
+ readonly evaluateBooleanEach: (source: Source, environment: Environment, contexts: ReadonlyArray<Schema.JsonObject>) => Effect.Effect<ReadonlyArray<Result.Result<boolean, ExpressionEvaluationError>>, ExpressionCheckError>;
75
+ /** Checks and evaluates a prompt interpolation against `context`. */
46
76
  readonly evaluateScalar: (source: Source, environment: Environment, context: Schema.JsonObject) => Effect.Effect<Scalar, ExpressionError>;
47
77
  }
48
78
  declare const ExpressionEngine_base: Context.ServiceClass<ExpressionEngine, "@usine/expression/ExpressionEngine", ExpressionEngineService>;
49
- /** Evaluates Loop conditions and prompt expressions against their declared payload context. */
79
+ /** The CEL expression service, provided by `MarcbachmannCelLayer` from `@usine/expression/marcbachmann-cel`. */
50
80
  export declare class ExpressionEngine extends ExpressionEngine_base {
51
81
  }
52
82
  export { TypeReference, ObjectField, ObjectType, Variable, Environment } from "./environment.ts";
@@ -1 +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,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,iCAAiC;AACjC,eAAO,MAAM,MAAM,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;AAChH,qBAAa,gBAAiB,SAAQ,qBAErC;CAAG;AAEJ,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,31 +1,57 @@
1
1
  import { Context, Schema } from "effect";
2
- /** Non-blank CEL source text. */
2
+ /**
3
+ * The text of a CEL expression, such as a Loop's `if:` condition or a `{{ }}` interpolation.
4
+ * Decoding rejects blank text; {@link ExpressionEngine} checks syntax and types.
5
+ */
3
6
  export const Source = Schema.String.check(Schema.isPattern(/\S/u, { message: "Expected a non-blank CEL expression" })).pipe(Schema.brand("ExpressionSource"));
4
7
  const Position = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
5
- /** Whether checking failed during parsing, type resolution, or result-type validation. */
8
+ /**
9
+ * - `parse_error`: the source is not valid CEL syntax.
10
+ * - `type_error`: the source references an unknown variable or field, or combines
11
+ * incompatible types.
12
+ * - `unexpected_result_type`: the result type is wrong for the operation, such as a non-`bool`
13
+ * selection condition.
14
+ * - `check_failed`: the CEL implementation rejected the {@link Environment} itself, such as an
15
+ * undeclared type name, or failed without a detail.
16
+ */
6
17
  export const CheckErrorCode = Schema.Literals([
7
18
  "check_failed",
8
19
  "parse_error",
9
20
  "type_error",
10
21
  "unexpected_result_type",
11
22
  ]);
12
- /** The expression failed to parse, to type-check, or to produce the expected result type. */
23
+ /** An error from checking an expression against an {@link Environment}; checking never reads a payload. */
13
24
  export class ExpressionCheckError extends Schema.TaggedError("@usine/expression/ExpressionCheckError")("ExpressionCheckError", {
14
25
  source: Source,
15
26
  code: CheckErrorCode,
27
+ /**
28
+ * A human-readable description, possibly multi-line with a marked excerpt of `source`. The
29
+ * wording isn't stable; branch on `code`.
30
+ */
16
31
  message: Schema.NonEmptyString,
32
+ /**
33
+ * The zero-based offset in `source` where the failure starts. Always `None` for
34
+ * `unexpected_result_type` and `check_failed`.
35
+ */
17
36
  position: Schema.Option(Position),
18
37
  }) {
19
38
  }
20
- /** Evaluation failed on an expression that had already checked. */
39
+ /**
40
+ * An error from evaluating a checked expression, such as a missing `context` key, a value of the
41
+ * wrong type, division by zero, or an out-of-range list index.
42
+ */
21
43
  export class ExpressionEvaluationError extends Schema.TaggedError("@usine/expression/ExpressionEvaluationError")("ExpressionEvaluationError", {
22
44
  source: Source,
45
+ /** A human-readable description, possibly multi-line with a marked excerpt of `source`. The wording isn't stable. */
23
46
  message: Schema.NonEmptyString,
24
47
  }) {
25
48
  }
26
- /** The failures callers can receive when checking or evaluating a CEL expression. */
27
49
  export const ExpressionError = Schema.Union([ExpressionCheckError, ExpressionEvaluationError]);
28
- /** Values prompt interpolation can render. CEL ints stay bigint. */
50
+ /**
51
+ * The result of a prompt interpolation; CEL `int` is a `bigint` and `double` is a `number`. A
52
+ * `uint` result passes `checkScalar`, but `evaluateScalar` fails with
53
+ * {@link ExpressionEvaluationError}; wrap it in `string(...)` or `double(...)`.
54
+ */
29
55
  export const Scalar = Schema.Union([
30
56
  Schema.String,
31
57
  Schema.Number,
@@ -33,7 +59,7 @@ export const Scalar = Schema.Union([
33
59
  Schema.Boolean,
34
60
  Schema.Null,
35
61
  ]);
36
- /** Evaluates Loop conditions and prompt expressions against their declared payload context. */
62
+ /** The CEL expression service, provided by `MarcbachmannCelLayer` from `@usine/expression/marcbachmann-cel`. */
37
63
  export class ExpressionEngine extends Context.Service()("@usine/expression/ExpressionEngine") {
38
64
  }
39
65
  export { TypeReference, ObjectField, ObjectType, Variable, Environment } from "./environment.js";
@@ -1 +1 @@
1
- {"version":3,"file":"expression-engine.js","sourceRoot":"","sources":["../src/expression-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGtD,iCAAiC;AACjC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACvC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,qCAA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AC;CAAG;AAEL,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,oBAAoB,EAAE,yBAAyB,CAAC,CAAC,CAAC;AAG/F;;;;GAIG;AACH,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;AAiDH,gHAAgH;AAChH,MAAM,OAAO,gBAAiB,SAAQ,OAAO,CAAC,OAAO,EAA6C,CAChG,oCAAoC,CACrC;CAAG;AAEJ,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,5 +1,20 @@
1
1
  import { Layer } from "effect";
2
2
  import { ExpressionEngine } from "./expression-engine.ts";
3
- /** The ExpressionEngine implementation on @marcbachmann/cel-js. */
3
+ /**
4
+ * Provides {@link ExpressionEngine} with `@marcbachmann/cel-js` 8.0.0
5
+ * ([ADR 0004](../../../docs/adr/0004-loop-files-markdown-cel-frontmatter.md)).
6
+ *
7
+ * Expressions can use CEL optional values, such as `item.?milestone.?title.orValue("none")`. A
8
+ * nullable field that holds `null` counts as present, so `item.?milestone` holds `null` and
9
+ * `item.?milestone.?title` is empty.
10
+ *
11
+ * Before evaluation, converts JSON integers to `bigint` wherever the {@link Environment}
12
+ * declares `int`, at any depth, and sets absent nullable fields to `null`. Values inside a
13
+ * `map<K,V>` aren't converted, so declare integer map values as `double`.
14
+ *
15
+ * `uint` isn't supported in `context`; declare such values as `int`. An expression that reads a
16
+ * non-nullable `uint` value type-checks but fails evaluation. On a nullable field, comparing with a
17
+ * `uint` literal works but `uint` arithmetic fails. A `uint` result fails `evaluateScalar`.
18
+ */
4
19
  export declare const MarcbachmannCelLayer: Layer.Layer<ExpressionEngine, never, never>;
5
20
  //# sourceMappingURL=marcbachmann-cel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"marcbachmann-cel.d.ts","sourceRoot":"","sources":["../src/marcbachmann-cel.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,KAAK,EAAkB,MAAM,QAAQ,CAAC;AAEvD,OAAO,EACL,gBAAgB,EAKjB,MAAM,wBAAwB,CAAC;AA6XhC,mEAAmE;AACnE,eAAO,MAAM,oBAAoB,6CAM/B,CAAC"}
1
+ {"version":3,"file":"marcbachmann-cel.d.ts","sourceRoot":"","sources":["../src/marcbachmann-cel.ts"],"names":[],"mappings":"AASA,OAAO,EAAU,KAAK,EAAqC,MAAM,QAAQ,CAAC;AAE1E,OAAO,EACL,gBAAgB,EAKjB,MAAM,wBAAwB,CAAC;AAsjBhC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,6CAAqD,CAAC"}
@@ -1,13 +1,19 @@
1
- import { Environment as CelEnvironment, ParseError as CelParseError, TypeError as CelTypeError, parse, } from "@marcbachmann/cel-js";
2
- import { Effect, Layer, Option, Schema } from "effect";
1
+ import { Environment as CelEnvironment, ParseError as CelParseError, TypeError as CelTypeError, } from "@marcbachmann/cel-js";
2
+ import { Effect, Layer, Option, Predicate, Result, Schema } from "effect";
3
3
  import { TypeReference } from "./environment.js";
4
4
  import { ExpressionEngine, ExpressionCheckError, ExpressionEvaluationError, Scalar, } from "./expression-engine.js";
5
5
  const decodeTypeReference = Schema.decodeUnknownSync(TypeReference);
6
+ const ENVIRONMENT_OPTIONS = {
7
+ unlistedVariablesAreDyn: false,
8
+ enableOptionalTypes: true,
9
+ };
10
+ /** Parser for {@link relatedStringLiterals}, with the checking options so that it accepts `.?`. */
11
+ const parser = new CelEnvironment(ENVIRONMENT_OPTIONS);
6
12
  const acceptedScalarTypes = new Set([
7
13
  "bool",
8
14
  "double",
9
15
  "int",
10
- "null_type",
16
+ "null",
11
17
  "string",
12
18
  "uint",
13
19
  ]);
@@ -19,7 +25,7 @@ const checkFailure = (source, error) => error === undefined
19
25
  ? new ExpressionCheckError({
20
26
  source,
21
27
  code: "check_failed",
22
- message: "CEL check failed without an error detail",
28
+ message: "The CEL check failed and returned no error details",
23
29
  position: Option.none(),
24
30
  })
25
31
  : new ExpressionCheckError({
@@ -67,7 +73,7 @@ const MACROS_WITH_BINDINGS = new Set([
67
73
  "filter",
68
74
  "map",
69
75
  ]);
70
- /** The member path a node reads from, followed back through macro bindings and collection transformations. */
76
+ /** Returns the member path that a node reads, resolved through macro bindings and `filter`/`map` receivers, or `undefined`. */
71
77
  const lineagePathOf = (node, bindings) => {
72
78
  const path = pathOf(node);
73
79
  if (path !== undefined) {
@@ -91,12 +97,7 @@ const lineagePathOf = (node, bindings) => {
91
97
  return lineagePathOf(projection, new Map(bindings).set(binding.args, receiverPath));
92
98
  };
93
99
  const startsWithPath = (path, prefix) => prefix.every((part, index) => path[index] === part);
94
- /**
95
- * The string literals an operand can evaluate to. Only result positions count:
96
- * a conditional contributes its branches and not its test, a list its
97
- * elements. `item.state == "OPEN" ? "ready" : "review"` yields the two labels
98
- * and not the state.
99
- */
100
+ /** Returns the string literals an operand can evaluate to: a literal, both branches of `?:`, and list elements. */
100
101
  const resultStringLiterals = (node) => {
101
102
  switch (node.op) {
102
103
  case "value":
@@ -133,7 +134,7 @@ const comparisonLiterals = (node, memberPath, bindings) => {
133
134
  return [];
134
135
  }
135
136
  };
136
- /** Collects the literals compared against `name` on members bound by macros over the watched collection. */
137
+ /** Returns the literals compared with `name` on values under `memberPath`, including through macro variables. */
137
138
  const scanRelatedLiterals = (node, memberPath, bindings) => {
138
139
  const related = comparisonLiterals(node, memberPath, bindings);
139
140
  if (node.op !== "rcall" || !MACROS_WITH_BINDINGS.has(node.args[0])) {
@@ -162,7 +163,7 @@ const relatedStringLiterals = Effect.fn("ExpressionEngine.relatedStringLiterals"
162
163
  if (memberPath.length === 0)
163
164
  return [];
164
165
  const ast = yield* Effect.try({
165
- try: () => parse(source).ast,
166
+ try: () => parser.parse(source).ast,
166
167
  catch: (cause) => cause instanceof CelParseError
167
168
  ? checkFailure(source, cause)
168
169
  : new ExpressionCheckError({
@@ -174,53 +175,173 @@ const relatedStringLiterals = Effect.fn("ExpressionEngine.relatedStringLiterals"
174
175
  });
175
176
  return [...new Set(scanRelatedLiterals(ast, memberPath, new Map()))];
176
177
  });
177
- const makeEnvironment = (descriptor) => {
178
- const environment = new CelEnvironment({ unlistedVariablesAreDyn: false });
178
+ /**
179
+ * Creates the cel-js environment for checking or evaluating `descriptor`. Because cel-js rejects
180
+ * `null` in a typed field and can't index `dyn<T>`, evaluation declares nullable fields as `dyn`.
181
+ * Both register `T == null`; cel-js derives `!=` and the reversed operand order from it.
182
+ */
183
+ const makeEnvironment = (descriptor, purpose) => {
184
+ const environment = new CelEnvironment(ENVIRONMENT_OPTIONS);
185
+ const nullableTypes = new Set();
179
186
  for (const objectType of descriptor.types) {
180
187
  environment.registerType(objectType.name, {
181
- fields: Object.fromEntries(objectType.fields.map((field) => [field.name, field.type])),
188
+ fields: Object.fromEntries(objectType.fields.map((field) => {
189
+ if (!field.nullable)
190
+ return [field.name, field.type];
191
+ nullableTypes.add(field.type);
192
+ return [field.name, purpose === "check" ? field.type : "dyn"];
193
+ })),
182
194
  });
183
195
  }
196
+ for (const type of nullableTypes) {
197
+ environment.registerOperator(`${type} == null`, (left, right) => left === right);
198
+ }
184
199
  for (const variable of descriptor.variables) {
185
200
  environment.registerVariable(variable.name, variable.type);
186
201
  }
187
202
  return environment;
188
203
  };
189
- const normalizeValue = (value, type, objectTypes) => {
190
- if ((type === "int" || type === "uint") &&
191
- Schema.is(Schema.Number)(value) &&
192
- Number.isInteger(value)) {
193
- return BigInt(value);
204
+ /** Returns whether `value` is a JSON object, checking only the top level because the context is already `Schema.Json` (#464). */
205
+ const isJsonObject = (value) => Predicate.isObject(value);
206
+ /** The identity normalizer, compared by reference to skip types that need no normalization. */
207
+ const unchanged = (value) => value;
208
+ /** Sets `name` as an own property, including `__proto__`. */
209
+ const setField = (target, name, value) => {
210
+ if (name === "__proto__") {
211
+ Object.defineProperty(target, name, {
212
+ value,
213
+ enumerable: true,
214
+ writable: true,
215
+ configurable: true,
216
+ });
194
217
  }
195
- if (type.startsWith("list<") && type.endsWith(">") && Array.isArray(value)) {
196
- const itemType = decodeTypeReference(type.slice(5, -1));
197
- return value.map((item) => normalizeValue(item, itemType, objectTypes));
218
+ else {
219
+ target[name] = value;
198
220
  }
199
- const objectType = objectTypes.get(type);
200
- if (objectType !== undefined && Schema.is(Schema.JsonObject)(value)) {
201
- return Object.fromEntries(Object.entries(value).map(([key, fieldValue]) => {
202
- const field = objectType.fields.find(({ name }) => name === key);
203
- return [
204
- key,
205
- field === undefined ? fieldValue : normalizeValue(fieldValue, field.type, objectTypes),
206
- ];
207
- }));
221
+ };
222
+ /**
223
+ * Returns the context normalizer for `descriptor`, which converts `int` and `uint` numbers to
224
+ * `bigint` and sets absent nullable fields to `null`, recursing into `list<T>` items and declared
225
+ * object fields. Returns unchanged values as is, and shallow-copies changed objects.
226
+ */
227
+ const contextNormalizer = (descriptor) => {
228
+ const objectTypes = new Map(descriptor.types.map((type) => [type.name, type]));
229
+ const compiled = new Map();
230
+ // Can't recurse forever: the Environment declares each type before any type that references it.
231
+ const normalizerOf = (type) => {
232
+ const existing = compiled.get(type);
233
+ if (existing !== undefined)
234
+ return existing;
235
+ const normalize = compile(type);
236
+ compiled.set(type, normalize);
237
+ return normalize;
238
+ };
239
+ const compile = (type) => {
240
+ if (type === "int" || type === "uint") {
241
+ return (value) => Predicate.isNumber(value) && Number.isInteger(value) ? BigInt(value) : value;
242
+ }
243
+ if (type.startsWith("list<") && type.endsWith(">")) {
244
+ const normalizeItem = normalizerOf(decodeTypeReference(type.slice(5, -1)));
245
+ if (normalizeItem === unchanged)
246
+ return unchanged;
247
+ return (value) => (Array.isArray(value) ? value.map(normalizeItem) : value);
248
+ }
249
+ const objectType = objectTypes.get(type);
250
+ if (objectType === undefined)
251
+ return unchanged;
252
+ const fields = objectType.fields.flatMap(({ name, type: fieldType }) => {
253
+ const normalize = normalizerOf(fieldType);
254
+ return normalize === unchanged ? [] : [[name, normalize]];
255
+ });
256
+ const nullable = objectType.fields.filter((field) => field.nullable).map(({ name }) => name);
257
+ if (fields.length === 0 && nullable.length === 0)
258
+ return unchanged;
259
+ return (value) => {
260
+ if (!isJsonObject(value))
261
+ return value;
262
+ const normalized = { ...value };
263
+ for (const [name, normalize] of fields) {
264
+ const fieldValue = value[name];
265
+ if (fieldValue !== undefined && Object.hasOwn(value, name)) {
266
+ setField(normalized, name, normalize(fieldValue));
267
+ }
268
+ }
269
+ for (const name of nullable) {
270
+ if (!Object.hasOwn(value, name))
271
+ setField(normalized, name, null);
272
+ }
273
+ return normalized;
274
+ };
275
+ };
276
+ const variables = new Map(descriptor.variables.map((variable) => [variable.name, normalizerOf(variable.type)]));
277
+ return (context) => {
278
+ const normalized = { ...context };
279
+ for (const [name, normalize] of variables) {
280
+ const value = context[name];
281
+ if (value !== undefined && Object.hasOwn(context, name)) {
282
+ setField(normalized, name, normalize(value));
283
+ }
284
+ }
285
+ return normalized;
286
+ };
287
+ };
288
+ /** The maximum number of cached check results, and of parse results, per environment. */
289
+ const KEPT_EXPRESSIONS = 256;
290
+ /** Stores `value` under `key` and returns it, evicting the oldest entry if the map is full. */
291
+ const keep = (kept, key, value) => {
292
+ if (kept.size >= KEPT_EXPRESSIONS) {
293
+ const oldest = kept.keys().next();
294
+ if (oldest.done !== true)
295
+ kept.delete(oldest.value);
208
296
  }
297
+ kept.set(key, value);
209
298
  return value;
210
299
  };
211
- const normalizeContext = (context, descriptor) => {
212
- const objectTypes = new Map(descriptor.types.map((type) => [type.name, type]));
213
- return Object.fromEntries(Object.entries(context).map(([key, value]) => {
214
- const variable = descriptor.variables.find(({ name }) => name === key);
215
- return [
216
- key,
217
- variable === undefined ? value : normalizeValue(value, variable.type, objectTypes),
218
- ];
219
- }));
300
+ /**
301
+ * Creates a cache of cel-js environments, check results, and parse results, keyed by descriptor
302
+ * in a `WeakMap` (#464). Doesn't cache a build or parse that throws, and keeps the
303
+ * {@link KEPT_EXPRESSIONS} newest entries per cache. A cached parse result retains the last
304
+ * evaluated context until the next evaluation.
305
+ */
306
+ const celRuntimes = () => {
307
+ const runtimes = new WeakMap();
308
+ const runtimeOf = (descriptor) => {
309
+ const existing = runtimes.get(descriptor);
310
+ if (existing !== undefined)
311
+ return existing;
312
+ const runtime = {
313
+ normalize: contextNormalizer(descriptor),
314
+ check: Option.none(),
315
+ evaluate: Option.none(),
316
+ checked: new Map(),
317
+ parsed: new Map(),
318
+ };
319
+ runtimes.set(descriptor, runtime);
320
+ return runtime;
321
+ };
322
+ const environmentOf = (runtime, descriptor, purpose) => Option.getOrElse(runtime[purpose], () => {
323
+ const environment = makeEnvironment(descriptor, purpose);
324
+ runtime[purpose] = Option.some(environment);
325
+ return environment;
326
+ });
327
+ return {
328
+ check: (descriptor, source) => {
329
+ const runtime = runtimeOf(descriptor);
330
+ return (runtime.checked.get(source) ??
331
+ keep(runtime.checked, source, environmentOf(runtime, descriptor, "check").check(source)));
332
+ },
333
+ evaluate: (descriptor, source, context) => {
334
+ const runtime = runtimeOf(descriptor);
335
+ const parsed = runtime.parsed.get(source) ??
336
+ keep(runtime.parsed, source, environmentOf(runtime, descriptor, "evaluate").parse(source));
337
+ // SAFETY: CEL returns values of the context's types, and callers decode the result type.
338
+ return parsed(runtime.normalize(context));
339
+ },
340
+ };
220
341
  };
221
- const checkExpected = (source, environment, accepts, expected) => Effect.gen(function* () {
342
+ const checkExpected = (runtimes, source, environment, accepts, expected) => Effect.gen(function* () {
222
343
  const result = yield* Effect.try({
223
- try: () => makeEnvironment(environment).check(source),
344
+ try: () => runtimes.check(environment, source),
224
345
  catch: (cause) => new ExpressionCheckError({
225
346
  source,
226
347
  code: "check_failed",
@@ -240,11 +361,8 @@ const checkExpected = (source, environment, accepts, expected) => Effect.gen(fun
240
361
  });
241
362
  }
242
363
  });
243
- const evaluateRaw = (source, environment, context) => Effect.try({
244
- try: () =>
245
- // SAFETY: CEL evaluates to the same value vocabulary the context is built
246
- // from, and every caller decodes the expected result type before use.
247
- makeEnvironment(environment).evaluate(source, normalizeContext(context, environment)),
364
+ const evaluated = (runtimes, source, environment, context) => Result.try({
365
+ try: () => runtimes.evaluate(environment, source, context),
248
366
  catch: (cause) => new ExpressionEvaluationError({
249
367
  source,
250
368
  message: messageFromCause(cause, "CEL evaluation failed"),
@@ -254,26 +372,55 @@ const unexpectedResult = (source, expected) => () => new ExpressionEvaluationErr
254
372
  source,
255
373
  message: `CEL evaluation returned a value that is not ${expected}`,
256
374
  });
257
- const checkBoolean = Effect.fn("ExpressionEngine.checkBoolean")((source, environment) => checkExpected(source, environment, (resultType) => resultType === "bool", "bool"));
258
- const checkScalar = Effect.fn("ExpressionEngine.checkScalar")((source, environment) => checkExpected(source, environment, (resultType) => acceptedScalarTypes.has(resultType), "a scalar value"));
259
- const decodeBoolean = Schema.decodeUnknownEffect(Schema.Boolean);
375
+ const isBooleanType = (resultType) => resultType === "bool";
260
376
  const decodeScalar = Schema.decodeUnknownEffect(Scalar);
261
- const evaluateBoolean = Effect.fn("ExpressionEngine.evaluateBoolean")(function* (source, environment, context) {
262
- yield* checkBoolean(source, environment);
263
- const value = yield* evaluateRaw(source, environment, context);
264
- return yield* decodeBoolean(value).pipe(Effect.mapError(unexpectedResult(source, "a boolean")));
265
- });
266
- const evaluateScalar = Effect.fn("ExpressionEngine.evaluateScalar")(function* (source, environment, context) {
267
- yield* checkScalar(source, environment);
268
- const value = yield* evaluateRaw(source, environment, context);
269
- return yield* decodeScalar(value).pipe(Effect.mapError(unexpectedResult(source, "a scalar value")));
270
- });
271
- /** The ExpressionEngine implementation on @marcbachmann/cel-js. */
272
- export const MarcbachmannCelLayer = Layer.succeed(ExpressionEngine, {
273
- relatedStringLiterals,
274
- checkBoolean,
275
- checkScalar,
276
- evaluateBoolean,
277
- evaluateScalar,
278
- });
377
+ const makeExpressionEngine = () => {
378
+ const runtimes = celRuntimes();
379
+ const checkBoolean = Effect.fn("ExpressionEngine.checkBoolean")((source, environment) => checkExpected(runtimes, source, environment, isBooleanType, "bool"));
380
+ const checkScalar = Effect.fn("ExpressionEngine.checkScalar")((source, environment) => checkExpected(runtimes, source, environment, (resultType) => acceptedScalarTypes.has(resultType), "a scalar value"));
381
+ /** Evaluates an already checked condition on `context`. Fails if the result isn't a boolean. */
382
+ const booleanOn = (source, environment, context) => Result.flatMap(evaluated(runtimes, source, environment, context), (value) => Predicate.isBoolean(value)
383
+ ? Result.succeed(value)
384
+ : Result.fail(unexpectedResult(source, "a boolean")()));
385
+ const evaluateBoolean = Effect.fn("ExpressionEngine.evaluateBoolean")(function* (source, environment, context) {
386
+ yield* checkBoolean(source, environment);
387
+ return yield* Effect.fromResult(booleanOn(source, environment, context));
388
+ });
389
+ // One span and one check for all contexts; per-context Effects cost several times more (#464).
390
+ const evaluateBooleanEach = Effect.fn("ExpressionEngine.evaluateBooleanEach")(function* (source, environment, contexts) {
391
+ yield* Effect.annotateCurrentSpan({ contexts: contexts.length });
392
+ yield* checkBoolean(source, environment);
393
+ return contexts.map((context) => booleanOn(source, environment, context));
394
+ });
395
+ const evaluateScalar = Effect.fn("ExpressionEngine.evaluateScalar")(function* (source, environment, context) {
396
+ yield* checkScalar(source, environment);
397
+ const value = yield* Effect.fromResult(evaluated(runtimes, source, environment, context));
398
+ return yield* decodeScalar(value).pipe(Effect.mapError(unexpectedResult(source, "a scalar value")));
399
+ });
400
+ return ExpressionEngine.of({
401
+ relatedStringLiterals,
402
+ checkBoolean,
403
+ checkScalar,
404
+ evaluateBoolean,
405
+ evaluateBooleanEach,
406
+ evaluateScalar,
407
+ });
408
+ };
409
+ /**
410
+ * Provides {@link ExpressionEngine} with `@marcbachmann/cel-js` 8.0.0
411
+ * ([ADR 0004](../../../docs/adr/0004-loop-files-markdown-cel-frontmatter.md)).
412
+ *
413
+ * Expressions can use CEL optional values, such as `item.?milestone.?title.orValue("none")`. A
414
+ * nullable field that holds `null` counts as present, so `item.?milestone` holds `null` and
415
+ * `item.?milestone.?title` is empty.
416
+ *
417
+ * Before evaluation, converts JSON integers to `bigint` wherever the {@link Environment}
418
+ * declares `int`, at any depth, and sets absent nullable fields to `null`. Values inside a
419
+ * `map<K,V>` aren't converted, so declare integer map values as `double`.
420
+ *
421
+ * `uint` isn't supported in `context`; declare such values as `int`. An expression that reads a
422
+ * non-nullable `uint` value type-checks but fails evaluation. On a nullable field, comparing with a
423
+ * `uint` literal works but `uint` arithmetic fails. A `uint` result fails `evaluateScalar`.
424
+ */
425
+ export const MarcbachmannCelLayer = Layer.sync(ExpressionEngine)(makeExpressionEngine);
279
426
  //# sourceMappingURL=marcbachmann-cel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marcbachmann-cel.js","sourceRoot":"","sources":["../src/marcbachmann-cel.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,IAAI,cAAc,EAC7B,UAAU,IAAI,aAAa,EAC3B,SAAS,IAAI,YAAY,EACzB,KAAK,GACN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAqC,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,MAAM,GAEP,MAAM,wBAAwB,CAAC;AAEhC,MAAM,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;AAiBpE,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC;IACvD,MAAM;IACN,QAAQ;IACR,KAAK;IACL,WAAW;IACX,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,KAAc,EAAE,QAAgB,EAAU,EAAE,CACpE,MAAM,CAAC,KAAK,CACV,MAAM,CAAC,mBAAm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AC;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1F,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,CACpC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAC5D,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC,EAAE,CAAC;QACzB,qBAAqB;QACrB,YAAY;QACZ,WAAW;QACX,eAAe;QACf,mBAAmB;QACnB,cAAc;KACf,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,oBAAoB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usine/expression",
3
- "version": "0.2.0",
3
+ "version": "0.3.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": {
@@ -9,7 +9,8 @@
9
9
  "directory": "packages/expression"
10
10
  },
11
11
  "files": [
12
- "dist"
12
+ "dist",
13
+ "!dist/tsconfig.tsbuildinfo"
13
14
  ],
14
15
  "type": "module",
15
16
  "sideEffects": false,