@jevable/core 0.1.0 → 0.1.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 +1 -1
- package/dist/cel/check.d.ts +1 -1
- package/dist/cel/check.js +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/engine.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @jevable/core
|
|
2
2
|
|
|
3
|
-
The rule engine behind [`
|
|
3
|
+
The rule engine behind [`jevable`](../cli/README.md): CEL expressions over a
|
|
4
4
|
record (`line`, `json`) or a window (`window`) that can ask
|
|
5
5
|
[Jev](https://docs.typesafe.ai) semantic questions through `judge.boolean`,
|
|
6
6
|
`judge.choice` and `judge.score`. Plain conditions decide first; Jev is asked
|
package/dist/cel/check.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type Planned } from "./env.ts";
|
|
|
2
2
|
/** A rule that cannot work as written. */
|
|
3
3
|
export declare class RuleError extends Error {
|
|
4
4
|
}
|
|
5
|
-
export declare const HINT = "Variables: line, json (the parsed line) and, with --window, window. Run `
|
|
5
|
+
export declare const HINT = "Variables: line, json (the parsed line) and, with --window, window. Run `jevable guide` for functions and examples.";
|
|
6
6
|
/** Throws a RuleError when the parsed expression cannot work as a rule (or key). */
|
|
7
7
|
export declare function checkParsed(expr: unknown, kind: "rule" | "key"): void;
|
|
8
8
|
/** Dry-runs a planned expression with neutral answers; throws a RuleError on what only evaluation shows. */
|
package/dist/cel/check.js
CHANGED
|
@@ -8,7 +8,7 @@ export class RuleError extends Error {
|
|
|
8
8
|
const VARIABLES = new Set(["line", "json", "window"]);
|
|
9
9
|
// Identifiers CEL itself provides: type names usable in `type(x) == int`.
|
|
10
10
|
const BUILTIN_IDENTS = new Set(["int", "uint", "double", "bool", "string", "bytes", "list", "map", "null_type", "type"]);
|
|
11
|
-
export const HINT = "Variables: line, json (the parsed line) and, with --window, window. Run `
|
|
11
|
+
export const HINT = "Variables: line, json (the parsed line) and, with --window, window. Run `jevable guide` for functions and examples.";
|
|
12
12
|
const COMPARE = `compare it, e.g. judge.boolean(line, "...") >= 0.7`;
|
|
13
13
|
// Values for the dry run, shaped like real ones.
|
|
14
14
|
const PROBE = {
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Answers } from "./cel/env.ts";
|
|
2
2
|
import { Program } from "./program.ts";
|
|
3
3
|
import { type Answer, type Client, type Question } from "./typesafe/client.ts";
|
|
4
|
-
export declare const NO_KEY = "no Jev API key: set TYPESAFE_API_KEY (or JEV_API_KEY)";
|
|
4
|
+
export declare const NO_KEY = "no Jev API key: set TYPESAFE_API_KEY (or JEV_API_KEY), or put it in ~/.jevable/key";
|
|
5
5
|
/**
|
|
6
6
|
* What every program shares: the Jev client, an answer cache (the same
|
|
7
7
|
* question on the same material is asked once), and counters.
|
package/dist/engine.js
CHANGED
|
@@ -3,7 +3,7 @@ import { checkParsed, checkPlanned, HINT, RuleError } from "./cel/check.js";
|
|
|
3
3
|
import { env } from "./cel/env.js";
|
|
4
4
|
import { Program } from "./program.js";
|
|
5
5
|
import { HttpError } from "./typesafe/client.js";
|
|
6
|
-
export const NO_KEY = "no Jev API key: set TYPESAFE_API_KEY (or JEV_API_KEY)";
|
|
6
|
+
export const NO_KEY = "no Jev API key: set TYPESAFE_API_KEY (or JEV_API_KEY), or put it in ~/.jevable/key";
|
|
7
7
|
/**
|
|
8
8
|
* What every program shares: the Jev client, an answer cache (the same
|
|
9
9
|
* question on the same material is asked once), and counters.
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jevable/core",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "The
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "The jevable rule engine: CEL rules that ask Jev, TypeSafe's classification model, semantic questions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"
|
|
8
|
+
"jevable-source": "./src/index.ts",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
12
|
"./testing": {
|
|
13
|
-
"
|
|
13
|
+
"jevable-source": "./src/testing.ts",
|
|
14
14
|
"types": "./dist/testing.d.ts",
|
|
15
15
|
"default": "./dist/testing.js"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"files": ["dist"],
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=20"
|
|
20
|
+
"node": ">=20.3"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc -p tsconfig.build.json",
|
|
24
24
|
"typecheck": "tsc --noEmit",
|
|
25
|
-
"test": "node --conditions=
|
|
25
|
+
"test": "node --conditions=jevable-source --test test/*.test.ts",
|
|
26
26
|
"prepack": "npm run build"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@bufbuild/cel": "0.6.1"
|
|
30
30
|
},
|
|
31
|
-
"license": "
|
|
31
|
+
"license": "UNLICENSED"
|
|
32
32
|
}
|