oracular 0.7.0 → 0.8.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/CHANGELOG.md +12 -0
- package/README.md +3 -2
- package/dist/index.cjs +73 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -10
- package/dist/index.d.ts +22 -10
- package/dist/index.js +73 -11
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.cts +4 -1
- package/dist/inspect.d.ts +4 -1
- package/dist/presets.d.cts +7 -0
- package/dist/presets.d.ts +7 -0
- package/package.json +3 -2
- package/schema/config.schema.json +5 -0
package/dist/inspect.d.cts
CHANGED
|
@@ -12,7 +12,10 @@ interface Prediction {
|
|
|
12
12
|
p: number;
|
|
13
13
|
/** Standard deviation of the Beta distribution. */
|
|
14
14
|
sd: number;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The lower confidence bound `shouldReveal` compares to the threshold: p − z·sd clamped to
|
|
17
|
+
* [0, 1], or with `bound: 'exact'` the Beta quantile at Φ(−z).
|
|
18
|
+
*/
|
|
16
19
|
lower: number;
|
|
17
20
|
/** 1 − 2·sd, clamped to [0, 1]. A heuristic: 1 when the estimate is sharp, 0 when it is as vague as possible. */
|
|
18
21
|
confidence: number;
|
package/dist/inspect.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ interface Prediction {
|
|
|
12
12
|
p: number;
|
|
13
13
|
/** Standard deviation of the Beta distribution. */
|
|
14
14
|
sd: number;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The lower confidence bound `shouldReveal` compares to the threshold: p − z·sd clamped to
|
|
17
|
+
* [0, 1], or with `bound: 'exact'` the Beta quantile at Φ(−z).
|
|
18
|
+
*/
|
|
16
19
|
lower: number;
|
|
17
20
|
/** 1 − 2·sd, clamped to [0, 1]. A heuristic: 1 when the estimate is sharp, 0 when it is as vague as possible. */
|
|
18
21
|
confidence: number;
|
package/dist/presets.d.cts
CHANGED
|
@@ -14,6 +14,13 @@ interface RevealOptions {
|
|
|
14
14
|
z?: number;
|
|
15
15
|
/** How long after `markRevealed` the intent stays revealed and `shouldReveal` is false. Default: the intent's `halfLife`. */
|
|
16
16
|
cooldown?: number;
|
|
17
|
+
/**
|
|
18
|
+
* How `lower` is computed. `'normal'` (default): p − z·sd, clamped to [0, 1]. `'exact'`: the
|
|
19
|
+
* Beta distribution's own quantile at the same one-sided level, Φ(−z), so `z` keeps its
|
|
20
|
+
* meaning. The two differ on thin evidence near the threshold, where the approximation is
|
|
21
|
+
* optimistic; under `'exact'`, `z: 0` is the median rather than the mean.
|
|
22
|
+
*/
|
|
23
|
+
bound?: 'normal' | 'exact';
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* One thing the user might be about to do, tracked as a Beta(α, β) distribution with
|
package/dist/presets.d.ts
CHANGED
|
@@ -14,6 +14,13 @@ interface RevealOptions {
|
|
|
14
14
|
z?: number;
|
|
15
15
|
/** How long after `markRevealed` the intent stays revealed and `shouldReveal` is false. Default: the intent's `halfLife`. */
|
|
16
16
|
cooldown?: number;
|
|
17
|
+
/**
|
|
18
|
+
* How `lower` is computed. `'normal'` (default): p − z·sd, clamped to [0, 1]. `'exact'`: the
|
|
19
|
+
* Beta distribution's own quantile at the same one-sided level, Φ(−z), so `z` keeps its
|
|
20
|
+
* meaning. The two differ on thin evidence near the threshold, where the approximation is
|
|
21
|
+
* optimistic; under `'exact'`, `z: 0` is the median rather than the mean.
|
|
22
|
+
*/
|
|
23
|
+
bound?: 'normal' | 'exact';
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* One thing the user might be about to do, tracked as a Beta(α, β) distribution with
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oracular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "On-device intent engine. Your app learns when the user is ready. Nothing leaves the device.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oracular",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"node": ">=18"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
|
-
"build": "tsup",
|
|
91
|
+
"build": "tsup && tsup --config tsup.presets.config.ts && tsup --config tsup.inspect.config.ts",
|
|
92
92
|
"test": "vitest run",
|
|
93
93
|
"test:watch": "vitest",
|
|
94
94
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.cli.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
"@changesets/cli": "^3.0.3",
|
|
114
114
|
"@size-limit/preset-small-lib": "^12.1.0",
|
|
115
115
|
"@types/node": "^22.20.5",
|
|
116
|
+
"fast-check": "^4.10.2",
|
|
116
117
|
"publint": "^0.3.25",
|
|
117
118
|
"size-limit": "^12.1.0",
|
|
118
119
|
"tsup": "^8.5.1",
|
|
@@ -120,6 +120,11 @@
|
|
|
120
120
|
"type": "number",
|
|
121
121
|
"minimum": 0,
|
|
122
122
|
"description": "How long after a reveal or the outcome the intent stays quiet. Default: the intent's halfLife."
|
|
123
|
+
},
|
|
124
|
+
"bound": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"enum": ["normal", "exact"],
|
|
127
|
+
"description": "How lower is computed: the normal approximation p − z·sd (default) or the exact Beta quantile at the same one-sided level."
|
|
123
128
|
}
|
|
124
129
|
}
|
|
125
130
|
},
|