@bpmnkit/feel 0.0.13 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/evaluator.js +5 -3
- package/dist/parser.js +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@bpmnkit/feel)
|
|
7
7
|
[](https://github.com/bpmnkit/monorepo/blob/main/LICENSE)
|
|
8
8
|
[](https://github.com/bpmnkit/monorepo)
|
|
9
|
+
[](https://github.com/bpmnkit/monorepo)
|
|
10
|
+
[](https://github.com/bpmnkit/monorepo)
|
|
9
11
|
|
|
10
12
|
[Website](https://bpmnkit.com) · [Documentation](https://docs.bpmnkit.com) · [GitHub](https://github.com/bpmnkit/monorepo) · [Changelog](https://github.com/bpmnkit/monorepo/blob/main/packages/feel/CHANGELOG.md)
|
|
11
13
|
</div>
|
|
@@ -110,9 +112,13 @@ interface ParseResult {
|
|
|
110
112
|
| [`@bpmnkit/connector-gen`](https://www.npmjs.com/package/@bpmnkit/connector-gen) | Generate connector templates from OpenAPI specs |
|
|
111
113
|
| [`@bpmnkit/cli`](https://www.npmjs.com/package/@bpmnkit/cli) | Camunda 8 command-line interface (casen) |
|
|
112
114
|
| [`@bpmnkit/proxy`](https://www.npmjs.com/package/@bpmnkit/proxy) | Local AI bridge and Camunda API proxy server |
|
|
115
|
+
| [`@bpmnkit/patterns`](https://www.npmjs.com/package/@bpmnkit/patterns) | Domain process patterns for BPMNKit AIKit |
|
|
116
|
+
| [`@bpmnkit/worker-client`](https://www.npmjs.com/package/@bpmnkit/worker-client) | Thin Zeebe REST client for standalone workers |
|
|
113
117
|
| [`@bpmnkit/cli-sdk`](https://www.npmjs.com/package/@bpmnkit/cli-sdk) | Plugin authoring SDK for the casen CLI |
|
|
114
118
|
| [`@bpmnkit/create-casen-plugin`](https://www.npmjs.com/package/@bpmnkit/create-casen-plugin) | Scaffold a new casen CLI plugin in seconds |
|
|
115
119
|
| [`@bpmnkit/casen-report`](https://www.npmjs.com/package/@bpmnkit/casen-report) | HTML reports from Camunda 8 incident and SLA data |
|
|
120
|
+
| [`@bpmnkit/casen-worker-http`](https://www.npmjs.com/package/@bpmnkit/casen-worker-http) | Example HTTP worker plugin — completes jobs with live JSONPlaceholder API data |
|
|
121
|
+
| [`@bpmnkit/casen-worker-ai`](https://www.npmjs.com/package/@bpmnkit/casen-worker-ai) | AI task worker — classify, summarize, extract, and decide using Claude |
|
|
116
122
|
|
|
117
123
|
## License
|
|
118
124
|
|
package/dist/evaluator.js
CHANGED
|
@@ -574,10 +574,12 @@ export function evaluateUnaryTest(node, input, ctx) {
|
|
|
574
574
|
// List result → any element matches
|
|
575
575
|
if (isFeelList(result))
|
|
576
576
|
return result.some((r) => testIncludes(r, input) === true);
|
|
577
|
-
// A plain expression in unary test mode is an equality test
|
|
578
|
-
|
|
577
|
+
// A plain expression in unary test mode is an equality test.
|
|
578
|
+
// When the result is null: only match if the node itself is the null literal
|
|
579
|
+
// (null arithmetic in comparisons also yields null but must not match anything).
|
|
580
|
+
if (result !== null)
|
|
579
581
|
return deepEqual(result, input);
|
|
580
|
-
return false;
|
|
582
|
+
return node.kind === "null" ? input === null : false;
|
|
581
583
|
}
|
|
582
584
|
/** Evaluate a full unary-test node (the root returned by parseUnaryTests). */
|
|
583
585
|
export function evaluateUnaryTests(node, input, ctx) {
|
package/dist/parser.js
CHANGED
|
@@ -809,6 +809,24 @@ class Parser {
|
|
|
809
809
|
if (tok.kind === "punct" && (tok.value === "[" || tok.value === "(")) {
|
|
810
810
|
return this.parseListOrRange() ?? this.parseParenOrRange();
|
|
811
811
|
}
|
|
812
|
+
// "instance of X" in unary-test context — implicit input "?" is the subject
|
|
813
|
+
if (tok.kind === "keyword" && tok.value === "instance") {
|
|
814
|
+
const start = tok.start;
|
|
815
|
+
this.advance();
|
|
816
|
+
if (!this.expect("keyword", "of"))
|
|
817
|
+
return null;
|
|
818
|
+
const typeName = this.parseTypeName();
|
|
819
|
+
if (!typeName)
|
|
820
|
+
return null;
|
|
821
|
+
const implicitInput = { kind: "name", name: "?", start, end: start };
|
|
822
|
+
return {
|
|
823
|
+
kind: "instance-of",
|
|
824
|
+
value: implicitInput,
|
|
825
|
+
typeName,
|
|
826
|
+
start,
|
|
827
|
+
end: this.pos > 0 ? (this.tokens[this.pos - 1]?.end ?? start) : start,
|
|
828
|
+
};
|
|
829
|
+
}
|
|
812
830
|
// Expression equality test
|
|
813
831
|
return this.parseExpression(0);
|
|
814
832
|
}
|