claudish 14.8.0 → 14.9.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 +65 -39
  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.8.0";
5401
+ var VERSION = "14.9.0";
5402
5402
 
5403
5403
  // src/redact.ts
5404
5404
  function isPlaceholder(value) {
@@ -16042,7 +16042,7 @@ var init_minimax_model_dialect = __esm(() => {
16042
16042
  });
16043
16043
 
16044
16044
  // src/auth/accounts/allowance-report-schema.ts
16045
- var ALLOWANCE_REPORT_SCHEMA = "claudish.allowance.v1", iso, fraction, finite, nonNegative, quantilesOf = (t) => object({ p10: t, p25: t, p50: t, p75: t, p90: t }), alertLevel, strategyName, evidence, unit, provenance, semantics, gapKind, exactness, accountSchema, remedySchema, alertSchema, historyPoint, trajectorySchema, sessionSchema, allowanceReportSchema, ALLOWANCE_REPORT_SECTIONS, partialReport, allowanceStatusAnswerSchema;
16045
+ var ALLOWANCE_REPORT_SCHEMA = "claudish.allowance.v1", iso, fraction, finite, nonNegative, quantilesOf = (t) => object({ p10: t, p25: t, p50: t, p75: t, p90: t }), alertLevel, strategyName, evidence, unit, provenance, semantics, gapKind, exactness, accountSchema, remedySchema, alertSchema, historyPoint, switchSchema, blockedSchema, trajectorySchema, sessionSchema, allowanceReportSchema, ALLOWANCE_REPORT_SECTIONS, partialReport, allowanceStatusAnswerSchema;
16046
16046
  var init_allowance_report_schema = __esm(() => {
16047
16047
  init_zod();
16048
16048
  iso = exports_iso.datetime({ offset: true });
@@ -16101,24 +16101,31 @@ var init_allowance_report_schema = __esm(() => {
16101
16101
  remaining: finite,
16102
16102
  provenance: _enum(["observed", "reset-inferred"])
16103
16103
  });
16104
+ switchSchema = object({
16105
+ accountId: string2(),
16106
+ soonest: iso,
16107
+ usual: iso,
16108
+ latest: iso,
16109
+ probability: fraction,
16110
+ likelihood: object({
16111
+ start: iso,
16112
+ stepHours: literal(1),
16113
+ p: array(number2().min(0).max(1)).min(1)
16114
+ }).optional()
16115
+ });
16116
+ blockedSchema = object({ from: iso, to: iso, kind: gapKind, probability: fraction });
16104
16117
  trajectorySchema = object({
16105
16118
  history: array(historyPoint),
16106
16119
  historyByAccount: array(object({ accountId: string2(), history: array(historyPoint) })).optional(),
16107
16120
  forecast: array(object({ at: iso, p10: finite, p50: finite, p90: finite, pBlocked: fraction })),
16108
16121
  resets: array(object({ at: iso, account: string2(), window: string2(), projected: boolean2() })),
16109
- blocked: array(object({ from: iso, to: iso, kind: gapKind, probability: fraction })),
16110
- switches: array(object({
16111
- accountId: string2(),
16112
- soonest: iso,
16113
- usual: iso,
16114
- latest: iso,
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()
16121
- })).optional(),
16122
+ blocked: array(blockedSchema),
16123
+ switches: array(switchSchema).optional(),
16124
+ slower: object({
16125
+ factor: number2().gt(0).lt(1),
16126
+ switches: array(switchSchema),
16127
+ blocked: array(blockedSchema)
16128
+ }).optional(),
16122
16129
  spark48: string2().regex(/^[\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588\u2592\u2593\u250A ]*$/u)
16123
16130
  });
16124
16131
  sessionSchema = object({
@@ -16651,7 +16658,7 @@ function cuOf(tokens, cfg) {
16651
16658
  const uncached = Math.max(0, tokens.input - tokens.cacheRead - tokens.cacheWrite);
16652
16659
  return uncached + w.cacheRead * tokens.cacheRead + w.cacheWrite * tokens.cacheWrite + w.output * tokens.output;
16653
16660
  }
16654
- var PROVIDER_COST_PRIORS, MINUTE_MS2 = 60000, HOUR_MS2, DEFAULT_ALLOWANCE_CONFIG, LOOKAHEAD_TRAJ_PATHS = 40, MIN_PATH_SHARE = 0.1, PACE_MAX_MULT = 64, PACE_BISECT_STEPS = 4;
16661
+ var PROVIDER_COST_PRIORS, MINUTE_MS2 = 60000, HOUR_MS2, DEFAULT_ALLOWANCE_CONFIG, LOOKAHEAD_TRAJ_PATHS = 40, MIN_PATH_SHARE = 0.1, SLOWER_FACTOR, PACE_MAX_MULT = 64, PACE_BISECT_STEPS = 4;
16655
16662
  var init_constants = __esm(() => {
16656
16663
  PROVIDER_COST_PRIORS = {
16657
16664
  "openai-codex": { cacheRead: 0.1, cacheWrite: 1, output: 4 },
@@ -16714,6 +16721,7 @@ var init_constants = __esm(() => {
16714
16721
  SESSION_TTL_D: 8,
16715
16722
  SESSIONS_MAX: 2048
16716
16723
  };
16724
+ SLOWER_FACTOR = 2 / 3;
16717
16725
  });
16718
16726
 
16719
16727
  // src/auth/accounts/allowance/capacity.ts
@@ -20049,7 +20057,8 @@ function trajectory(s, now, horizonMs, cal, cfg) {
20049
20057
  blocked: [],
20050
20058
  switches: [],
20051
20059
  lostAtReset: {},
20052
- historyByAccount
20060
+ historyByAccount,
20061
+ slower: { factor: SLOWER_FACTOR, switches: [], blocked: [] }
20053
20062
  };
20054
20063
  if (evidenceOf(s, now) === "none" || all.length === 0)
20055
20064
  return empty;
@@ -20062,19 +20071,23 @@ function trajectory(s, now, horizonMs, cal, cfg) {
20062
20071
  const alertCfg = alertModelConfig(cfg);
20063
20072
  const paths = trajPaths(alertCfg);
20064
20073
  const results = [];
20074
+ const slowerResults = [];
20075
+ const run = (drawn, demand) => simulate(drawn, demand, cfg, {
20076
+ now,
20077
+ strategy: STRATEGIES[alertCfg.strategy],
20078
+ thread: { account: null, lastSwitchAt: null, contextTokens: null },
20079
+ poolActive: s.poolActive ?? null,
20080
+ horizonMs
20081
+ });
20065
20082
  for (let p = 0;p < paths; p++) {
20066
20083
  const demand = sampleDemandPath(model, rng);
20067
20084
  const drawn = views.map((v) => drawCapacity(v, rng));
20068
- results.push(simulate(drawn, demand, cfg, {
20069
- now,
20070
- strategy: STRATEGIES[alertCfg.strategy],
20071
- thread: { account: null, lastSwitchAt: null, contextTokens: null },
20072
- poolActive: s.poolActive ?? null,
20073
- horizonMs
20074
- }));
20085
+ results.push(run(drawn, demand));
20086
+ slowerResults.push(run(drawn, demand.map((d) => d * SLOWER_FACTOR)));
20075
20087
  }
20076
20088
  const h0 = hourStart(now);
20077
20089
  const forecast = [];
20090
+ const slowerForecast = [];
20078
20091
  for (let k = 0;k < buckets; k++) {
20079
20092
  const at = h0 + k * HOUR_MS14;
20080
20093
  if (at > end)
@@ -20087,6 +20100,8 @@ function trajectory(s, now, horizonMs, cal, cfg) {
20087
20100
  blocked++;
20088
20101
  }
20089
20102
  forecast.push({ at, q: quantilesOf2(values), pBlocked: blocked / paths });
20103
+ const slowerBlocked = slowerResults.filter((r) => r.blocked[k]?.blocked).length;
20104
+ slowerForecast.push({ at, q: forecast[k].q, pBlocked: slowerBlocked / paths });
20090
20105
  }
20091
20106
  return {
20092
20107
  unit,
@@ -20096,7 +20111,12 @@ function trajectory(s, now, horizonMs, cal, cfg) {
20096
20111
  blocked: blockedRuns(results, forecast),
20097
20112
  switches: switchesOf2(results, views, s.poolActive ?? null, now, end),
20098
20113
  lostAtReset: lostAtResetOf(results, views),
20099
- historyByAccount
20114
+ historyByAccount,
20115
+ slower: {
20116
+ factor: SLOWER_FACTOR,
20117
+ switches: switchesOf2(slowerResults, views, s.poolActive ?? null, now, end),
20118
+ blocked: blockedRuns(slowerResults, slowerForecast)
20119
+ }
20100
20120
  };
20101
20121
  }
20102
20122
  function sparkline(t, cells) {
@@ -22818,6 +22838,19 @@ function likelihoodView(l) {
22818
22838
  last--;
22819
22839
  return { start: iso2(l.start + first * HOUR_MS16), stepHours: 1, p: p.slice(first, last + 1) };
22820
22840
  }
22841
+ function switchView(sw) {
22842
+ return {
22843
+ accountId: sw.account,
22844
+ soonest: iso2(sw.q.p10),
22845
+ usual: iso2(sw.q.p50),
22846
+ latest: iso2(sw.q.p90),
22847
+ probability: Math.min(1, Math.max(0, sw.probability)),
22848
+ likelihood: likelihoodView(sw.likelihood)
22849
+ };
22850
+ }
22851
+ function blockedView(b) {
22852
+ return { from: iso2(b.from.p50), to: iso2(b.to.p50), kind: b.kind, probability: b.probability };
22853
+ }
22821
22854
  function sustainableOf(top, pace, burnLong) {
22822
22855
  const long = Number.isFinite(burnLong) ? Math.max(0, burnLong) : 0;
22823
22856
  if (top)
@@ -22944,24 +22977,17 @@ function buildReport(input) {
22944
22977
  window: r.window,
22945
22978
  projected: r.projected
22946
22979
  })),
22947
- blocked: traj.blocked.map((b) => ({
22948
- from: iso2(b.from.p50),
22949
- to: iso2(b.to.p50),
22950
- kind: b.kind,
22951
- probability: b.probability
22952
- })),
22980
+ blocked: traj.blocked.map(blockedView),
22953
22981
  historyByAccount: none ? [] : views.filter((v) => traj.historyByAccount[v.account] !== undefined).map((v) => ({
22954
22982
  accountId: v.account,
22955
22983
  history: (traj.historyByAccount[v.account] ?? []).filter((h) => h.at >= now - 24 * HOUR_MS16).map((h) => ({ at: iso2(h.at), remaining: h.remaining, provenance: h.provenance }))
22956
22984
  })),
22957
- switches: traj.switches.map((sw) => ({
22958
- accountId: sw.account,
22959
- soonest: iso2(sw.q.p10),
22960
- usual: iso2(sw.q.p50),
22961
- latest: iso2(sw.q.p90),
22962
- probability: Math.min(1, Math.max(0, sw.probability)),
22963
- likelihood: likelihoodView(sw.likelihood)
22964
- })),
22985
+ switches: traj.switches.map(switchView),
22986
+ slower: {
22987
+ factor: Math.round(traj.slower.factor * 1000) / 1000,
22988
+ switches: traj.slower.switches.map(switchView),
22989
+ blocked: traj.slower.blocked.map(blockedView)
22990
+ },
22965
22991
  spark48: sparkline({
22966
22992
  ...traj,
22967
22993
  history: traj.history.filter((h) => h.at >= now - 24 * HOUR_MS16),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "14.8.0",
3
+ "version": "14.9.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.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"
74
+ "@claudish/magmux-darwin-arm64": "14.9.0",
75
+ "@claudish/magmux-darwin-x64": "14.9.0",
76
+ "@claudish/magmux-linux-arm64": "14.9.0",
77
+ "@claudish/magmux-linux-x64": "14.9.0"
78
78
  },
79
79
  "author": "Jack Rudenko <i@madappgang.com>",
80
80
  "license": "MIT",