@shipfox/expression 2.1.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -8
- package/dist/evaluator/evaluate-workflow-expression.d.ts +3 -4
- package/dist/evaluator/evaluate-workflow-expression.d.ts.map +1 -1
- package/dist/evaluator/evaluate-workflow-expression.js +5 -5
- package/dist/evaluator/evaluate-workflow-expression.js.map +1 -1
- package/dist/evaluator/index.d.ts +2 -0
- package/dist/evaluator/index.d.ts.map +1 -1
- package/dist/evaluator/index.js +2 -0
- package/dist/evaluator/index.js.map +1 -1
- package/dist/evaluator/range.d.ts +2 -3
- package/dist/evaluator/range.d.ts.map +1 -1
- package/dist/evaluator/range.js +4 -43
- package/dist/evaluator/range.js.map +1 -1
- package/dist/evaluator/workflow-environment.d.ts +3 -0
- package/dist/evaluator/workflow-environment.d.ts.map +1 -0
- package/dist/evaluator/workflow-environment.js +17 -0
- package/dist/evaluator/workflow-environment.js.map +1 -0
- package/dist/expression/create-workflow-expression.d.ts.map +1 -1
- package/dist/expression/create-workflow-expression.js +31 -12
- package/dist/expression/create-workflow-expression.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/json.d.ts +2 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +7 -0
- package/dist/json.js.map +1 -0
- package/dist/resolver/coerce-workflow-value-to-string.d.ts.map +1 -1
- package/dist/resolver/coerce-workflow-value-to-string.js +1 -5
- package/dist/resolver/coerce-workflow-value-to-string.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/dist/workflow-function-registry.d.ts +21 -0
- package/dist/workflow-function-registry.d.ts.map +1 -0
- package/dist/workflow-function-registry.js +133 -0
- package/dist/workflow-function-registry.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,14 +9,20 @@ CEL checks and run-time evaluation for Shipfox workflow expressions.
|
|
|
9
9
|
- **`WorkflowExpression`**: Stores the CEL tag, source, and check level.
|
|
10
10
|
- **`ExpressionTypeEnvironment`**: Lists names and field types for typed checks.
|
|
11
11
|
- **`evaluateWorkflowExpression`**: Runs a checked value against caller data.
|
|
12
|
+
- **`createWorkflowEnvironment`**: Creates an isolated evaluator with the shared
|
|
13
|
+
`range()`, `toJson()`, and `fromJson()` functions.
|
|
12
14
|
- **`evaluateWorkflowExpressionWithEnvironment`**: Runs a checked value against
|
|
13
15
|
a caller-owned CEL environment for explicitly scoped custom functions.
|
|
14
16
|
- **`WorkflowExpressionEnvironment`**: The evaluate-only environment shape
|
|
15
17
|
accepted by the scoped evaluator.
|
|
16
|
-
- **`createRangeEnvironment`**:
|
|
17
|
-
|
|
18
|
+
- **`createRangeEnvironment`**: Compatibility alias for
|
|
19
|
+
`createWorkflowEnvironment`.
|
|
18
20
|
- **`MAX_RANGE_ELEMENTS`**: The per-evaluation range materialization limit,
|
|
19
21
|
currently 1,000 values.
|
|
22
|
+
- **`MAX_RANGE_FANOUT_BYTES`**: The per-evaluation context-sized range fan-out
|
|
23
|
+
limit, currently 1,000,000 bytes.
|
|
24
|
+
- **`MAX_JSON_OUTPUT_BYTES`**: The per-evaluation `toJson()` output limit,
|
|
25
|
+
currently 1,000,000 UTF-8 bytes.
|
|
20
26
|
- **`evaluateWorkflowPredicate`**: Returns `true` only for the boolean `true`.
|
|
21
27
|
- **`classifyShellCodePosition`**: Finds named workflow bindings passed directly
|
|
22
28
|
to shell positions that re-evaluate their arguments.
|
|
@@ -86,12 +92,18 @@ const passed = evaluateWorkflowPredicate(expression, {
|
|
|
86
92
|
- Context values can include external data. Interpolatable fields rely on their
|
|
87
93
|
structural sink guarantees, while host and availability checks remain enforced.
|
|
88
94
|
- Evaluation is deterministic and has no side effects.
|
|
89
|
-
- Workflow evaluation
|
|
90
|
-
caller-owned environment when a custom function is intentionally
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
- Workflow evaluation includes the shared `range()`, `toJson()`, and `fromJson()`
|
|
96
|
+
functions. Use a caller-owned environment when a custom function is intentionally
|
|
97
|
+
needed outside that registry.
|
|
98
|
+
- `range()` accepts CEL integers and safe integer values from JavaScript
|
|
99
|
+
contexts. An environment is built once and reused, and each evaluation gets
|
|
100
|
+
its own materialization budget, shared by nested range calls and restored when
|
|
101
|
+
a context accessor re-enters the evaluator; each evaluation can materialize at
|
|
102
|
+
most 1,000 values and 1,000,000 context-byte fan-out units.
|
|
103
|
+
- `toJson()` writes integers outside the safe-integer range as quoted strings, so
|
|
104
|
+
a round trip through `fromJson()` returns them as strings rather than numbers.
|
|
105
|
+
Safe JSON numbers parsed by `fromJson()` become CEL integers, and all
|
|
106
|
+
`toJson()` output shares a 1,000,000-byte budget per evaluation.
|
|
95
107
|
- Field resolution remains string-based by default. Callers rendering config
|
|
96
108
|
objects may opt into raw values for an exact single expression with
|
|
97
109
|
`preserveSingleExpressionType: true`; mixed literal and expression fields
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Environment } from '@marcbachmann/cel-js';
|
|
2
2
|
import type { WorkflowExpression } from '../expression/workflow-expression.js';
|
|
3
3
|
export type WorkflowExpressionEvaluationContext = Readonly<Record<string, unknown>>;
|
|
4
4
|
export type WorkflowExpressionEvaluationValue = unknown;
|
|
@@ -7,9 +7,8 @@ export declare function evaluateWorkflowExpression(expression: WorkflowExpressio
|
|
|
7
7
|
/**
|
|
8
8
|
* Evaluate an expression against a caller-owned CEL environment.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* by creating and passing their own environment.
|
|
10
|
+
* The caller-owned environment can provide a narrower or broader function set
|
|
11
|
+
* when the shared workflow registry is not the right boundary.
|
|
13
12
|
*/
|
|
14
13
|
export declare function evaluateWorkflowExpressionWithEnvironment(expression: WorkflowExpression, context: WorkflowExpressionEvaluationContext, environment: WorkflowExpressionEnvironment): WorkflowExpressionEvaluationValue;
|
|
15
14
|
export declare function evaluateWorkflowPredicate(expression: WorkflowExpression, context: WorkflowExpressionEvaluationContext): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate-workflow-expression.d.ts","sourceRoot":"","sources":["../../src/evaluator/evaluate-workflow-expression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"evaluate-workflow-expression.d.ts","sourceRoot":"","sources":["../../src/evaluator/evaluate-workflow-expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sCAAsC,CAAC;AAI7E,MAAM,MAAM,mCAAmC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACpF,MAAM,MAAM,iCAAiC,GAAG,OAAO,CAAC;AACxD,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAI1E,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,mCAAmC,GAC3C,iCAAiC,CAMnC;AAED;;;;;GAKG;AACH,wBAAgB,yCAAyC,CACvD,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,mCAAmC,EAC5C,WAAW,EAAE,6BAA6B,GACzC,iCAAiC,CAMnC;AAED,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAET;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,kBAAkB,EAC9B,OAAO,EAAE,mCAAmC,GAC3C,0BAA0B,CAS5B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { evaluate } from '@marcbachmann/cel-js';
|
|
2
1
|
import { WorkflowExpressionEvaluationError } from './errors.js';
|
|
2
|
+
import { createWorkflowEnvironment } from './workflow-environment.js';
|
|
3
|
+
const workflowEnvironment = createWorkflowEnvironment();
|
|
3
4
|
export function evaluateWorkflowExpression(expression, context) {
|
|
4
5
|
try {
|
|
5
|
-
return evaluate(expression.source, context);
|
|
6
|
+
return workflowEnvironment.evaluate(expression.source, context);
|
|
6
7
|
} catch (error) {
|
|
7
8
|
throw new WorkflowExpressionEvaluationError(error);
|
|
8
9
|
}
|
|
@@ -10,9 +11,8 @@ export function evaluateWorkflowExpression(expression, context) {
|
|
|
10
11
|
/**
|
|
11
12
|
* Evaluate an expression against a caller-owned CEL environment.
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* by creating and passing their own environment.
|
|
14
|
+
* The caller-owned environment can provide a narrower or broader function set
|
|
15
|
+
* when the shared workflow registry is not the right boundary.
|
|
16
16
|
*/ export function evaluateWorkflowExpressionWithEnvironment(expression, context, environment) {
|
|
17
17
|
try {
|
|
18
18
|
return environment.evaluate(expression.source, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/evaluator/evaluate-workflow-expression.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/evaluator/evaluate-workflow-expression.ts"],"sourcesContent":["import type {Environment} from '@marcbachmann/cel-js';\nimport type {WorkflowExpression} from '../expression/workflow-expression.js';\nimport {WorkflowExpressionEvaluationError} from './errors.js';\nimport {createWorkflowEnvironment} from './workflow-environment.js';\n\nexport type WorkflowExpressionEvaluationContext = Readonly<Record<string, unknown>>;\nexport type WorkflowExpressionEvaluationValue = unknown;\nexport type WorkflowExpressionEnvironment = Pick<Environment, 'evaluate'>;\n\nconst workflowEnvironment = createWorkflowEnvironment();\n\nexport function evaluateWorkflowExpression(\n expression: WorkflowExpression,\n context: WorkflowExpressionEvaluationContext,\n): WorkflowExpressionEvaluationValue {\n try {\n return workflowEnvironment.evaluate(expression.source, context);\n } catch (error) {\n throw new WorkflowExpressionEvaluationError(error);\n }\n}\n\n/**\n * Evaluate an expression against a caller-owned CEL environment.\n *\n * The caller-owned environment can provide a narrower or broader function set\n * when the shared workflow registry is not the right boundary.\n */\nexport function evaluateWorkflowExpressionWithEnvironment(\n expression: WorkflowExpression,\n context: WorkflowExpressionEvaluationContext,\n environment: WorkflowExpressionEnvironment,\n): WorkflowExpressionEvaluationValue {\n try {\n return environment.evaluate(expression.source, context);\n } catch (error) {\n throw new WorkflowExpressionEvaluationError(error);\n }\n}\n\nexport function evaluateWorkflowPredicate(\n expression: WorkflowExpression,\n context: WorkflowExpressionEvaluationContext,\n): boolean {\n return evaluateWorkflowExpression(expression, context) === true;\n}\n\nexport interface FailClosedPredicateOutcome {\n readonly value: boolean;\n readonly evaluationFailed: boolean;\n}\n\nexport function evaluateWorkflowPredicateFailClosed(\n expression: WorkflowExpression,\n context: WorkflowExpressionEvaluationContext,\n): FailClosedPredicateOutcome {\n try {\n return {value: evaluateWorkflowPredicate(expression, context), evaluationFailed: false};\n } catch (error) {\n if (error instanceof WorkflowExpressionEvaluationError) {\n return {value: false, evaluationFailed: true};\n }\n throw error;\n }\n}\n"],"names":["WorkflowExpressionEvaluationError","createWorkflowEnvironment","workflowEnvironment","evaluateWorkflowExpression","expression","context","evaluate","source","error","evaluateWorkflowExpressionWithEnvironment","environment","evaluateWorkflowPredicate","evaluateWorkflowPredicateFailClosed","value","evaluationFailed"],"mappings":"AAEA,SAAQA,iCAAiC,QAAO,cAAc;AAC9D,SAAQC,yBAAyB,QAAO,4BAA4B;AAMpE,MAAMC,sBAAsBD;AAE5B,OAAO,SAASE,2BACdC,UAA8B,EAC9BC,OAA4C;IAE5C,IAAI;QACF,OAAOH,oBAAoBI,QAAQ,CAACF,WAAWG,MAAM,EAAEF;IACzD,EAAE,OAAOG,OAAO;QACd,MAAM,IAAIR,kCAAkCQ;IAC9C;AACF;AAEA;;;;;CAKC,GACD,OAAO,SAASC,0CACdL,UAA8B,EAC9BC,OAA4C,EAC5CK,WAA0C;IAE1C,IAAI;QACF,OAAOA,YAAYJ,QAAQ,CAACF,WAAWG,MAAM,EAAEF;IACjD,EAAE,OAAOG,OAAO;QACd,MAAM,IAAIR,kCAAkCQ;IAC9C;AACF;AAEA,OAAO,SAASG,0BACdP,UAA8B,EAC9BC,OAA4C;IAE5C,OAAOF,2BAA2BC,YAAYC,aAAa;AAC7D;AAOA,OAAO,SAASO,oCACdR,UAA8B,EAC9BC,OAA4C;IAE5C,IAAI;QACF,OAAO;YAACQ,OAAOF,0BAA0BP,YAAYC;YAAUS,kBAAkB;QAAK;IACxF,EAAE,OAAON,OAAO;QACd,IAAIA,iBAAiBR,mCAAmC;YACtD,OAAO;gBAACa,OAAO;gBAAOC,kBAAkB;YAAI;QAC9C;QACA,MAAMN;IACR;AACF"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export { MAX_JSON_OUTPUT_BYTES, MAX_RANGE_FANOUT_BYTES } from '../workflow-function-registry.js';
|
|
1
2
|
export { WorkflowExpressionEvaluationError, type WorkflowExpressionEvaluationFailureReason, workflowExpressionEvaluationErrorCode, } from './errors.js';
|
|
2
3
|
export { evaluateWorkflowExpression, evaluateWorkflowExpressionWithEnvironment, evaluateWorkflowPredicate, evaluateWorkflowPredicateFailClosed, type FailClosedPredicateOutcome, type WorkflowExpressionEnvironment, type WorkflowExpressionEvaluationContext, type WorkflowExpressionEvaluationValue, } from './evaluate-workflow-expression.js';
|
|
3
4
|
export { createRangeEnvironment, MAX_RANGE_ELEMENTS } from './range.js';
|
|
4
5
|
export { rehydrateJsonExpressionRecord, rehydrateJsonExpressionValue, } from './rehydrate-json-expression.js';
|
|
6
|
+
export { createWorkflowEnvironment } from './workflow-environment.js';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evaluator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,KAAK,yCAAyC,EAC9C,qCAAqC,GACtC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,yCAAyC,EACzC,yBAAyB,EACzB,mCAAmC,EACnC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evaluator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,sBAAsB,EAAC,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EACL,iCAAiC,EACjC,KAAK,yCAAyC,EAC9C,qCAAqC,GACtC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,yCAAyC,EACzC,yBAAyB,EACzB,mCAAmC,EACnC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC"}
|
package/dist/evaluator/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
export { MAX_JSON_OUTPUT_BYTES, MAX_RANGE_FANOUT_BYTES } from '../workflow-function-registry.js';
|
|
1
2
|
export { WorkflowExpressionEvaluationError, workflowExpressionEvaluationErrorCode } from './errors.js';
|
|
2
3
|
export { evaluateWorkflowExpression, evaluateWorkflowExpressionWithEnvironment, evaluateWorkflowPredicate, evaluateWorkflowPredicateFailClosed } from './evaluate-workflow-expression.js';
|
|
3
4
|
export { createRangeEnvironment, MAX_RANGE_ELEMENTS } from './range.js';
|
|
4
5
|
export { rehydrateJsonExpressionRecord, rehydrateJsonExpressionValue } from './rehydrate-json-expression.js';
|
|
6
|
+
export { createWorkflowEnvironment } from './workflow-environment.js';
|
|
5
7
|
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/evaluator/index.ts"],"sourcesContent":["export {\n WorkflowExpressionEvaluationError,\n type WorkflowExpressionEvaluationFailureReason,\n workflowExpressionEvaluationErrorCode,\n} from './errors.js';\nexport {\n evaluateWorkflowExpression,\n evaluateWorkflowExpressionWithEnvironment,\n evaluateWorkflowPredicate,\n evaluateWorkflowPredicateFailClosed,\n type FailClosedPredicateOutcome,\n type WorkflowExpressionEnvironment,\n type WorkflowExpressionEvaluationContext,\n type WorkflowExpressionEvaluationValue,\n} from './evaluate-workflow-expression.js';\nexport {createRangeEnvironment, MAX_RANGE_ELEMENTS} from './range.js';\nexport {\n rehydrateJsonExpressionRecord,\n rehydrateJsonExpressionValue,\n} from './rehydrate-json-expression.js';\n"],"names":["WorkflowExpressionEvaluationError","workflowExpressionEvaluationErrorCode","evaluateWorkflowExpression","evaluateWorkflowExpressionWithEnvironment","evaluateWorkflowPredicate","evaluateWorkflowPredicateFailClosed","createRangeEnvironment","MAX_RANGE_ELEMENTS","rehydrateJsonExpressionRecord","rehydrateJsonExpressionValue"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["../../src/evaluator/index.ts"],"sourcesContent":["export {MAX_JSON_OUTPUT_BYTES, MAX_RANGE_FANOUT_BYTES} from '../workflow-function-registry.js';\nexport {\n WorkflowExpressionEvaluationError,\n type WorkflowExpressionEvaluationFailureReason,\n workflowExpressionEvaluationErrorCode,\n} from './errors.js';\nexport {\n evaluateWorkflowExpression,\n evaluateWorkflowExpressionWithEnvironment,\n evaluateWorkflowPredicate,\n evaluateWorkflowPredicateFailClosed,\n type FailClosedPredicateOutcome,\n type WorkflowExpressionEnvironment,\n type WorkflowExpressionEvaluationContext,\n type WorkflowExpressionEvaluationValue,\n} from './evaluate-workflow-expression.js';\nexport {createRangeEnvironment, MAX_RANGE_ELEMENTS} from './range.js';\nexport {\n rehydrateJsonExpressionRecord,\n rehydrateJsonExpressionValue,\n} from './rehydrate-json-expression.js';\nexport {createWorkflowEnvironment} from './workflow-environment.js';\n"],"names":["MAX_JSON_OUTPUT_BYTES","MAX_RANGE_FANOUT_BYTES","WorkflowExpressionEvaluationError","workflowExpressionEvaluationErrorCode","evaluateWorkflowExpression","evaluateWorkflowExpressionWithEnvironment","evaluateWorkflowPredicate","evaluateWorkflowPredicateFailClosed","createRangeEnvironment","MAX_RANGE_ELEMENTS","rehydrateJsonExpressionRecord","rehydrateJsonExpressionValue","createWorkflowEnvironment"],"mappings":"AAAA,SAAQA,qBAAqB,EAAEC,sBAAsB,QAAO,mCAAmC;AAC/F,SACEC,iCAAiC,EAEjCC,qCAAqC,QAChC,cAAc;AACrB,SACEC,0BAA0B,EAC1BC,yCAAyC,EACzCC,yBAAyB,EACzBC,mCAAmC,QAK9B,oCAAoC;AAC3C,SAAQC,sBAAsB,EAAEC,kBAAkB,QAAO,aAAa;AACtE,SACEC,6BAA6B,EAC7BC,4BAA4B,QACvB,iCAAiC;AACxC,SAAQC,yBAAyB,QAAO,4BAA4B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { WorkflowExpressionEnvironment } from './evaluate-workflow-expression.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** Create the opt-in range evaluator for config templating. */
|
|
2
|
+
export { MAX_RANGE_ELEMENTS } from '../workflow-function-registry.js';
|
|
3
|
+
/** Create a workflow evaluator with the shared CEL function registry. */
|
|
5
4
|
export declare function createRangeEnvironment(): WorkflowExpressionEnvironment;
|
|
6
5
|
//# sourceMappingURL=range.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/evaluator/range.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/evaluator/range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,mCAAmC,CAAC;AAGrF,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAEpE,yEAAyE;AACzE,wBAAgB,sBAAsB,IAAI,6BAA6B,CAEtE"}
|
package/dist/evaluator/range.js
CHANGED
|
@@ -1,46 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const values = [];
|
|
6
|
-
for(let value = start; value <= stop; value += step)values.push(value);
|
|
7
|
-
return values;
|
|
8
|
-
}
|
|
9
|
-
function rangeElementCount(start, stop, step) {
|
|
10
|
-
if (step <= 0n) throw new RangeError('range step must be positive');
|
|
11
|
-
if (start > stop) return 0n;
|
|
12
|
-
return (stop - start) / step + 1n;
|
|
13
|
-
}
|
|
14
|
-
function toCelInteger(value, name) {
|
|
15
|
-
if (typeof value === 'bigint') return value;
|
|
16
|
-
if (typeof value === 'number' && Number.isSafeInteger(value)) return BigInt(value);
|
|
17
|
-
throw new RangeError(`${name} must be a safe integer`);
|
|
18
|
-
}
|
|
19
|
-
function evaluateRange(budget, start, stop, step) {
|
|
20
|
-
const startValue = toCelInteger(start, 'range start');
|
|
21
|
-
const stopValue = toCelInteger(stop, 'range stop');
|
|
22
|
-
const stepValue = toCelInteger(step, 'range step');
|
|
23
|
-
const count = rangeElementCount(startValue, stopValue, stepValue);
|
|
24
|
-
if (count > BigInt(budget.remaining)) {
|
|
25
|
-
throw new RangeError(`range evaluation budget exceeded; ${count} elements requested with ${budget.remaining} remaining`);
|
|
26
|
-
}
|
|
27
|
-
const values = materializeRange(startValue, stopValue, stepValue);
|
|
28
|
-
budget.remaining -= values.length;
|
|
29
|
-
return values;
|
|
30
|
-
}
|
|
31
|
-
/** Create the opt-in range evaluator for config templating. */ export function createRangeEnvironment() {
|
|
32
|
-
return {
|
|
33
|
-
evaluate (expression, context) {
|
|
34
|
-
const budget = {
|
|
35
|
-
remaining: MAX_RANGE_ELEMENTS
|
|
36
|
-
};
|
|
37
|
-
const environment = new Environment({
|
|
38
|
-
unlistedVariablesAreDyn: true
|
|
39
|
-
});
|
|
40
|
-
environment.registerFunction(RANGE_FUNCTION_SIGNATURE, (start, stop, step)=>evaluateRange(budget, start, stop, step));
|
|
41
|
-
return environment.evaluate(expression, context);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
1
|
+
import { createWorkflowEnvironment } from './workflow-environment.js';
|
|
2
|
+
export { MAX_RANGE_ELEMENTS } from '../workflow-function-registry.js';
|
|
3
|
+
/** Create a workflow evaluator with the shared CEL function registry. */ export function createRangeEnvironment() {
|
|
4
|
+
return createWorkflowEnvironment();
|
|
44
5
|
}
|
|
45
6
|
|
|
46
7
|
//# sourceMappingURL=range.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/evaluator/range.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/evaluator/range.ts"],"sourcesContent":["import type {WorkflowExpressionEnvironment} from './evaluate-workflow-expression.js';\nimport {createWorkflowEnvironment} from './workflow-environment.js';\n\nexport {MAX_RANGE_ELEMENTS} from '../workflow-function-registry.js';\n\n/** Create a workflow evaluator with the shared CEL function registry. */\nexport function createRangeEnvironment(): WorkflowExpressionEnvironment {\n return createWorkflowEnvironment();\n}\n"],"names":["createWorkflowEnvironment","MAX_RANGE_ELEMENTS","createRangeEnvironment"],"mappings":"AACA,SAAQA,yBAAyB,QAAO,4BAA4B;AAEpE,SAAQC,kBAAkB,QAAO,mCAAmC;AAEpE,uEAAuE,GACvE,OAAO,SAASC;IACd,OAAOF;AACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-environment.d.ts","sourceRoot":"","sources":["../../src/evaluator/workflow-environment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,6BAA6B,EAAC,MAAM,mCAAmC,CAAC;AAErF,wBAAgB,yBAAyB,IAAI,6BAA6B,CAWzE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Environment } from '@marcbachmann/cel-js';
|
|
2
|
+
import { registerWorkflowFunctions } from '../workflow-function-registry.js';
|
|
3
|
+
export function createWorkflowEnvironment() {
|
|
4
|
+
// Building the CEL environment once and resetting the budget keeps the
|
|
5
|
+
// per-evaluation materialization limit while avoiding a rebuild per call.
|
|
6
|
+
const environment = new Environment({
|
|
7
|
+
unlistedVariablesAreDyn: true
|
|
8
|
+
});
|
|
9
|
+
const budgets = registerWorkflowFunctions(environment);
|
|
10
|
+
return {
|
|
11
|
+
evaluate (expression, context) {
|
|
12
|
+
return budgets.isolate(context, ()=>environment.evaluate(expression, context));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=workflow-environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/evaluator/workflow-environment.ts"],"sourcesContent":["import {type Context, Environment} from '@marcbachmann/cel-js';\nimport {registerWorkflowFunctions} from '../workflow-function-registry.js';\nimport type {WorkflowExpressionEnvironment} from './evaluate-workflow-expression.js';\n\nexport function createWorkflowEnvironment(): WorkflowExpressionEnvironment {\n // Building the CEL environment once and resetting the budget keeps the\n // per-evaluation materialization limit while avoiding a rebuild per call.\n const environment = new Environment({unlistedVariablesAreDyn: true});\n const budgets = registerWorkflowFunctions(environment);\n\n return {\n evaluate(expression: string, context?: Context) {\n return budgets.isolate(context, () => environment.evaluate(expression, context));\n },\n };\n}\n"],"names":["Environment","registerWorkflowFunctions","createWorkflowEnvironment","environment","unlistedVariablesAreDyn","budgets","evaluate","expression","context","isolate"],"mappings":"AAAA,SAAsBA,WAAW,QAAO,uBAAuB;AAC/D,SAAQC,yBAAyB,QAAO,mCAAmC;AAG3E,OAAO,SAASC;IACd,uEAAuE;IACvE,0EAA0E;IAC1E,MAAMC,cAAc,IAAIH,YAAY;QAACI,yBAAyB;IAAI;IAClE,MAAMC,UAAUJ,0BAA0BE;IAE1C,OAAO;QACLG,UAASC,UAAkB,EAAEC,OAAiB;YAC5C,OAAOH,QAAQI,OAAO,CAACD,SAAS,IAAML,YAAYG,QAAQ,CAACC,YAAYC;QACzE;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-workflow-expression.d.ts","sourceRoot":"","sources":["../../src/expression/create-workflow-expression.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-workflow-expression.d.ts","sourceRoot":"","sources":["../../src/expression/create-workflow-expression.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,8BAA8B,EAK9B,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAiBlC,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,8BAA8B,GACrC,kBAAkB,CAmDpB;AA2CD,wBAAgB,kCAAkC,CAAC,MAAM,EAAE;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;CACpC,GAAG,kBAAkB,CAOrB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Environment, parse as parseCel } from '@marcbachmann/cel-js';
|
|
2
|
+
import { registerWorkflowFunctions } from '../workflow-function-registry.js';
|
|
2
3
|
import { InvalidWorkflowExpressionError } from './errors.js';
|
|
3
4
|
const scalarTypeToCelType = {
|
|
4
5
|
string: 'string',
|
|
@@ -18,14 +19,7 @@ export function createWorkflowExpression(params) {
|
|
|
18
19
|
reason: 'Expression source must not be empty.'
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
parseCel(source);
|
|
23
|
-
} catch (error) {
|
|
24
|
-
throw new InvalidWorkflowExpressionError({
|
|
25
|
-
source,
|
|
26
|
-
reason: error instanceof Error ? error.message : 'Expression source could not be parsed.'
|
|
27
|
-
});
|
|
28
|
-
}
|
|
22
|
+
const ast = parseWorkflowExpression(source);
|
|
29
23
|
if (params.check.mode === 'typed') {
|
|
30
24
|
const environment = createTypeCheckingEnvironment();
|
|
31
25
|
for (const [name, type] of Object.entries(params.check.typeEnvironment ?? {})){
|
|
@@ -46,13 +40,13 @@ export function createWorkflowExpression(params) {
|
|
|
46
40
|
reason: typeCheckResult.error?.message ?? 'Expression source did not type-check.'
|
|
47
41
|
});
|
|
48
42
|
}
|
|
49
|
-
if (params.check.expectedResultType !== undefined && typeCheckResult.type !== scalarTypeToCelType[params.check.expectedResultType]) {
|
|
43
|
+
if (params.check.expectedResultType !== undefined && typeCheckResult.type !== scalarTypeToCelType[params.check.expectedResultType] && !(typeCheckResult.type === 'dyn' && containsFromJsonCall(ast))) {
|
|
50
44
|
throw new InvalidWorkflowExpressionError({
|
|
51
45
|
source,
|
|
52
46
|
reason: `Expression source must return ${scalarTypeToCelType[params.check.expectedResultType]}; got ${typeCheckResult.type ?? 'unknown'}.`
|
|
53
47
|
});
|
|
54
48
|
}
|
|
55
|
-
resultType = resolveKnownPathType(source, params.check.typeEnvironment) ?? fromCelType(typeCheckResult.type);
|
|
49
|
+
resultType = resolveKnownPathType(source, params.check.typeEnvironment) ?? fromCelType(typeCheckResult.type, ast);
|
|
56
50
|
}
|
|
57
51
|
return {
|
|
58
52
|
language: 'cel',
|
|
@@ -83,6 +77,7 @@ function createTypeCheckingEnvironment() {
|
|
|
83
77
|
const environment = new Environment({
|
|
84
78
|
unlistedVariablesAreDyn: false
|
|
85
79
|
});
|
|
80
|
+
registerWorkflowFunctions(environment);
|
|
86
81
|
// CEL evaluates numeric equality across types, but its static checker normally
|
|
87
82
|
// rejects the same expression. Match validation to the runtime contract.
|
|
88
83
|
environment.registerOperator('double == int', (left, right)=>{
|
|
@@ -147,7 +142,7 @@ function toCelListElementType(type, environment, variableName) {
|
|
|
147
142
|
}
|
|
148
143
|
return 'dyn';
|
|
149
144
|
}
|
|
150
|
-
function fromCelType(type) {
|
|
145
|
+
function fromCelType(type, ast) {
|
|
151
146
|
if (type === undefined) return undefined;
|
|
152
147
|
switch(type){
|
|
153
148
|
case 'string':
|
|
@@ -167,7 +162,8 @@ function fromCelType(type) {
|
|
|
167
162
|
kind: 'map'
|
|
168
163
|
};
|
|
169
164
|
case 'dyn':
|
|
170
|
-
|
|
165
|
+
// Preserve legacy string fallback for open-map lookups; JSON values stay unknown.
|
|
166
|
+
return containsFromJsonCall(ast) ? undefined : 'string';
|
|
171
167
|
default:
|
|
172
168
|
// cel-js currently exposes custom/list element result types as opaque strings.
|
|
173
169
|
// Keep the outer list shape when present, but erase element detail rather than
|
|
@@ -183,5 +179,28 @@ function fromCelType(type) {
|
|
|
183
179
|
};
|
|
184
180
|
}
|
|
185
181
|
}
|
|
182
|
+
function parseWorkflowExpression(source) {
|
|
183
|
+
try {
|
|
184
|
+
return parseCel(source).ast;
|
|
185
|
+
} catch (error) {
|
|
186
|
+
throw new InvalidWorkflowExpressionError({
|
|
187
|
+
source,
|
|
188
|
+
reason: error instanceof Error ? error.message : 'Expression source could not be parsed.'
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function containsFromJsonCall(node) {
|
|
193
|
+
if ((node.op === 'call' || node.op === 'rcall') && node.args[0] === 'fromJson') {
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
return containsFromJsonValue(node.args);
|
|
197
|
+
}
|
|
198
|
+
function containsFromJsonValue(value) {
|
|
199
|
+
if (Array.isArray(value)) return value.some(containsFromJsonValue);
|
|
200
|
+
if (typeof value !== 'object' || value === null) return false;
|
|
201
|
+
const candidate = value;
|
|
202
|
+
if (candidate.args === undefined || candidate.op === undefined) return false;
|
|
203
|
+
return containsFromJsonCall(candidate);
|
|
204
|
+
}
|
|
186
205
|
|
|
187
206
|
//# sourceMappingURL=create-workflow-expression.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/expression/create-workflow-expression.ts"],"sourcesContent":["import {Environment, parse as parseCel} from '@marcbachmann/cel-js';\nimport {InvalidWorkflowExpressionError} from './errors.js';\nimport type {\n CreateWorkflowExpressionParams,\n ExpressionScalarType,\n ExpressionType,\n ExpressionTypeEnvironment,\n ValidCelExpression,\n WorkflowExpression,\n} from './workflow-expression.js';\n\nconst scalarTypeToCelType = {\n string: 'string',\n int: 'int',\n double: 'double',\n bool: 'bool',\n null: 'null',\n timestamp: 'google.protobuf.Timestamp',\n} satisfies Record<ExpressionScalarType, string>;\n\ntype CelSchema = {\n [field: string]: string | CelSchema;\n};\n\nconst directPathPattern = /^[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*$/;\n\nexport function createWorkflowExpression(\n params: CreateWorkflowExpressionParams,\n): WorkflowExpression {\n const source = params.source.trim();\n let resultType: ExpressionType | undefined;\n if (source.length === 0) {\n throw new InvalidWorkflowExpressionError({\n source: params.source,\n reason: 'Expression source must not be empty.',\n });\n }\n\n try {\n parseCel(source);\n } catch (error) {\n throw new InvalidWorkflowExpressionError({\n source,\n reason: error instanceof Error ? error.message : 'Expression source could not be parsed.',\n });\n }\n\n if (params.check.mode === 'typed') {\n const environment = createTypeCheckingEnvironment();\n for (const [name, type] of Object.entries(params.check.typeEnvironment ?? {})) {\n const celType = toCelType(type, environment, name);\n if (typeof celType === 'string') {\n environment.registerVariable(name, celType);\n } else {\n environment.registerVariable({name, schema: celType.schema});\n }\n }\n\n const typeCheckResult = environment.check(source);\n if (!typeCheckResult.valid) {\n throw new InvalidWorkflowExpressionError({\n source,\n reason: typeCheckResult.error?.message ?? 'Expression source did not type-check.',\n });\n }\n if (\n params.check.expectedResultType !== undefined &&\n typeCheckResult.type !== scalarTypeToCelType[params.check.expectedResultType]\n ) {\n throw new InvalidWorkflowExpressionError({\n source,\n reason: `Expression source must return ${scalarTypeToCelType[params.check.expectedResultType]}; got ${typeCheckResult.type ?? 'unknown'}.`,\n });\n }\n resultType =\n resolveKnownPathType(source, params.check.typeEnvironment) ??\n fromCelType(typeCheckResult.type);\n }\n\n return {\n language: 'cel',\n source: source as ValidCelExpression,\n check: params.check.mode,\n ...(resultType === undefined ? {} : {resultType}),\n };\n}\n\nfunction resolveKnownPathType(\n source: string,\n typeEnvironment: ExpressionTypeEnvironment | undefined,\n): ExpressionType | undefined {\n // cel-js erases list element detail from custom result type strings, so recover\n // known direct paths before falling back to its lossy result type conversion.\n if (typeEnvironment === undefined || !directPathPattern.test(source)) {\n return undefined;\n }\n\n const [root, ...path] = source.split('.');\n let current = root === undefined ? undefined : typeEnvironment[root];\n for (const segment of path) {\n if (current === undefined || typeof current === 'string' || current.kind !== 'object') {\n return undefined;\n }\n current = current.fields[segment];\n }\n\n return current;\n}\n\nfunction createTypeCheckingEnvironment(): Environment {\n const environment = new Environment({unlistedVariablesAreDyn: false});\n\n // CEL evaluates numeric equality across types, but its static checker normally\n // rejects the same expression. Match validation to the runtime contract.\n environment.registerOperator('double == int', (left: number, right: bigint) => {\n return Number.isInteger(left) && BigInt(left) === right;\n });\n\n // Typed context fields may be absent at runtime while still exposing their\n // known shape when present. CEL's built-in equality overloads do not allow a\n // declared object type to compare with null, so keep null checks aligned with\n // the runtime context contract.\n environment.registerOperator('dyn != null', (left: unknown, right: null) => left !== right);\n\n return environment;\n}\n\nexport function unsafeWorkflowExpressionFromSource(params: {\n source: string;\n check: WorkflowExpression['check'];\n}): WorkflowExpression {\n // Use only when rehydrating a source that was already validated before storage.\n return {\n language: 'cel',\n source: params.source as ValidCelExpression,\n check: params.check,\n };\n}\n\nfunction toCelType(\n type: ExpressionType,\n environment: Environment,\n variableName: string,\n): string | {schema: CelSchema} {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'list') {\n return `list<${toCelListElementType(type.element, environment, variableName)}>`;\n }\n if (type.kind === 'map') return 'map';\n\n return {\n schema: Object.fromEntries(\n Object.entries(type.fields).map(([name, field]) => [name, toCelSchemaType(field)]),\n ),\n };\n}\n\nfunction toCelSchemaType(type: ExpressionType): string | CelSchema {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'list') return `list<${toCelSchemaListElementType(type.element)}>`;\n if (type.kind === 'map') return 'map';\n return Object.fromEntries(\n Object.entries(type.fields).map(([name, field]) => [name, toCelSchemaType(field)]),\n );\n}\n\nfunction toCelSchemaListElementType(type: ExpressionType): string {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'map') return 'map';\n if (type.kind === 'object') return 'dyn';\n return `list<${toCelSchemaListElementType(type.element)}>`;\n}\n\nfunction toCelListElementType(\n type: ExpressionType,\n environment: Environment,\n variableName: string,\n): string {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'map') return 'map';\n if (type.kind === 'object') {\n const typeName = `$${variableName}.item`;\n environment.registerType({\n name: typeName,\n schema: Object.fromEntries(\n Object.entries(type.fields).map(([name, field]) => [name, toCelSchemaType(field)]),\n ),\n });\n return typeName;\n }\n return 'dyn';\n}\n\nfunction fromCelType(type: string | undefined): ExpressionType | undefined {\n if (type === undefined) return undefined;\n\n switch (type) {\n case 'string':\n return 'string';\n case 'int':\n return 'int';\n case 'double':\n return 'double';\n case 'bool':\n return 'bool';\n case 'null':\n return 'null';\n case 'google.protobuf.Timestamp':\n return 'timestamp';\n case 'map':\n return {kind: 'map'};\n case 'dyn':\n return 'string';\n default:\n // cel-js currently exposes custom/list element result types as opaque strings.\n // Keep the outer list shape when present, but erase element detail rather than\n // pretending we can round-trip the original schema.\n if (type.startsWith('list<')) return {kind: 'list', element: {kind: 'map'}};\n return {kind: 'map'};\n }\n}\n"],"names":["Environment","parse","parseCel","InvalidWorkflowExpressionError","scalarTypeToCelType","string","int","double","bool","null","timestamp","directPathPattern","createWorkflowExpression","params","source","trim","resultType","length","reason","error","Error","message","check","mode","environment","createTypeCheckingEnvironment","name","type","Object","entries","typeEnvironment","celType","toCelType","registerVariable","schema","typeCheckResult","valid","expectedResultType","undefined","resolveKnownPathType","fromCelType","language","test","root","path","split","current","segment","kind","fields","unlistedVariablesAreDyn","registerOperator","left","right","Number","isInteger","BigInt","unsafeWorkflowExpressionFromSource","variableName","toCelListElementType","element","fromEntries","map","field","toCelSchemaType","toCelSchemaListElementType","typeName","registerType","startsWith"],"mappings":"AAAA,SAAQA,WAAW,EAAEC,SAASC,QAAQ,QAAO,uBAAuB;AACpE,SAAQC,8BAA8B,QAAO,cAAc;AAU3D,MAAMC,sBAAsB;IAC1BC,QAAQ;IACRC,KAAK;IACLC,QAAQ;IACRC,MAAM;IACNC,MAAM;IACNC,WAAW;AACb;AAMA,MAAMC,oBAAoB;AAE1B,OAAO,SAASC,yBACdC,MAAsC;IAEtC,MAAMC,SAASD,OAAOC,MAAM,CAACC,IAAI;IACjC,IAAIC;IACJ,IAAIF,OAAOG,MAAM,KAAK,GAAG;QACvB,MAAM,IAAId,+BAA+B;YACvCW,QAAQD,OAAOC,MAAM;YACrBI,QAAQ;QACV;IACF;IAEA,IAAI;QACFhB,SAASY;IACX,EAAE,OAAOK,OAAO;QACd,MAAM,IAAIhB,+BAA+B;YACvCW;YACAI,QAAQC,iBAAiBC,QAAQD,MAAME,OAAO,GAAG;QACnD;IACF;IAEA,IAAIR,OAAOS,KAAK,CAACC,IAAI,KAAK,SAAS;QACjC,MAAMC,cAAcC;QACpB,KAAK,MAAM,CAACC,MAAMC,KAAK,IAAIC,OAAOC,OAAO,CAAChB,OAAOS,KAAK,CAACQ,eAAe,IAAI,CAAC,GAAI;YAC7E,MAAMC,UAAUC,UAAUL,MAAMH,aAAaE;YAC7C,IAAI,OAAOK,YAAY,UAAU;gBAC/BP,YAAYS,gB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O;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;gBAACqB,MAAM;YAAK;QACrB,KAAK;YACH,OAAO;QACT;YACE,+EAA+E;YAC/E,+EAA+E;YAC/E,oDAAoD;YACpD,IAAIrB,KAAKyC,UAAU,CAAC,UAAU,OAAO;gBAACpB,MAAM;gBAAQY,SAAS;oBAACZ,MAAM;gBAAK;YAAC;YAC1E,OAAO;gBAACA,MAAM;YAAK;IACvB;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/expression/create-workflow-expression.ts"],"sourcesContent":["import {type ASTNode, Environment, parse as parseCel} from '@marcbachmann/cel-js';\nimport {registerWorkflowFunctions} from '../workflow-function-registry.js';\nimport {InvalidWorkflowExpressionError} from './errors.js';\nimport type {\n CreateWorkflowExpressionParams,\n ExpressionScalarType,\n ExpressionType,\n ExpressionTypeEnvironment,\n ValidCelExpression,\n WorkflowExpression,\n} from './workflow-expression.js';\n\nconst scalarTypeToCelType = {\n string: 'string',\n int: 'int',\n double: 'double',\n bool: 'bool',\n null: 'null',\n timestamp: 'google.protobuf.Timestamp',\n} satisfies Record<ExpressionScalarType, string>;\n\ntype CelSchema = {\n [field: string]: string | CelSchema;\n};\n\nconst directPathPattern = /^[A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*$/;\n\nexport function createWorkflowExpression(\n params: CreateWorkflowExpressionParams,\n): WorkflowExpression {\n const source = params.source.trim();\n let resultType: ExpressionType | undefined;\n if (source.length === 0) {\n throw new InvalidWorkflowExpressionError({\n source: params.source,\n reason: 'Expression source must not be empty.',\n });\n }\n\n const ast = parseWorkflowExpression(source);\n\n if (params.check.mode === 'typed') {\n const environment = createTypeCheckingEnvironment();\n for (const [name, type] of Object.entries(params.check.typeEnvironment ?? {})) {\n const celType = toCelType(type, environment, name);\n if (typeof celType === 'string') {\n environment.registerVariable(name, celType);\n } else {\n environment.registerVariable({name, schema: celType.schema});\n }\n }\n\n const typeCheckResult = environment.check(source);\n if (!typeCheckResult.valid) {\n throw new InvalidWorkflowExpressionError({\n source,\n reason: typeCheckResult.error?.message ?? 'Expression source did not type-check.',\n });\n }\n if (\n params.check.expectedResultType !== undefined &&\n typeCheckResult.type !== scalarTypeToCelType[params.check.expectedResultType] &&\n !(typeCheckResult.type === 'dyn' && containsFromJsonCall(ast))\n ) {\n throw new InvalidWorkflowExpressionError({\n source,\n reason: `Expression source must return ${scalarTypeToCelType[params.check.expectedResultType]}; got ${typeCheckResult.type ?? 'unknown'}.`,\n });\n }\n resultType =\n resolveKnownPathType(source, params.check.typeEnvironment) ??\n fromCelType(typeCheckResult.type, ast);\n }\n\n return {\n language: 'cel',\n source: source as ValidCelExpression,\n check: params.check.mode,\n ...(resultType === undefined ? {} : {resultType}),\n };\n}\n\nfunction resolveKnownPathType(\n source: string,\n typeEnvironment: ExpressionTypeEnvironment | undefined,\n): ExpressionType | undefined {\n // cel-js erases list element detail from custom result type strings, so recover\n // known direct paths before falling back to its lossy result type conversion.\n if (typeEnvironment === undefined || !directPathPattern.test(source)) {\n return undefined;\n }\n\n const [root, ...path] = source.split('.');\n let current = root === undefined ? undefined : typeEnvironment[root];\n for (const segment of path) {\n if (current === undefined || typeof current === 'string' || current.kind !== 'object') {\n return undefined;\n }\n current = current.fields[segment];\n }\n\n return current;\n}\n\nfunction createTypeCheckingEnvironment(): Environment {\n const environment = new Environment({unlistedVariablesAreDyn: false});\n registerWorkflowFunctions(environment);\n\n // CEL evaluates numeric equality across types, but its static checker normally\n // rejects the same expression. Match validation to the runtime contract.\n environment.registerOperator('double == int', (left: number, right: bigint) => {\n return Number.isInteger(left) && BigInt(left) === right;\n });\n\n // Typed context fields may be absent at runtime while still exposing their\n // known shape when present. CEL's built-in equality overloads do not allow a\n // declared object type to compare with null, so keep null checks aligned with\n // the runtime context contract.\n environment.registerOperator('dyn != null', (left: unknown, right: null) => left !== right);\n\n return environment;\n}\n\nexport function unsafeWorkflowExpressionFromSource(params: {\n source: string;\n check: WorkflowExpression['check'];\n}): WorkflowExpression {\n // Use only when rehydrating a source that was already validated before storage.\n return {\n language: 'cel',\n source: params.source as ValidCelExpression,\n check: params.check,\n };\n}\n\nfunction toCelType(\n type: ExpressionType,\n environment: Environment,\n variableName: string,\n): string | {schema: CelSchema} {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'list') {\n return `list<${toCelListElementType(type.element, environment, variableName)}>`;\n }\n if (type.kind === 'map') return 'map';\n\n return {\n schema: Object.fromEntries(\n Object.entries(type.fields).map(([name, field]) => [name, toCelSchemaType(field)]),\n ),\n };\n}\n\nfunction toCelSchemaType(type: ExpressionType): string | CelSchema {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'list') return `list<${toCelSchemaListElementType(type.element)}>`;\n if (type.kind === 'map') return 'map';\n return Object.fromEntries(\n Object.entries(type.fields).map(([name, field]) => [name, toCelSchemaType(field)]),\n );\n}\n\nfunction toCelSchemaListElementType(type: ExpressionType): string {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'map') return 'map';\n if (type.kind === 'object') return 'dyn';\n return `list<${toCelSchemaListElementType(type.element)}>`;\n}\n\nfunction toCelListElementType(\n type: ExpressionType,\n environment: Environment,\n variableName: string,\n): string {\n if (typeof type === 'string') return scalarTypeToCelType[type];\n if (type.kind === 'map') return 'map';\n if (type.kind === 'object') {\n const typeName = `$${variableName}.item`;\n environment.registerType({\n name: typeName,\n schema: Object.fromEntries(\n Object.entries(type.fields).map(([name, field]) => [name, toCelSchemaType(field)]),\n ),\n });\n return typeName;\n }\n return 'dyn';\n}\n\nfunction fromCelType(type: string | undefined, ast: ASTNode): ExpressionType | undefined {\n if (type === undefined) return undefined;\n\n switch (type) {\n case 'string':\n return 'string';\n case 'int':\n return 'int';\n case 'double':\n return 'double';\n case 'bool':\n return 'bool';\n case 'null':\n return 'null';\n case 'google.protobuf.Timestamp':\n return 'timestamp';\n case 'map':\n return {kind: 'map'};\n case 'dyn':\n // Preserve legacy string fallback for open-map lookups; JSON values stay unknown.\n return containsFromJsonCall(ast) ? undefined : 'string';\n default:\n // cel-js currently exposes custom/list element result types as opaque strings.\n // Keep the outer list shape when present, but erase element detail rather than\n // pretending we can round-trip the original schema.\n if (type.startsWith('list<')) return {kind: 'list', element: {kind: 'map'}};\n return {kind: 'map'};\n }\n}\n\nfunction parseWorkflowExpression(source: string): ASTNode {\n try {\n return parseCel(source).ast;\n } catch (error) {\n throw new InvalidWorkflowExpressionError({\n source,\n reason: error instanceof Error ? error.message : 'Expression source could not be parsed.',\n });\n }\n}\n\nfunction containsFromJsonCall(node: ASTNode): boolean {\n if ((node.op === 'call' || node.op === 'rcall') && node.args[0] === 'fromJson') {\n return true;\n }\n\n return containsFromJsonValue(node.args);\n}\n\nfunction containsFromJsonValue(value: unknown): boolean {\n if (Array.isArray(value)) return value.some(containsFromJsonValue);\n if (typeof value !== 'object' || value === null) return false;\n\n const candidate = value as {readonly args?: unknown; readonly op?: unknown};\n if (candidate.args === undefined || candidate.op === undefined) return false;\n\n return containsFromJsonCall(candidate as ASTNode);\n}\n"],"names":["Environment","parse","parseCel","registerWorkflowFunctions","InvalidWorkflowExpressionError","scalarTypeToCelType","string","int","double","bool","null","timestamp","directPathPattern","createWorkflowExpression","params","source","trim","resultType","length","reason","ast","parseWorkflowExpression","check","mode","environment","createTypeCheckingEnvironment","name","type","Object","entries","typeEnvironment","celType","toCelType","registerVariable","schema","typeCheckResult","valid","error","message","expectedResultType","undefined","containsFromJsonCall","resolveKnownPathType","fromCelType","language","test","root","path","split","current","segment","kind","fields","unlistedVariablesAreDyn","registerOperator","left","right","Number","isInteger","BigInt","unsafeWorkflowExpressionFromSource","variableName","toCelListElementType","element","fromEntries","map","field","toCelSchemaType","toCelSchemaListElementType","typeName","registerType","startsWith","Error","node","op","args","containsFromJsonValue","value","Array","isArray","some","candidate"],"mappings":"AAAA,SAAsBA,WAAW,EAAEC,SAASC,QAAQ,QAAO,uBAAuB;AAClF,SAAQC,yBAAyB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AO;QACd,MAAM,IAAIjC,+BAA+B;YACvCW;YACAI,QAAQkB,iBAAiBmC,QAAQnC,MAAMC,OAAO,GAAG;QACnD;IACF;AACF;AAEA,SAASG,qBAAqBgC,IAAa;IACzC,IAAI,AAACA,CAAAA,KAAKC,EAAE,KAAK,UAAUD,KAAKC,EAAE,KAAK,OAAM,KAAMD,KAAKE,IAAI,CAAC,EAAE,KAAK,YAAY;QAC9E,OAAO;IACT;IAEA,OAAOC,sBAAsBH,KAAKE,IAAI;AACxC;AAEA,SAASC,sBAAsBC,KAAc;IAC3C,IAAIC,MAAMC,OAAO,CAACF,QAAQ,OAAOA,MAAMG,IAAI,CAACJ;IAC5C,IAAI,OAAOC,UAAU,YAAYA,UAAU,MAAM,OAAO;IAExD,MAAMI,YAAYJ;IAClB,IAAII,UAAUN,IAAI,KAAKnC,aAAayC,UAAUP,EAAE,KAAKlC,WAAW,OAAO;IAEvE,OAAOC,qBAAqBwC;AAC9B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { WorkflowExpressionEvaluationError, type WorkflowExpressionEvaluationFai
|
|
|
2
2
|
export { evaluateWorkflowExpression, evaluateWorkflowExpressionWithEnvironment, evaluateWorkflowPredicate, evaluateWorkflowPredicateFailClosed, type FailClosedPredicateOutcome, type WorkflowExpressionEnvironment, type WorkflowExpressionEvaluationContext, type WorkflowExpressionEvaluationValue, } from './evaluator/evaluate-workflow-expression.js';
|
|
3
3
|
export { createRangeEnvironment, MAX_RANGE_ELEMENTS } from './evaluator/range.js';
|
|
4
4
|
export { rehydrateJsonExpressionRecord, rehydrateJsonExpressionValue, } from './evaluator/rehydrate-json-expression.js';
|
|
5
|
+
export { createWorkflowEnvironment } from './evaluator/workflow-environment.js';
|
|
5
6
|
export { createWorkflowExpression, unsafeWorkflowExpressionFromSource, } from './expression/create-workflow-expression.js';
|
|
6
7
|
export { InvalidWorkflowExpressionError, invalidWorkflowExpressionErrorCode, } from './expression/errors.js';
|
|
7
8
|
export type { CreateWorkflowExpressionParams, ExpressionScalarType, ExpressionType, ExpressionTypeEnvironment, ValidCelExpression, WorkflowExpression, WorkflowExpressionCheck, WorkflowExpressionCheckOptions, } from './expression/workflow-expression.js';
|
|
@@ -27,4 +28,5 @@ export { parseWorkflowTemplate } from './template/parse-workflow-template.js';
|
|
|
27
28
|
export type { WorkflowTemplateExprSegment, WorkflowTemplateLiteralSegment, WorkflowTemplateSegment, } from './template/template-segment.js';
|
|
28
29
|
export { type AvailabilitySite, availabilitySites, buildTypedRootsEnvironment, contextRootsForField, type FillTarget, getWorkflowContextAvailability, getWorkflowContextDefinition, getWorkflowContextHost, getWorkflowContextSensitivity, getWorkflowContextTypeEnvironment, getWorkflowInterpolationFieldFailurePolicy, getWorkflowInterpolationFieldSelfReference, getWorkflowPredicateContextRoots, getWorkflowPredicateFieldMinimumFillTarget, getWorkflowPredicateFieldTypeEnvironment, isWorkflowPredicateField, type OpenWorkflowContextDefinition, projectWorkflowPredicateContext, type ReservedRootDefinition, type RunnerWorkflowContextDefinition, resolveContextRootAvailability, resolveContextRootHost, rootsAvailableAt, runnerFillTarget, type TypedWorkflowContextDefinition, unavailableRootsAt, type WorkflowContextAvailabilityReferenceEntry, type WorkflowContextDefinition, type WorkflowContextHost, type WorkflowContextName, type WorkflowContextReservedRoot, type WorkflowContextSensitivity, type WorkflowContextShape, type WorkflowFieldFailurePolicy, type WorkflowInterpolationFailurePolicy, type WorkflowInterpolationField, type WorkflowInterpolationFieldPolicy, type WorkflowJobTypeOverlay, type WorkflowPredicateContextRoot, type WorkflowPredicateField, type WorkflowStepTypeOverlay, workflowContextAvailabilityReference, workflowContextDefinitions, workflowContextHosts, workflowContextNames, workflowContextReservedRoots, workflowContextRootRequiresLiteralKey, workflowContextSensitivities, workflowFieldFailurePolicies, workflowInterpolationFieldAcceptsHost, workflowInterpolationFieldPolicies, workflowInterpolationFields, workflowPredicateContextRoots, workflowPredicateFieldFailurePolicy, workflowPredicateFields, } from './workflow-context/workflow-context.js';
|
|
29
30
|
export { type WorkflowContextDoc, workflowContextDocs, } from './workflow-context/workflow-context-docs.js';
|
|
31
|
+
export { MAX_JSON_OUTPUT_BYTES, MAX_RANGE_FANOUT_BYTES, } from './workflow-function-registry.js';
|
|
30
32
|
//# 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,OAAO,EACL,iCAAiC,EACjC,KAAK,yCAAyC,EAC9C,qCAAqC,GACtC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,yCAAyC,EACzC,yBAAyB,EACzB,mCAAmC,EACnC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,mCAAmC,EACxC,KAAK,iCAAiC,GACvC,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,sBAAsB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,wBAAwB,EACxB,kCAAkC,GACnC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,GACnC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,8BAA8B,EAC9B,oBAAoB,EACpB,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,KAAK,uBAAuB,EAC5B,iBAAiB,EACjB,KAAK,0BAA0B,EAC/B,0BAA0B,EAC1B,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,oCAAoC,EACpC,iCAAiC,EACjC,WAAW,EACX,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,kBAAkB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yC,EAC9C,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,kCAAkC,EACvC,KAAK,0BAA0B,EAC/B,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,oCAAoC,EACpC,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,4BAA4B,EAC5B,qCAAqC,EACrC,4BAA4B,EAC5B,4BAA4B,EAC5B,qCAAqC,EACrC,kCAAkC,EAClC,2BAA2B,EAC3B,6BAA6B,EAC7B,mCAAmC,EACnC,uBAAuB,GACxB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,kBAAkB,EACvB,mBAAmB,GACpB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { WorkflowExpressionEvaluationError, workflowExpressionEvaluationErrorCod
|
|
|
2
2
|
export { evaluateWorkflowExpression, evaluateWorkflowExpressionWithEnvironment, evaluateWorkflowPredicate, evaluateWorkflowPredicateFailClosed } from './evaluator/evaluate-workflow-expression.js';
|
|
3
3
|
export { createRangeEnvironment, MAX_RANGE_ELEMENTS } from './evaluator/range.js';
|
|
4
4
|
export { rehydrateJsonExpressionRecord, rehydrateJsonExpressionValue } from './evaluator/rehydrate-json-expression.js';
|
|
5
|
+
export { createWorkflowEnvironment } from './evaluator/workflow-environment.js';
|
|
5
6
|
export { createWorkflowExpression, unsafeWorkflowExpressionFromSource } from './expression/create-workflow-expression.js';
|
|
6
7
|
export { InvalidWorkflowExpressionError, invalidWorkflowExpressionErrorCode } from './expression/errors.js';
|
|
7
8
|
export { coerceStepOutputs, jsonSchemaToExpressionType, outputDeclarationsToExpressionFields, outputDeclarationToExpressionType, outputTypes, validateJsonSchema } from './outputs/index.js';
|
|
@@ -24,5 +25,6 @@ export { extractCelContextRoots } from './template/extract-cel-context-roots.js'
|
|
|
24
25
|
export { parseWorkflowTemplate } from './template/parse-workflow-template.js';
|
|
25
26
|
export { availabilitySites, buildTypedRootsEnvironment, contextRootsForField, getWorkflowContextAvailability, getWorkflowContextDefinition, getWorkflowContextHost, getWorkflowContextSensitivity, getWorkflowContextTypeEnvironment, getWorkflowInterpolationFieldFailurePolicy, getWorkflowInterpolationFieldSelfReference, getWorkflowPredicateContextRoots, getWorkflowPredicateFieldMinimumFillTarget, getWorkflowPredicateFieldTypeEnvironment, isWorkflowPredicateField, projectWorkflowPredicateContext, resolveContextRootAvailability, resolveContextRootHost, rootsAvailableAt, runnerFillTarget, unavailableRootsAt, workflowContextAvailabilityReference, workflowContextDefinitions, workflowContextHosts, workflowContextNames, workflowContextReservedRoots, workflowContextRootRequiresLiteralKey, workflowContextSensitivities, workflowFieldFailurePolicies, workflowInterpolationFieldAcceptsHost, workflowInterpolationFieldPolicies, workflowInterpolationFields, workflowPredicateContextRoots, workflowPredicateFieldFailurePolicy, workflowPredicateFields } from './workflow-context/workflow-context.js';
|
|
26
27
|
export { workflowContextDocs } from './workflow-context/workflow-context-docs.js';
|
|
28
|
+
export { MAX_JSON_OUTPUT_BYTES, MAX_RANGE_FANOUT_BYTES } from './workflow-function-registry.js';
|
|
27
29
|
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n WorkflowExpressionEvaluationError,\n type WorkflowExpressionEvaluationFailureReason,\n workflowExpressionEvaluationErrorCode,\n} from './evaluator/errors.js';\nexport {\n evaluateWorkflowExpression,\n evaluateWorkflowExpressionWithEnvironment,\n evaluateWorkflowPredicate,\n evaluateWorkflowPredicateFailClosed,\n type FailClosedPredicateOutcome,\n type WorkflowExpressionEnvironment,\n type WorkflowExpressionEvaluationContext,\n type WorkflowExpressionEvaluationValue,\n} from './evaluator/evaluate-workflow-expression.js';\nexport {createRangeEnvironment, MAX_RANGE_ELEMENTS} from './evaluator/range.js';\nexport {\n rehydrateJsonExpressionRecord,\n rehydrateJsonExpressionValue,\n} from './evaluator/rehydrate-json-expression.js';\nexport {\n createWorkflowExpression,\n unsafeWorkflowExpressionFromSource,\n} from './expression/create-workflow-expression.js';\nexport {\n InvalidWorkflowExpressionError,\n invalidWorkflowExpressionErrorCode,\n} from './expression/errors.js';\nexport type {\n CreateWorkflowExpressionParams,\n ExpressionScalarType,\n ExpressionType,\n ExpressionTypeEnvironment,\n ValidCelExpression,\n WorkflowExpression,\n WorkflowExpressionCheck,\n WorkflowExpressionCheckOptions,\n} from './expression/workflow-expression.js';\nexport {\n type CoerceStepOutputsResult,\n coerceStepOutputs,\n type JsonSchemaValidationResult,\n jsonSchemaToExpressionType,\n type OutputDeclarations,\n type OutputType,\n type OutputTypeDeclaration,\n outputDeclarationsToExpressionFields,\n outputDeclarationToExpressionType,\n outputTypes,\n type StepOutputCoercionError,\n type StepOutputCoercionErrorReason,\n validateJsonSchema,\n} from './outputs/index.js';\nexport {isBareContextReference} from './plan/bare-reference.js';\nexport {\n analyzeContextKeyAccess,\n analyzeContextRootKeyAccess,\n type ContextKeyAccessAnalysis,\n type ContextKeyAccessReference,\n type ContextKeyAccessViolation,\n type ContextRootKeyAccessAnalysis,\n type ContextRootKeyAccessReference,\n} from './plan/context-key-access.js';\nexport {evaluatePlannedPredicateAtSite} from './plan/evaluate-planned-predicate.js';\nexport {\n capTraceEntries,\n capTraceValue,\n EVALUATION_TRACE_MAX_ENTRIES,\n EVALUATION_TRACE_VALUE_CAP_BYTES,\n type EvaluationTraceEntry,\n type EvaluationTraceLimitEntry,\n type EvaluationTraceRowEntry,\n evaluationTraceEntry,\n predicateTraceEntry,\n} from './plan/evaluation-trace.js';\nexport {extractExactContextRoots} from './plan/extract-exact-context-roots.js';\nexport {\n type FrozenResolvedField,\n freezeResolvedFieldAtSite,\n resolveFieldAtSite,\n type SiteResolvedField,\n type WorkflowTemplateDiagnostic,\n type WorkflowTemplateFailurePolicy,\n} from './plan/freeze.js';\nexport {\n type FrozenPlannedRunCommand,\n freezePlannedRunCommandAtSite,\n} from './plan/freeze-run-command.js';\nexport {\n type FieldPlan,\n type FieldPlanResult,\n type PlanViolation,\n planInterpolationField,\n} from './plan/plan-field.js';\nexport {predicateSourceIsBooleanShaped} from './plan/predicate-shape.js';\nexport type {\n ResolvedField,\n ResolvedFieldDeferredSegment,\n ResolvedFieldLiteralSegment,\n ResolvedFieldSegment,\n} from './plan/resolved-field.js';\nexport {type RoutedExpression, routeExpression} from './plan/route-expression.js';\nexport {\n type ServerEvaluabilityResult,\n type ServerEvaluabilityViolation,\n validateServerEvaluable,\n} from './plan/validate-server-evaluable.js';\nexport {\n WorkflowTemplateResolutionError,\n workflowTemplateResolutionErrorCode,\n} from './resolver/errors.js';\nexport {\n type HoistedPlannedRunCommand,\n hoistPlannedRunCommand,\n type PlannedRunCommandBinding,\n type RunCommandHoistOptions,\n type UnsafeRunInterpolation,\n UnsafeRunInterpolationError,\n unsafeRunInterpolationErrorCode,\n} from './run/hoist-run-command.js';\nexport {\n classifyShellCodePosition,\n type ShellCodePositionAnalysis,\n type ShellCodePositionMatch,\n type ShellReevaluatingConstruct,\n} from './run/shell-code-position.js';\nexport {\n InvalidWorkflowTemplateError,\n invalidWorkflowTemplateErrorCode,\n} from './template/errors.js';\nexport {extractCelContextRoots} from './template/extract-cel-context-roots.js';\nexport {parseWorkflowTemplate} from './template/parse-workflow-template.js';\nexport type {\n WorkflowTemplateExprSegment,\n WorkflowTemplateLiteralSegment,\n WorkflowTemplateSegment,\n} from './template/template-segment.js';\nexport {\n type AvailabilitySite,\n availabilitySites,\n buildTypedRootsEnvironment,\n contextRootsForField,\n type FillTarget,\n getWorkflowContextAvailability,\n getWorkflowContextDefinition,\n getWorkflowContextHost,\n getWorkflowContextSensitivity,\n getWorkflowContextTypeEnvironment,\n getWorkflowInterpolationFieldFailurePolicy,\n getWorkflowInterpolationFieldSelfReference,\n getWorkflowPredicateContextRoots,\n getWorkflowPredicateFieldMinimumFillTarget,\n getWorkflowPredicateFieldTypeEnvironment,\n isWorkflowPredicateField,\n type OpenWorkflowContextDefinition,\n projectWorkflowPredicateContext,\n type ReservedRootDefinition,\n type RunnerWorkflowContextDefinition,\n resolveContextRootAvailability,\n resolveContextRootHost,\n rootsAvailableAt,\n runnerFillTarget,\n type TypedWorkflowContextDefinition,\n unavailableRootsAt,\n type WorkflowContextAvailabilityReferenceEntry,\n type WorkflowContextDefinition,\n type WorkflowContextHost,\n type WorkflowContextName,\n type WorkflowContextReservedRoot,\n type WorkflowContextSensitivity,\n type WorkflowContextShape,\n type WorkflowFieldFailurePolicy,\n type WorkflowInterpolationFailurePolicy,\n type WorkflowInterpolationField,\n type WorkflowInterpolationFieldPolicy,\n type WorkflowJobTypeOverlay,\n type WorkflowPredicateContextRoot,\n type WorkflowPredicateField,\n type WorkflowStepTypeOverlay,\n workflowContextAvailabilityReference,\n workflowContextDefinitions,\n workflowContextHosts,\n workflowContextNames,\n workflowContextReservedRoots,\n workflowContextRootRequiresLiteralKey,\n workflowContextSensitivities,\n workflowFieldFailurePolicies,\n workflowInterpolationFieldAcceptsHost,\n workflowInterpolationFieldPolicies,\n workflowInterpolationFields,\n workflowPredicateContextRoots,\n workflowPredicateFieldFailurePolicy,\n workflowPredicateFields,\n} from './workflow-context/workflow-context.js';\nexport {\n type WorkflowContextDoc,\n workflowContextDocs,\n} from './workflow-context/workflow-context-docs.js';\n"],"names":["WorkflowExpressionEvaluationError","workflowExpressionEvaluationErrorCode","evaluateWorkflowExpression","evaluateWorkflowExpressionWithEnvironment","evaluateWorkflowPredicate","evaluateWorkflowPredicateFailClosed","createRangeEnvironment","MAX_RANGE_ELEMENTS","rehydrateJsonExpressionRecord","rehydrateJsonExpressionValue","createWorkflowExpression","unsafeWorkflowExpressionFromSource","InvalidWorkflowExpressionError","invalidWorkflowExpressionErrorCode","coerceStepOutputs","jsonSchemaToExpressionType","outputDeclarationsToExpressionFields","outputDeclarationToExpressionType","outputTypes","validateJsonSchema","isBareContextReference","analyzeContextKeyAccess","analyzeContextRootKeyAccess","evaluatePlannedPredicateAtSite","capTraceEntries","capTraceValue","EVALUATION_TRACE_MAX_ENTRIES","EVALUATION_TRACE_VALUE_CAP_BYTES","evaluationTraceEntry","predicateTraceEntry","extractExactContextRoots","freezeResolvedFieldAtSite","resolveFieldAtSite","freezePlannedRunCommandAtSite","planInterpolationField","predicateSourceIsBooleanShaped","routeExpression","validateServerEvaluable","WorkflowTemplateResolutionError","workflowTemplateResolutionErrorCode","hoistPlannedRunCommand","UnsafeRunInterpolationError","unsafeRunInterpolationErrorCode","classifyShellCodePosition","InvalidWorkflowTemplateError","invalidWorkflowTemplateErrorCode","extractCelContextRoots","parseWorkflowTemplate","availabilitySites","buildTypedRootsEnvironment","contextRootsForField","getWorkflowContextAvailability","getWorkflowContextDefinition","getWorkflowContextHost","getWorkflowContextSensitivity","getWorkflowContextTypeEnvironment","getWorkflowInterpolationFieldFailurePolicy","getWorkflowInterpolationFieldSelfReference","getWorkflowPredicateContextRoots","getWorkflowPredicateFieldMinimumFillTarget","getWorkflowPredicateFieldTypeEnvironment","isWorkflowPredicateField","projectWorkflowPredicateContext","resolveContextRootAvailability","resolveContextRootHost","rootsAvailableAt","runnerFillTarget","unavailableRootsAt","workflowContextAvailabilityReference","workflowContextDefinitions","workflowContextHosts","workflowContextNames","workflowContextReservedRoots","workflowContextRootRequiresLiteralKey","workflowContextSensitivities","workflowFieldFailurePolicies","workflowInterpolationFieldAcceptsHost","workflowInterpolationFieldPolicies","workflowInterpolationFields","workflowPredicateContextRoots","workflowPredicateFieldFailurePolicy","workflowPredicateFields","workflowContextDocs"],"mappings":"AAAA,SACEA,iCAAiC,EAEjCC,q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EEC,iBAAiB,EACjBC,0BAA0B,EAC1BC,oBAAoB,EAEpBC,8BAA8B,EAC9BC,4BAA4B,EAC5BC,sBAAsB,EACtBC,6BAA6B,EAC7BC,iCAAiC,EACjCC,0CAA0C,EAC1CC,0CAA0C,EAC1CC,gCAAgC,EAChCC,0CAA0C,EAC1CC,wCAAwC,EACxCC,wBAAwB,EAExBC,+BAA+B,EAG/BC,8BAA8B,EAC9BC,sBAAsB,EACtBC,gBAAgB,EAChBC,gBAAgB,EAEhBC,kBAAkB,EAgBlBC,oCAAoC,EACpCC,0BAA0B,EAC1BC,oBAAoB,EACpBC,oBAAoB,EACpBC,4BAA4B,EAC5BC,qCAAqC,EACrCC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,qCAAqC,EACrCC,kCAAkC,EAClCC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,mCAAmC,EACnCC,uBAAuB,QAClB,yCAAyC;AAChD,SAEEC,mBAAmB,QACd,8CAA8C"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n WorkflowExpressionEvaluationError,\n type WorkflowExpressionEvaluationFailureReason,\n workflowExpressionEvaluationErrorCode,\n} from './evaluator/errors.js';\nexport {\n evaluateWorkflowExpression,\n evaluateWorkflowExpressionWithEnvironment,\n evaluateWorkflowPredicate,\n evaluateWorkflowPredicateFailClosed,\n type FailClosedPredicateOutcome,\n type WorkflowExpressionEnvironment,\n type WorkflowExpressionEvaluationContext,\n type WorkflowExpressionEvaluationValue,\n} from './evaluator/evaluate-workflow-expression.js';\nexport {createRangeEnvironment, MAX_RANGE_ELEMENTS} from './evaluator/range.js';\nexport {\n rehydrateJsonExpressionRecord,\n rehydrateJsonExpressionValue,\n} from './evaluator/rehydrate-json-expression.js';\nexport {createWorkflowEnvironment} from './evaluator/workflow-environment.js';\nexport {\n createWorkflowExpression,\n unsafeWorkflowExpressionFromSource,\n} from './expression/create-workflow-expression.js';\nexport {\n InvalidWorkflowExpressionError,\n invalidWorkflowExpressionErrorCode,\n} from './expression/errors.js';\nexport type {\n CreateWorkflowExpressionParams,\n ExpressionScalarType,\n ExpressionType,\n ExpressionTypeEnvironment,\n ValidCelExpression,\n WorkflowExpression,\n WorkflowExpressionCheck,\n WorkflowExpressionCheckOptions,\n} from './expression/workflow-expression.js';\nexport {\n type CoerceStepOutputsResult,\n coerceStepOutputs,\n type JsonSchemaValidationResult,\n jsonSchemaToExpressionType,\n type OutputDeclarations,\n type OutputType,\n type OutputTypeDeclaration,\n outputDeclarationsToExpressionFields,\n outputDeclarationToExpressionType,\n outputTypes,\n type StepOutputCoercionError,\n type StepOutputCoercionErrorReason,\n validateJsonSchema,\n} from './outputs/index.js';\nexport {isBareContextReference} from './plan/bare-reference.js';\nexport {\n analyzeContextKeyAccess,\n analyzeContextRootKeyAccess,\n type ContextKeyAccessAnalysis,\n type ContextKeyAccessReference,\n type ContextKeyAccessViolation,\n type ContextRootKeyAccessAnalysis,\n type ContextRootKeyAccessReference,\n} from './plan/context-key-access.js';\nexport {evaluatePlannedPredicateAtSite} from './plan/evaluate-planned-predicate.js';\nexport {\n capTraceEntries,\n capTraceValue,\n EVALUATION_TRACE_MAX_ENTRIES,\n EVALUATION_TRACE_VALUE_CAP_BYTES,\n type EvaluationTraceEntry,\n type EvaluationTraceLimitEntry,\n type EvaluationTraceRowEntry,\n evaluationTraceEntry,\n predicateTraceEntry,\n} from './plan/evaluation-trace.js';\nexport {extractExactContextRoots} from './plan/extract-exact-context-roots.js';\nexport {\n type FrozenResolvedField,\n freezeResolvedFieldAtSite,\n resolveFieldAtSite,\n type SiteResolvedField,\n type WorkflowTemplateDiagnostic,\n type WorkflowTemplateFailurePolicy,\n} from './plan/freeze.js';\nexport {\n type FrozenPlannedRunCommand,\n freezePlannedRunCommandAtSite,\n} from './plan/freeze-run-command.js';\nexport {\n type FieldPlan,\n type FieldPlanResult,\n type PlanViolation,\n planInterpolationField,\n} from './plan/plan-field.js';\nexport {predicateSourceIsBooleanShaped} from './plan/predicate-shape.js';\nexport type {\n ResolvedField,\n ResolvedFieldDeferredSegment,\n ResolvedFieldLiteralSegment,\n ResolvedFieldSegment,\n} from './plan/resolved-field.js';\nexport {type RoutedExpression, routeExpression} from './plan/route-expression.js';\nexport {\n type ServerEvaluabilityResult,\n type ServerEvaluabilityViolation,\n validateServerEvaluable,\n} from './plan/validate-server-evaluable.js';\nexport {\n WorkflowTemplateResolutionError,\n workflowTemplateResolutionErrorCode,\n} from './resolver/errors.js';\nexport {\n type HoistedPlannedRunCommand,\n hoistPlannedRunCommand,\n type PlannedRunCommandBinding,\n type RunCommandHoistOptions,\n type UnsafeRunInterpolation,\n UnsafeRunInterpolationError,\n unsafeRunInterpolationErrorCode,\n} from './run/hoist-run-command.js';\nexport {\n classifyShellCodePosition,\n type ShellCodePositionAnalysis,\n type ShellCodePositionMatch,\n type ShellReevaluatingConstruct,\n} from './run/shell-code-position.js';\nexport {\n InvalidWorkflowTemplateError,\n invalidWorkflowTemplateErrorCode,\n} from './template/errors.js';\nexport {extractCelContextRoots} from './template/extract-cel-context-roots.js';\nexport {parseWorkflowTemplate} from './template/parse-workflow-template.js';\nexport type {\n WorkflowTemplateExprSegment,\n WorkflowTemplateLiteralSegment,\n WorkflowTemplateSegment,\n} from './template/template-segment.js';\nexport {\n type AvailabilitySite,\n availabilitySites,\n buildTypedRootsEnvironment,\n contextRootsForField,\n type FillTarget,\n getWorkflowContextAvailability,\n getWorkflowContextDefinition,\n getWorkflowContextHost,\n getWorkflowContextSensitivity,\n getWorkflowContextTypeEnvironment,\n getWorkflowInterpolationFieldFailurePolicy,\n getWorkflowInterpolationFieldSelfReference,\n getWorkflowPredicateContextRoots,\n getWorkflowPredicateFieldMinimumFillTarget,\n getWorkflowPredicateFieldTypeEnvironment,\n isWorkflowPredicateField,\n type OpenWorkflowContextDefinition,\n projectWorkflowPredicateContext,\n type ReservedRootDefinition,\n type RunnerWorkflowContextDefinition,\n resolveContextRootAvailability,\n resolveContextRootHost,\n rootsAvailableAt,\n runnerFillTarget,\n type TypedWorkflowContextDefinition,\n unavailableRootsAt,\n type WorkflowContextAvailabilityReferenceEntry,\n type WorkflowContextDefinition,\n type WorkflowContextHost,\n type WorkflowContextName,\n type WorkflowContextReservedRoot,\n type WorkflowContextSensitivity,\n type WorkflowContextShape,\n type WorkflowFieldFailurePolicy,\n type WorkflowInterpolationFailurePolicy,\n type WorkflowInterpolationField,\n type WorkflowInterpolationFieldPolicy,\n type WorkflowJobTypeOverlay,\n type WorkflowPredicateContextRoot,\n type WorkflowPredicateField,\n type WorkflowStepTypeOverlay,\n workflowContextAvailabilityReference,\n workflowContextDefinitions,\n workflowContextHosts,\n workflowContextNames,\n workflowContextReservedRoots,\n workflowContextRootRequiresLiteralKey,\n workflowContextSensitivities,\n workflowFieldFailurePolicies,\n workflowInterpolationFieldAcceptsHost,\n workflowInterpolationFieldPolicies,\n workflowInterpolationFields,\n workflowPredicateContextRoots,\n workflowPredicateFieldFailurePolicy,\n workflowPredicateFields,\n} from './workflow-context/workflow-context.js';\nexport {\n type WorkflowContextDoc,\n workflowContextDocs,\n} from './workflow-context/workflow-context-docs.js';\nexport {\n MAX_JSON_OUTPUT_BYTES,\n MAX_RANGE_FANOUT_BYTES,\n} from './workflow-function-registry.js';\n"],"names":["WorkflowExpressionEvaluationError","workflowExpressionEvaluationErrorCode","evaluateWorkflowExpression","evaluateWorkflowExpressionWithEnvironment","evaluateWorkflowPredicate","evaluateWorkflowPredicateFailClosed","createRangeEnvironment","MAX_RANGE_ELEMENTS","rehydrateJsonExpressionRecord","rehydrateJsonExpressionValue","createWorkflowEnvironment","createWorkflowExpression","unsafeWorkflowExpressionFromSource","InvalidWorkflowExpressionError","invalidWorkflowExpressionErrorCode","coerceStepOutputs","jsonSchemaToExpressionType","outputDeclarationsToExpressionFields","outputDeclarationToExpressionType","outputTypes","validateJsonSchema","isBareContextReference","analyzeContextKeyAccess","analyzeContextRootKeyAccess","evaluatePlannedPredicateAtSite","capTraceEntries","capTraceValue","EVALUATION_TRACE_MAX_ENTRIES","EVALUATION_TRACE_VALUE_CAP_BYTES","evaluationTraceEntry","predicateTraceEntry","extractExactContextRoots","freezeResolvedFieldAtSite","resolveFieldAtSite","freezePlannedRunCommandAtSite","planInterpolationField","predicateSourceIsBooleanShaped","routeExpression","validateServerEvaluable","WorkflowTemplateResolutionError","workflowTemplateResolutionErrorCode","hoistPlannedRunCommand","UnsafeRunInterpolationError","unsafeRunInterpolationErrorCode","classifyShellCodePosition","InvalidWorkflowTemplateError","invalidWorkflowTemplateErrorCode","extractCelContextRoots","parseWorkflowTemplate","availabilitySites","buildTypedRootsEnvironment","contextRootsForField","getWorkflowContextAvailability","getWorkflowContextDefinition","getWorkflowContextHost","getWorkflowContextSensitivity","getWorkflowContextTypeEnvironment","getWorkflowInterpolationFieldFailurePolicy","getWorkflowInterpolationFieldSelfReference","getWorkflowPredicateContextRoots","getWorkflowPredicateFieldMinimumFillTarget","getWorkflowPredicateFieldTypeEnvironment","isWorkflowPredicateField","projectWorkflowPredicateContext","resolveContextRootAvailability","resolveContextRootHost","rootsAvailableAt","runnerFillTarget","unavailableRootsAt","workflowContextAvailabilityReference","workflowContextDefinitions","workflowContextHosts","workflowContextNames","workflowContextReservedRoots","workflowContextRootRequiresLiteralKey","workflowContextSensitivities","workflowFieldFailurePolicies","workflowInterpolationFieldAcceptsHost","workflowInterpolationFieldPolicies","workflowInterpolationFields","workflowPredicateContextRoots","workflowPredicateFieldFailurePolicy","workflowPredicateFields","workflowContextDocs","MAX_JSON_OUTPUT_BYTES","MAX_RANGE_FANOUT_BYTES"],"mappings":"AAAA,SACEA,iCAAiC,EAEjCC,qCAAqC,QAChC,wBAAwB;AAC/B,SACEC,0BAA0B,EAC1BC,yCAAyC,EACzCC,yBAAyB,EACzBC,mCAAmC,QAK9B,8CAA8C;AACrD,SAAQC,sBAAsB,EAAEC,kBAAkB,QAAO,uBAAuB;AAChF,SACEC,6BAA6B,EAC7BC,4BAA4B,QACvB,2CAA2C;AAClD,SA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CC,0CAA0C,EAC1CC,wCAAwC,EACxCC,wBAAwB,EAExBC,+BAA+B,EAG/BC,8BAA8B,EAC9BC,sBAAsB,EACtBC,gBAAgB,EAChBC,gBAAgB,EAEhBC,kBAAkB,EAgBlBC,oCAAoC,EACpCC,0BAA0B,EAC1BC,oBAAoB,EACpBC,oBAAoB,EACpBC,4BAA4B,EAC5BC,qCAAqC,EACrCC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,qCAAqC,EACrCC,kCAAkC,EAClCC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,mCAAmC,EACnCC,uBAAuB,QAClB,yCAAyC;AAChD,SAEEC,mBAAmB,QACd,8CAA8C;AACrD,SACEC,qBAAqB,EACrBC,sBAAsB,QACjB,kCAAkC"}
|
package/dist/json.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAKrE"}
|
package/dist/json.js
ADDED
package/dist/json.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/json.ts"],"sourcesContent":["export function stringifyBigint(_key: string, value: unknown): unknown {\n if (typeof value !== 'bigint') return value;\n\n const numberValue = Number(value);\n return Number.isSafeInteger(numberValue) ? numberValue : value.toString();\n}\n"],"names":["stringifyBigint","_key","value","numberValue","Number","isSafeInteger","toString"],"mappings":"AAAA,OAAO,SAASA,gBAAgBC,IAAY,EAAEC,KAAc;IAC1D,IAAI,OAAOA,UAAU,UAAU,OAAOA;IAEtC,MAAMC,cAAcC,OAAOF;IAC3B,OAAOE,OAAOC,aAAa,CAACF,eAAeA,cAAcD,MAAMI,QAAQ;AACzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-workflow-value-to-string.d.ts","sourceRoot":"","sources":["../../src/resolver/coerce-workflow-value-to-string.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coerce-workflow-value-to-string.d.ts","sourceRoot":"","sources":["../../src/resolver/coerce-workflow-value-to-string.ts"],"names":[],"mappings":"AAEA,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CASlE"}
|