claudish 14.7.0 → 14.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.
Files changed (2) hide show
  1. package/dist/index.js +55 -5
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -5398,7 +5398,7 @@ var init_onepassword_config = __esm(() => {
5398
5398
  });
5399
5399
 
5400
5400
  // src/version.ts
5401
- var VERSION = "14.7.0";
5401
+ var VERSION = "14.8.0";
5402
5402
 
5403
5403
  // src/redact.ts
5404
5404
  function isPlaceholder(value) {
@@ -16112,7 +16112,12 @@ var init_allowance_report_schema = __esm(() => {
16112
16112
  soonest: iso,
16113
16113
  usual: iso,
16114
16114
  latest: iso,
16115
- probability: fraction
16115
+ probability: fraction,
16116
+ likelihood: object({
16117
+ start: iso,
16118
+ stepHours: literal(1),
16119
+ p: array(number2().min(0).max(1)).min(1)
16120
+ }).optional()
16116
16121
  })).optional(),
16117
16122
  spark48: string2().regex(/^[\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588\u2592\u2593\u250A ]*$/u)
16118
16123
  });
@@ -19955,6 +19960,32 @@ function firstTakeovers(r, from, now, end) {
19955
19960
  }
19956
19961
  return taken;
19957
19962
  }
19963
+ function likelihoodOf(times, q, h0, hours) {
19964
+ const x = times.map((t) => (t - h0) / HOUR_MS14);
19965
+ const n = x.length;
19966
+ const mean = x.reduce((a, b) => a + b, 0) / Math.max(1, n);
19967
+ const sd = Math.sqrt(x.reduce((a, b) => a + (b - mean) ** 2, 0) / Math.max(1, n - 1));
19968
+ const iqr = (q.p75 - q.p25) / HOUR_MS14 / 1.34;
19969
+ const spread = iqr > 0 ? Math.min(sd, iqr) : 0;
19970
+ const bandwidth = 0.9 * spread * n ** -0.2;
19971
+ const p = new Array(Math.max(0, hours)).fill(0);
19972
+ if (bandwidth < MIN_BANDWIDTH_H) {
19973
+ for (const xi of x) {
19974
+ const i = Math.floor(xi);
19975
+ if (i >= 0 && i < p.length)
19976
+ p[i] = (p[i] ?? 0) + 1;
19977
+ }
19978
+ } else {
19979
+ for (let i = 0;i < p.length; i++) {
19980
+ let f = 0;
19981
+ for (const xi of x)
19982
+ f += Math.exp(-0.5 * ((i + 0.5 - xi) / bandwidth) ** 2);
19983
+ p[i] = f;
19984
+ }
19985
+ }
19986
+ const peak = Math.max(0, ...p);
19987
+ return peak > 0 ? p.map((v) => v / peak) : p;
19988
+ }
19958
19989
  function switchesOf2(results, views, poolActive, now, end) {
19959
19990
  const order = new Map(views.map((v, i) => [v.account, i]));
19960
19991
  const from = poolActive !== null && order.has(poolActive) ? poolActive : null;
@@ -19967,12 +19998,20 @@ function switchesOf2(results, views, poolActive, now, end) {
19967
19998
  }
19968
19999
  }
19969
20000
  const paths = Math.max(1, results.length);
20001
+ const h0 = hourStart(now);
20002
+ const hours = Math.floor((end - h0) / HOUR_MS14) + 1;
19970
20003
  const out = [];
19971
20004
  for (const [account, list] of times) {
19972
20005
  const probability = list.length / paths;
19973
20006
  if (probability < MIN_PATH_SHARE)
19974
20007
  continue;
19975
- out.push({ account, q: quantilesOf2(list), probability: Math.min(1, probability) });
20008
+ const q = quantilesOf2(list);
20009
+ out.push({
20010
+ account,
20011
+ q,
20012
+ probability: Math.min(1, probability),
20013
+ likelihood: { start: h0, p: likelihoodOf(list, q, h0, hours) }
20014
+ });
19976
20015
  }
19977
20016
  return out.sort((a, b) => a.q.p50 - b.q.p50 || (order.get(a.account) ?? 0) - (order.get(b.account) ?? 0));
19978
20017
  }
@@ -20121,7 +20160,7 @@ function sparkline(t, cells) {
20121
20160
  return LEVELS[Math.max(0, level)] ?? " ";
20122
20161
  }).join("");
20123
20162
  }
20124
- var MINUTE_MS10 = 60000, HOUR_MS14 = 3600000, WEEK_MS4, BLOCKED_SHARE = 0.5, WIDE_BAND = 0.15, LEVELS, provenanceOf = (inferred) => inferred ? "reset-inferred" : "observed";
20163
+ var MINUTE_MS10 = 60000, HOUR_MS14 = 3600000, WEEK_MS4, BLOCKED_SHARE = 0.5, WIDE_BAND = 0.15, LEVELS, provenanceOf = (inferred) => inferred ? "reset-inferred" : "observed", MIN_BANDWIDTH_H = 0.5;
20125
20164
  var init_trajectory = __esm(() => {
20126
20165
  init_alerts();
20127
20166
  init_calibrate();
@@ -22769,6 +22808,16 @@ function poolRemaining(views) {
22769
22808
  }
22770
22809
  return { remainingNow: now.value, capacity, unit: now.unit };
22771
22810
  }
22811
+ function likelihoodView(l) {
22812
+ const p = l.p.map((v) => Math.round(Math.min(1, Math.max(0, v)) * 1000) / 1000);
22813
+ const first = p.findIndex((v) => v > 0);
22814
+ if (first < 0)
22815
+ return;
22816
+ let last = p.length - 1;
22817
+ while (last > first && p[last] === 0)
22818
+ last--;
22819
+ return { start: iso2(l.start + first * HOUR_MS16), stepHours: 1, p: p.slice(first, last + 1) };
22820
+ }
22772
22821
  function sustainableOf(top, pace, burnLong) {
22773
22822
  const long = Number.isFinite(burnLong) ? Math.max(0, burnLong) : 0;
22774
22823
  if (top)
@@ -22910,7 +22959,8 @@ function buildReport(input) {
22910
22959
  soonest: iso2(sw.q.p10),
22911
22960
  usual: iso2(sw.q.p50),
22912
22961
  latest: iso2(sw.q.p90),
22913
- probability: Math.min(1, Math.max(0, sw.probability))
22962
+ probability: Math.min(1, Math.max(0, sw.probability)),
22963
+ likelihood: likelihoodView(sw.likelihood)
22914
22964
  })),
22915
22965
  spark48: sparkline({
22916
22966
  ...traj,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "14.7.0",
3
+ "version": "14.8.0",
4
4
  "description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -71,10 +71,10 @@
71
71
  "ai"
72
72
  ],
73
73
  "optionalDependencies": {
74
- "@claudish/magmux-darwin-arm64": "14.7.0",
75
- "@claudish/magmux-darwin-x64": "14.7.0",
76
- "@claudish/magmux-linux-arm64": "14.7.0",
77
- "@claudish/magmux-linux-x64": "14.7.0"
74
+ "@claudish/magmux-darwin-arm64": "14.8.0",
75
+ "@claudish/magmux-darwin-x64": "14.8.0",
76
+ "@claudish/magmux-linux-arm64": "14.8.0",
77
+ "@claudish/magmux-linux-x64": "14.8.0"
78
78
  },
79
79
  "author": "Jack Rudenko <i@madappgang.com>",
80
80
  "license": "MIT",