budget-guard 0.1.0 → 0.1.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/cost.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { Usage } from './types';
1
+ import type { Usage } from './types.js';
2
2
  /** 토큰 사용량을 가격표 기준 USD 비용으로 환산한다. */
3
3
  export declare function cost(model: string, usage: Usage): number;
package/dist/cost.js CHANGED
@@ -1,4 +1,4 @@
1
- import { PRICES } from './pricing';
1
+ import { PRICES } from './pricing.js';
2
2
  /** 토큰 사용량을 가격표 기준 USD 비용으로 환산한다. */
3
3
  export function cost(model, usage) {
4
4
  const p = PRICES[model];
package/dist/guard.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { GuardOptions, Usage } from './types';
1
+ import type { GuardOptions, Usage } from './types.js';
2
2
  /** 호출별 비용 이벤트 (대시보드/로그용). */
3
3
  export interface SpendEvent {
4
4
  project: string;
package/dist/guard.js CHANGED
@@ -1,5 +1,5 @@
1
- import { cost } from './cost';
2
- import { normalizeUsage } from './usage';
1
+ import { cost } from './cost.js';
2
+ import { normalizeUsage } from './usage.js';
3
3
  /** 캡 초과로 호출이 차단될 때 던지는 에러. */
4
4
  export class BudgetExceededError extends Error {
5
5
  project;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { guard, spendReport, BudgetExceededError } from './guard';
2
- export { cost } from './cost';
3
- export { normalizeUsage } from './usage';
4
- export { PRICES } from './pricing';
5
- export type { Usage, GuardOptions } from './types';
6
- export type { SpendEvent } from './guard';
1
+ export { guard, spendReport, BudgetExceededError } from './guard.js';
2
+ export { cost } from './cost.js';
3
+ export { normalizeUsage } from './usage.js';
4
+ export { PRICES } from './pricing.js';
5
+ export type { Usage, GuardOptions } from './types.js';
6
+ export type { SpendEvent } from './guard.js';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { guard, spendReport, BudgetExceededError } from './guard';
2
- export { cost } from './cost';
3
- export { normalizeUsage } from './usage';
4
- export { PRICES } from './pricing';
1
+ export { guard, spendReport, BudgetExceededError } from './guard.js';
2
+ export { cost } from './cost.js';
3
+ export { normalizeUsage } from './usage.js';
4
+ export { PRICES } from './pricing.js';
package/dist/usage.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Usage } from './types';
1
+ import type { Usage } from './types.js';
2
2
  /**
3
3
  * 제공자별 usage 형태를 {input, output} 토큰으로 정규화한다.
4
4
  * - 우리 형태: { input, output }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "budget-guard",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A circuit breaker for your LLM API bill — hard budget caps + per-feature cost attribution for the OpenAI & Anthropic APIs.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",