oracular 0.7.1 → 0.8.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.
@@ -12,7 +12,10 @@ interface Prediction {
12
12
  p: number;
13
13
  /** Standard deviation of the Beta distribution. */
14
14
  sd: number;
15
- /** p − z·sd, clamped to [0, 1]. This is what `shouldReveal` compares to the threshold. */
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
- /** p − z·sd, clamped to [0, 1]. This is what `shouldReveal` compares to the threshold. */
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;
@@ -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.7.1",
3
+ "version": "0.8.1",
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",
@@ -87,6 +87,10 @@
87
87
  "engines": {
88
88
  "node": ">=18"
89
89
  },
90
+ "workspaces": [
91
+ ".",
92
+ "packages/*"
93
+ ],
90
94
  "scripts": {
91
95
  "build": "tsup && tsup --config tsup.presets.config.ts && tsup --config tsup.inspect.config.ts",
92
96
  "test": "vitest run",
@@ -97,20 +101,22 @@
97
101
  "smoke": "node scripts/smoke.cjs && node scripts/smoke.mjs && node scripts/smoke-cli.mjs",
98
102
  "size": "size-limit",
99
103
  "pack:check": "node scripts/pack-check.mjs",
100
- "check": "npm run lint && npm run typecheck && npm test && npm run build && npm run smoke && npm run size && npm run pack:check",
101
- "prepublishOnly": "npm run check",
104
+ "check:core": "npm run lint && npm run typecheck && npm test && npm run build && npm run smoke && npm run size && npm run pack:check",
105
+ "check": "npm run check:core",
106
+ "prepublishOnly": "npm run check:core",
102
107
  "docs:api": "typedoc",
103
108
  "docs:dev": "npm run docs:api && vitepress dev docs",
104
109
  "docs:build": "npm run docs:api && vitepress build docs",
105
110
  "docs:preview": "vitepress preview docs",
106
111
  "changeset": "changeset",
112
+ "release:version": "changeset version && npm install --package-lock-only --ignore-scripts",
107
113
  "release": "node scripts/release.mjs"
108
114
  },
109
115
  "devDependencies": {
110
116
  "@arethetypeswrong/cli": "^0.18.5",
111
117
  "@biomejs/biome": "^2.5.15",
112
118
  "@changesets/changelog-github": "^1.0.1",
113
- "@changesets/cli": "^3.0.3",
119
+ "@changesets/cli": "3.0.3",
114
120
  "@size-limit/preset-small-lib": "^12.1.0",
115
121
  "@types/node": "^22.20.5",
116
122
  "fast-check": "^4.10.2",
@@ -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
  },