@bivelio/savings-layer 0.5.0 → 0.5.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/dist/index.d.ts CHANGED
@@ -154,7 +154,7 @@ declare function precioDeLista(model: string, at?: Date | number): CostModel | u
154
154
  * on the customer's machine. `test/version-declarada.test.ts` ties this
155
155
  * constant to package.json so the two can never drift.
156
156
  */
157
- declare const BV_SALA_VERSION = "0.5.0";
157
+ declare const BV_SALA_VERSION = "0.5.1";
158
158
 
159
159
  /** How the layer served a request that is eligible for a verification check. */
160
160
  type VerificationStratum =
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ for(let n of Yp[t]??[])if(!(n.vigenteDesde!==void 0&&e<n.vigenteDesde)&&!(n.vige
28
28
  p-research","o4-mini-deep-research","gpt-5.5-pro","gpt-5.4-pro","gpt-5.2-pro","gpt-5-pro","gpt-5.5-cyber","gemini-3.8-flash-tts","gemini-3.8-flash-lite-tts","gemini-3.1-flash-lite-image"],Xo={...qt,...Object.
29
29
  fromEntries(Qp.map(t=>[t,null]))},Xp=ti(Xo);function gn(t,e){let n=Ut(t);return n===void 0?void 0:Ka(n,Ja(e))}var ef=Object.fromEntries(Object.keys(Xo).map(t=>[t,Xo[t]===null?null:t]));function Ut(t){
30
30
  return ei(ef,Xp,t)??void 0}var tf=/^\d{4}-?\d{2}-?\d{2}$/;function st(t,e){let n=Ut(t);if(n===void 0)return;let r=t.lastIndexOf("/"),o=r>=0?t.slice(r+1):t;if(!(n!==t&&n!==o&&!tf.test(o.slice(n.length+
31
- 1))))return Ka(n,Ja(e))}var He="0.5.0",fr="x-bvsala-version";var nf=["exact","task_equivalent","not_verified","bounded_degradation","rejected"];function rf(t){return {v:1,task:t.task,goal:t.goal,rules:t.rules??[],facts:t.facts??[],refs:t.refs??[],...t.delta?{delta:t.delta}:{},outputContract:t.outputContract}}var mr=class{id;exact=false;constructor(e="heuristic"){this.id=e;}count(e){if(e.length===0)return 0;let n=e.match(/[A-Za-z]+|\d+|\s+|[^\sA-Za-z\d]/g)??[],r=0;for(let o of n){let i=o[0];if(/\s/.test(i)){let s=(o.
31
+ 1))))return Ka(n,Ja(e))}var He="0.5.1",fr="x-bvsala-version";var nf=["exact","task_equivalent","not_verified","bounded_degradation","rejected"];function rf(t){return {v:1,task:t.task,goal:t.goal,rules:t.rules??[],facts:t.facts??[],refs:t.refs??[],...t.delta?{delta:t.delta}:{},outputContract:t.outputContract}}var mr=class{id;exact=false;constructor(e="heuristic"){this.id=e;}count(e){if(e.length===0)return 0;let n=e.match(/[A-Za-z]+|\d+|\s+|[^\sA-Za-z\d]/g)??[],r=0;for(let o of n){let i=o[0];if(/\s/.test(i)){let s=(o.
32
32
  match(/\n/g)??[]).length;r+=s+Math.floor(Math.max(0,o.length-1)/2);}else /[A-Za-z]/.test(i)?r+=Math.max(1,Math.ceil(o.length/4)):/\d/.test(i)?r+=Math.max(1,Math.ceil(o.length/2)):r+=1;}return Math.max(r,
33
33
  Math.ceil(e.length/4))}},St=new mr;var hr=class{estimators=new Map;modelToTokenizer=new Map;fallbackId;constructor(e=St){this.fallbackId=e.id,this.estimators.set(e.id,e);}register(e){return this.estimators.set(e.id,e),this}mapModel(e,n){
34
34
  return this.modelToTokenizer.set(e,n),this}resolve(e){let n=e.tokenizer?this.estimators.get(e.tokenizer):void 0;if(n)return n;if(e.model){let r=this.modelToTokenizer.get(e.model);if(r){let o=this.estimators.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bivelio/savings-layer",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "The savings layer for your LLM bill: a library inside your code that lets through only what has to be paid for and returns a SavingsReport per call, measured with your provider's own meter and kept apart from estimates. Commercial license, paid per seat, commission only on measured savings. Your prompts never leave your infrastructure.",
5
5
  "keywords": [
6
6
  "llm",
@@ -114,6 +114,7 @@
114
114
  "corpus:arnes": "tsx corpus/arnes/informe.ts",
115
115
  "corpus:auditar": "tsx corpus/auditoria/auditar.ts",
116
116
  "sombra:corpus": "tsx benchmarks/sombra-corpus.ts",
117
+ "ttl:replay": "tsx benchmarks/ttl/replay.ts",
117
118
  "compactacion:banco": "tsx benchmarks/compactacion-de-cola/banco.ts",
118
119
  "sombra:diales": "tsx --env-file-if-exists=.env.bench benchmarks/sombra-diales.ts",
119
120
  "anillo1": "tsx --env-file-if-exists=.env.bench benchmarks/anillo1/arnes.ts",