@zonastery/bursar 0.0.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.
Files changed (70) hide show
  1. package/README.md +375 -0
  2. package/dist/allowance.d.ts +48 -0
  3. package/dist/allowance.d.ts.map +1 -0
  4. package/dist/allowance.js +140 -0
  5. package/dist/allowance.js.map +1 -0
  6. package/dist/breakdown.d.ts +27 -0
  7. package/dist/breakdown.d.ts.map +1 -0
  8. package/dist/breakdown.js +27 -0
  9. package/dist/breakdown.js.map +1 -0
  10. package/dist/config.d.ts +23 -0
  11. package/dist/config.d.ts.map +1 -0
  12. package/dist/config.js +278 -0
  13. package/dist/config.js.map +1 -0
  14. package/dist/engine.d.ts +44 -0
  15. package/dist/engine.d.ts.map +1 -0
  16. package/dist/engine.js +172 -0
  17. package/dist/engine.js.map +1 -0
  18. package/dist/errors.d.ts +55 -0
  19. package/dist/errors.d.ts.map +1 -0
  20. package/dist/errors.js +55 -0
  21. package/dist/errors.js.map +1 -0
  22. package/dist/expr.d.ts +65 -0
  23. package/dist/expr.d.ts.map +1 -0
  24. package/dist/expr.js +681 -0
  25. package/dist/expr.js.map +1 -0
  26. package/dist/index.d.ts +20 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +14 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/load-pricing-file.d.ts +12 -0
  31. package/dist/load-pricing-file.d.ts.map +1 -0
  32. package/dist/load-pricing-file.js +45 -0
  33. package/dist/load-pricing-file.js.map +1 -0
  34. package/dist/manager.d.ts +421 -0
  35. package/dist/manager.d.ts.map +1 -0
  36. package/dist/manager.js +1112 -0
  37. package/dist/manager.js.map +1 -0
  38. package/dist/metrics.d.ts +19 -0
  39. package/dist/metrics.d.ts.map +1 -0
  40. package/dist/metrics.js +2 -0
  41. package/dist/metrics.js.map +1 -0
  42. package/dist/node.d.ts +15 -0
  43. package/dist/node.d.ts.map +1 -0
  44. package/dist/node.js +15 -0
  45. package/dist/node.js.map +1 -0
  46. package/dist/stores/credit-store.d.ts +171 -0
  47. package/dist/stores/credit-store.d.ts.map +1 -0
  48. package/dist/stores/credit-store.js +52 -0
  49. package/dist/stores/credit-store.js.map +1 -0
  50. package/dist/stores/events.d.ts +63 -0
  51. package/dist/stores/events.d.ts.map +1 -0
  52. package/dist/stores/events.js +68 -0
  53. package/dist/stores/events.js.map +1 -0
  54. package/dist/stores/memory-store.d.ts +178 -0
  55. package/dist/stores/memory-store.d.ts.map +1 -0
  56. package/dist/stores/memory-store.js +1833 -0
  57. package/dist/stores/memory-store.js.map +1 -0
  58. package/dist/stores/postgres-store.d.ts +95 -0
  59. package/dist/stores/postgres-store.d.ts.map +1 -0
  60. package/dist/stores/postgres-store.js +872 -0
  61. package/dist/stores/postgres-store.js.map +1 -0
  62. package/dist/stores/supabase-store.d.ts +76 -0
  63. package/dist/stores/supabase-store.d.ts.map +1 -0
  64. package/dist/stores/supabase-store.js +865 -0
  65. package/dist/stores/supabase-store.js.map +1 -0
  66. package/dist/types.d.ts +462 -0
  67. package/dist/types.d.ts.map +1 -0
  68. package/dist/types.js +2 -0
  69. package/dist/types.js.map +1 -0
  70. package/package.json +82 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expr.js","sourceRoot":"","sources":["../src/expr.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,6EAA6E;AAC7E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC;AAC1B,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;AAEpD,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,MAAM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export { PricingEngine } from "./engine.js";
2
+ export type { AllowancePeriod, FeatureLimitPeriod } from "./allowance.js";
3
+ export { resolveAllowanceWindow, resolveCalendarWindow } from "./allowance.js";
4
+ export type { CostBreakdown } from "./breakdown.js";
5
+ export { makeCostBreakdown } from "./breakdown.js";
6
+ export type { ToolCall, UsageMetrics } from "./metrics.js";
7
+ export type { PricingConfig } from "./config.js";
8
+ export { loadConfigFromDict } from "./config.js";
9
+ export { CapabilityNotSupportedError, CapReachedError, ConcurrencyLimitError, ConfigError, ExpressionError, FeatureLimitReachedError, FeatureNotEntitledError, ImportError, InsufficientCreditsError, LeaseExpiredError, LeaseNotFoundError, PricingNotLoadedError, RefundError, StoreError, } from "./errors.js";
10
+ export { validateExpression, evaluateExpression } from "./expr.js";
11
+ export { CreditManager } from "./manager.js";
12
+ export type { CanAffordOptions, CreditManagerOptions, LowBalanceConfig, PolicyPreset, ReserveOptions, RunBilledOptions, SettleOptions, } from "./manager.js";
13
+ export type { AddCreditsResult, AddTeamMemberResult, AggregateStats, AllowanceResult, AvailableResult, BalanceResult, BillingMode, CanAffordResult, CapCheckResult, CheckFeatureResult, CreateTeamResult, CreditMetadata, DailySpendRow, DeductionResult, DeductWithAllowanceOptions, FeatureLimit, FeatureLimitResult, GetUserPlanResult, LeaseResult, OperationPolicy, PlanDefinition, PricingConfigData, PricingConfigResult, RefundResult, ReleaseResult, SetUserPlanResult, SetupResult, SpendByModelRow, SpendByUserRow, ListTransactionsOptions, ListUsageEventsOptions, PaginatedTransactions, UserTransactionRow, SpendCap, SweepResult, Team, TeamBalanceResult, TeamDeductionResult, TeamMember, TierBalance, TierBalancesResult, TierDefinition, TopUserRow, } from "./types.js";
14
+ export type { CreateLeaseOptions, SettleLeaseOptions } from "./stores/credit-store.js";
15
+ export { CreditStore } from "./stores/credit-store.js";
16
+ export { HttpxSupabaseStore } from "./stores/supabase-store.js";
17
+ export { PostgresStore } from "./stores/postgres-store.js";
18
+ export type { CreditEvent, CreditEventType } from "./stores/events.js";
19
+ export { CreditEventEmitter } from "./stores/events.js";
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,EACX,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,eAAe,EACf,0BAA0B,EAC1B,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,UAAU,GACX,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ export { PricingEngine } from "./engine.js";
2
+ export { resolveAllowanceWindow, resolveCalendarWindow } from "./allowance.js";
3
+ export { makeCostBreakdown } from "./breakdown.js";
4
+ export { loadConfigFromDict } from "./config.js";
5
+ export { CapabilityNotSupportedError, CapReachedError, ConcurrencyLimitError, ConfigError, ExpressionError, FeatureLimitReachedError, FeatureNotEntitledError, ImportError, InsufficientCreditsError, LeaseExpiredError, LeaseNotFoundError, PricingNotLoadedError, RefundError, StoreError, } from "./errors.js";
6
+ export { validateExpression, evaluateExpression } from "./expr.js";
7
+ // Manager
8
+ export { CreditManager } from "./manager.js";
9
+ // Stores
10
+ export { CreditStore } from "./stores/credit-store.js";
11
+ export { HttpxSupabaseStore } from "./stores/supabase-store.js";
12
+ export { PostgresStore } from "./stores/postgres-store.js";
13
+ export { CreditEventEmitter } from "./stores/events.js";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEnE,UAAU;AACV,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA6D7C,SAAS;AACT,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Read a JSON or YAML pricing config file from disk.
3
+ *
4
+ * Returns the raw parsed dict (suitable for ``loadConfigFromDict`` or
5
+ * ``PricingEngine.fromDict``).
6
+ *
7
+ * For YAML files the optional peer dep ``js-yaml`` is loaded on demand. If it
8
+ * is not installed, an {@link ImportError} is thrown so callers get a clear,
9
+ * typed message (contract §4 / L4).
10
+ */
11
+ export declare function loadPricingFile(filepath: string): Promise<Record<string, unknown>>;
12
+ //# sourceMappingURL=load-pricing-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-pricing-file.d.ts","sourceRoot":"","sources":["../src/load-pricing-file.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAexF"}
@@ -0,0 +1,45 @@
1
+ import { readFileSync } from "fs";
2
+ import { ImportError } from "./errors.js";
3
+ /**
4
+ * Narrow an unknown dynamic-import result to the `js-yaml` shape we use.
5
+ *
6
+ * The result of `import()` is treated as `unknown` and validated (L12): the
7
+ * module may expose `load` directly or under a CJS-interop `default` export.
8
+ */
9
+ function asYamlModule(mod) {
10
+ const candidate = mod;
11
+ if (typeof candidate.load === "function") {
12
+ return candidate;
13
+ }
14
+ if (candidate.default && typeof candidate.default.load === "function") {
15
+ return candidate.default;
16
+ }
17
+ throw new ImportError("js-yaml is installed but does not export a `load` function");
18
+ }
19
+ /**
20
+ * Read a JSON or YAML pricing config file from disk.
21
+ *
22
+ * Returns the raw parsed dict (suitable for ``loadConfigFromDict`` or
23
+ * ``PricingEngine.fromDict``).
24
+ *
25
+ * For YAML files the optional peer dep ``js-yaml`` is loaded on demand. If it
26
+ * is not installed, an {@link ImportError} is thrown so callers get a clear,
27
+ * typed message (contract §4 / L4).
28
+ */
29
+ export async function loadPricingFile(filepath) {
30
+ if (filepath.endsWith(".yaml") || filepath.endsWith(".yml")) {
31
+ let mod;
32
+ try {
33
+ mod = await import("js-yaml");
34
+ }
35
+ catch (cause) {
36
+ throw new ImportError("js-yaml required for YAML files: npm install js-yaml", { cause });
37
+ }
38
+ const yaml = asYamlModule(mod);
39
+ const content = readFileSync(filepath, "utf-8");
40
+ return yaml.load(content);
41
+ }
42
+ const content = readFileSync(filepath, "utf-8");
43
+ return JSON.parse(content);
44
+ }
45
+ //# source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AE,OAAO,CAAC,CAAC;IAChD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAA4B,CAAC;AACxD,CAAC"}
@@ -0,0 +1,421 @@
1
+ import Decimal from "decimal.js";
2
+ import type { PricingEngine } from "./engine.js";
3
+ import type { AddCreditsResult, AggregateStats, AllowanceResult, AvailableResult, BalanceResult, BillingMode, CanAffordResult, CheckFeatureResult, CreditMetadata, DailySpendRow, DeductionResult, FeatureLimitResult, GetUserPlanResult, LeaseResult, PricingConfigData, RefundResult, ReleaseResult, SetupResult, SpendByModelRow, SpendByUserRow, SweepResult, TeamDeductionResult, TierBalancesResult, TopUserRow } from "./types.js";
4
+ import type { ListTransactionsOptions, ListUsageEventsOptions, PaginatedTransactions } from "./types.js";
5
+ import type { CreditStore } from "./stores/credit-store.js";
6
+ import type { CreditEvent, CreditEventEmitter } from "./stores/events.js";
7
+ import type { UsageMetrics } from "./metrics.js";
8
+ /** A financial-safety constructor preset (interface plan §2). */
9
+ export type PolicyPreset = "strict_prepaid" | "overdraft";
10
+ /** A cost input: either usage metrics (priced via the engine) or a raw amount. */
11
+ type MetricsOrAmount = UsageMetrics | Decimal | number;
12
+ /**
13
+ * Multi-level ``credits.low_balance`` configuration (WS7 — collapses the
14
+ * former ``lowBalanceThreshold`` / ``lowBalanceThresholds`` / ``onLowBalance``
15
+ * trio into one option). Each threshold is edge-triggered once per descent and
16
+ * re-arms after a top-up (interface plan §6). When ``lowBalance`` is omitted
17
+ * entirely, the manager falls back to ``[minBalance * LOW_BALANCE_MULTIPLIER]``,
18
+ * resolved lazily against the loaded engine.
19
+ */
20
+ export interface LowBalanceConfig {
21
+ thresholds?: (Decimal | number)[] | null;
22
+ onTrigger?: ((event: CreditEvent) => void | Promise<void>) | null;
23
+ }
24
+ /** Optional behavioural knobs for the manager. */
25
+ export interface CreditManagerOptions {
26
+ /**
27
+ * Financial-safety preset for planless users (interface plan §2). Defaults to
28
+ * ``"strict_prepaid"``. Per-plan / per-call policy layers on top of this.
29
+ */
30
+ policy?: PolicyPreset;
31
+ /** Negative balance floor for the ``overdraft`` preset (interface plan §1). */
32
+ overdraftFloor?: Decimal | number | null;
33
+ /** Default ``maxConcurrent`` lease bound applied by the preset. */
34
+ maxConcurrent?: number | null;
35
+ /**
36
+ * ``credits.low_balance`` thresholds and handler (interface plan §6). When
37
+ * omitted, the manager uses ``[engine.minBalance * 2]`` (documented default,
38
+ * M18), resolved lazily. The event is **edge-triggered**: each configured
39
+ * level fires only on the deduction that crosses it from above, never
40
+ * repeatedly while already below it, and re-arms on top-up.
41
+ */
42
+ lowBalance?: LowBalanceConfig | null;
43
+ /** Default lease TTL (seconds) for ``reserve``/``runBilled`` (default 600). */
44
+ defaultTtlSeconds?: number;
45
+ /**
46
+ * Enable lazy-on-read credit expiry (default ``false``, unchanged behaviour).
47
+ *
48
+ * Allowance windows and lease TTLs are already lazy-on-read (checked via
49
+ * `expiresAt`/window filters at read time); credit expiry otherwise requires
50
+ * an explicit ``sweepExpiredCredits`` call (e.g. from a cron job). When
51
+ * ``true``, the manager transparently sweeps a user's own expired credits
52
+ * (scoped to that user — never a global sweep) before ``getBalance``,
53
+ * ``getCreditTiers``, ``deduct``, ``deductFixed``, ``deductTeam``,
54
+ * ``reserve``, and ``settle`` so a caller never needs to run a cron job.
55
+ */
56
+ lazyExpiry?: boolean;
57
+ }
58
+ /** Options for {@link CreditManager.reserve}. */
59
+ export interface ReserveOptions {
60
+ operationType?: string;
61
+ billingMode?: BillingMode | null;
62
+ requiredFeature?: string | null;
63
+ ttl?: number | null;
64
+ metadata?: CreditMetadata | null;
65
+ /** Named feature to enforce/tag a per-feature invocation-count limit for (independent of `requiredFeature`). */
66
+ feature?: string | null;
67
+ }
68
+ /** Options for {@link CreditManager.settle}. */
69
+ export interface SettleOptions {
70
+ idempotencyKey?: string | null;
71
+ metadata?: CreditMetadata | null;
72
+ /**
73
+ * The same feature name supplied to `reserve` — re-supplied at settle time
74
+ * for accurate per-feature invocation-count accounting, exactly like `model`
75
+ * is re-supplied at settle for per-model spend-cap accuracy.
76
+ */
77
+ feature?: string | null;
78
+ }
79
+ /** Options for {@link CreditManager.canAfford}. */
80
+ export interface CanAffordOptions {
81
+ requiredFeature?: string | null;
82
+ billingMode?: BillingMode | null;
83
+ operationType?: string;
84
+ }
85
+ /** Options for {@link CreditManager.grantSubscriptionCycle}. */
86
+ export interface GrantSubscriptionCycleOptions {
87
+ /** Target credit tier for the granted cycle. Defaults to ``"subscription"``. */
88
+ tier?: string;
89
+ /** Explicit expiry for the granted cycle. Mutually exclusive with ``ttlDays``. */
90
+ expiresAt?: Date;
91
+ /** TTL in days from now for the granted cycle. Mutually exclusive with ``expiresAt``. */
92
+ ttlDays?: number;
93
+ /**
94
+ * Expire any remaining balance in ``tier`` before granting the new cycle
95
+ * (default ``true``) — the usual "use it or lose it" subscription semantics.
96
+ * When ``false``, the new cycle's credits are added on top of any leftover
97
+ * balance.
98
+ */
99
+ replacePrior?: boolean;
100
+ /** Optional plan to assign after granting (e.g. resolved from a webhook's price/plan id). */
101
+ planKey?: string;
102
+ /**
103
+ * Replay-safe idempotency key — safe to call again with the same key on
104
+ * webhook redelivery (e.g. Stripe's at-least-once delivery guarantee).
105
+ */
106
+ idempotencyKey?: string;
107
+ metadata?: CreditMetadata | null;
108
+ }
109
+ /** Options for {@link CreditManager.runBilled}. */
110
+ export interface RunBilledOptions<T> {
111
+ estimate: MetricsOrAmount;
112
+ doWork: () => Promise<{
113
+ result: T;
114
+ actual: MetricsOrAmount;
115
+ }>;
116
+ operationType?: string;
117
+ billingMode?: BillingMode | null;
118
+ requiredFeature?: string | null;
119
+ idempotencyKey?: string | null;
120
+ ttl?: number | null;
121
+ /** Named feature to enforce/tag a per-feature invocation-count limit for (independent of `requiredFeature`). */
122
+ feature?: string | null;
123
+ }
124
+ /**
125
+ * Orchestrates credit operations.
126
+ *
127
+ * The deduction path is a single atomic, idempotency-keyed store call
128
+ * (``deductWithAllowance``) that consumes free allowance, enforces spend caps,
129
+ * applies the balance floor and debits the net amount in one transaction
130
+ * (contract §2). The manager is a thin layer that calculates the cost, maps
131
+ * the store's typed ``error`` codes to exceptions, and emits lifecycle events
132
+ * **only after** the operation has succeeded (contract §6).
133
+ *
134
+ * Optionally accepts a ``CreditEventEmitter`` to emit lifecycle events
135
+ * (deducted, deduct_failed, added, refunded, refund_failed, expired,
136
+ * cap_reached, cap_warning, low_balance).
137
+ */
138
+ export declare class CreditManager {
139
+ private store;
140
+ private engine;
141
+ private emitter;
142
+ private policy;
143
+ private overdraftFloor;
144
+ private defaultMaxConcurrent;
145
+ private defaultTtl;
146
+ private lowBalanceThresholds;
147
+ private onLowBalance;
148
+ private lazyExpiry;
149
+ private lbBelow;
150
+ constructor(store: CreditStore, engine?: PricingEngine | null, emitter?: CreditEventEmitter | null, options?: CreditManagerOptions | null);
151
+ /** Emit a credit lifecycle event. No-op if no emitter is configured. */
152
+ private emit;
153
+ /** The configured min-balance floor as a `Decimal` (defaults to 0). */
154
+ private minBalanceDecimal;
155
+ /**
156
+ * Resolve the single `low_balance` threshold used by the ``deduct`` fast path:
157
+ * the lowest configured level when ``lowBalance.thresholds`` is set, otherwise
158
+ * ``minBalance * LOW_BALANCE_MULTIPLIER`` (documented default).
159
+ */
160
+ private resolveLowBalanceThreshold;
161
+ /** Run bundled SQL migrations through the store. */
162
+ setup(): Promise<SetupResult>;
163
+ /** Load pricing from a PricingConfigData or raw dict and sync it. */
164
+ publishPricingFromDict(data: PricingConfigData | Record<string, unknown>): Promise<void>;
165
+ /** Load the active pricing config from the store. */
166
+ loadPricingFromStore(): Promise<void>;
167
+ /**
168
+ * Publish new pricing and update the engine in one call.
169
+ *
170
+ * H10: the store write is now **awaited** (was a fire-and-forget `void`), so
171
+ * a persistence failure surfaces to the caller instead of becoming an
172
+ * unhandled promise rejection.
173
+ */
174
+ publishPricing(config: PricingConfigData, label?: string | null): Promise<void>;
175
+ /** The current PricingEngine, or null if not loaded. */
176
+ get pricingEngine(): PricingEngine | null;
177
+ /** Fetch a user's current plan (including feature entitlements). */
178
+ getUserPlan(userId: string): Promise<GetUserPlanResult>;
179
+ /**
180
+ * Set a user's subscription plan and emit ``credits.plan_changed``.
181
+ *
182
+ * The store call is awaited so a persistence failure surfaces to the caller.
183
+ * The event is emitted only after the store write succeeds (contract §6).
184
+ */
185
+ setUserPlan(userId: string, planKey: string): Promise<void>;
186
+ /**
187
+ * Check whether a user's plan has a specific feature entitlement.
188
+ *
189
+ * Passthrough to the store, which distinguishes *presence* from *truthiness*
190
+ * (numeric `0` / `""` count as present; only `null`/`undefined`/`false`/absent
191
+ * read as missing — contract §5 / M6).
192
+ */
193
+ checkFeature(userId: string, feature: string): Promise<CheckFeatureResult>;
194
+ /**
195
+ * Advisory, non-locking read of a per-feature invocation-count limit (UI only).
196
+ *
197
+ * Resolves the `FeatureLimit` (if any) from the user's plan and the
198
+ * calendar-aligned window, then delegates counting to the store. Returns
199
+ * `limited: false` (zeroed fields, `action: null`) when no `FeatureLimit`
200
+ * is configured for `feature` on the user's plan — never used for
201
+ * admission control; that is exclusively the atomic check-and-increment
202
+ * inside `deduct`/`reserve`.
203
+ */
204
+ checkFeatureLimit(userId: string, feature: string): Promise<FeatureLimitResult>;
205
+ /**
206
+ * Sweep a single user's own expired credits when ``options.lazyExpiry`` is
207
+ * enabled — no-op otherwise. Mirrors the fact that allowance windows and
208
+ * lease TTLs are already lazy-on-read; this closes the same gap for the
209
+ * stored aggregate expiry balance without requiring a cron job.
210
+ */
211
+ private maybeLazyExpire;
212
+ /** Get a user's current credit balance. */
213
+ getBalance(userId: string): Promise<BalanceResult>;
214
+ /** Add credits to a user's account. */
215
+ addCredits(userId: string, amount: Decimal | number, options?: {
216
+ type?: string;
217
+ metadata?: CreditMetadata | null;
218
+ expiresAt?: Date | null;
219
+ /** Target credit tier (credit tiers); omitted resolves to the config's default tier. */
220
+ tier?: string | null;
221
+ /** Replay-safe idempotency key (parity with `deduct`/`settle`/`refund`). */
222
+ idempotencyKey?: string | null;
223
+ }): Promise<AddCreditsResult>;
224
+ /**
225
+ * Grant one billing-cycle's worth of credits — idempotent-safe for a
226
+ * payment-provider webhook handler (Stripe, etc. — bursar stays
227
+ * provider-agnostic) to call even on webhook redelivery.
228
+ *
229
+ * 1. At most one of ``expiresAt``/``ttlDays`` may be given (throws
230
+ * ``ConfigError`` otherwise).
231
+ * 2. When ``ttlDays`` is given, ``expiresAt = now + ttlDays`` days.
232
+ * 3. When ``replacePrior`` (default ``true``), any remaining balance in
233
+ * ``tier`` is expired immediately via a direct ``store.addCredits``
234
+ * negative adjustment — naturally idempotent (a replay finds the tier
235
+ * already at zero and skips the call).
236
+ * 4. The new cycle is granted via a direct ``store.addCredits`` call
237
+ * (bypassing {@link addCredits} so only ``credits.cycle_renewed`` fires,
238
+ * not a duplicate ``credits.added``), threading ``idempotencyKey`` so a
239
+ * redelivered webhook replays the prior grant instead of double-crediting.
240
+ * 5. When ``planKey`` is given, assigns it via {@link setUserPlan}.
241
+ * 6. Emits ``credits.cycle_renewed`` and returns the grant result.
242
+ */
243
+ grantSubscriptionCycle(userId: string, amount: Decimal | number, options?: GrantSubscriptionCycleOptions): Promise<AddCreditsResult>;
244
+ /** The default {@link OperationPolicy} from the constructor preset (§2). */
245
+ private presetPolicy;
246
+ /**
247
+ * Resolve the effective policy: explicit arg → per-op → plan → preset (§1).
248
+ *
249
+ * A planless user (``planId`` is null) always gets the constructor preset, never
250
+ * silently unlimited (resolves M1). A user *with* a plan gets the plan default,
251
+ * then any ``perOperation`` override, then the explicit per-call ``billingMode``.
252
+ */
253
+ private resolvePolicy;
254
+ /** Admission floor for a policy: ``overdraftFloor`` (≤0) or ``minBalance`` (≥0). */
255
+ private resolveFloor;
256
+ /**
257
+ * Resolve the free-allowance period start for a user (WS9c).
258
+ *
259
+ * Fast path: a ``calendar_month`` plan (the default, and the vast majority of
260
+ * users) needs no computation — returns ``null`` and the store falls back to
261
+ * its own calendar-month window, exactly matching pre-WS9 behaviour. Only
262
+ * ``rolling_30d``/``anniversary`` plans pay the cost of resolving a window,
263
+ * anchored at the plan's ``planAssignedAt``.
264
+ */
265
+ private resolveAllowancePeriodStart;
266
+ /**
267
+ * Resolve the `FeatureLimit` (if any) configured for `feature` on the
268
+ * user's plan, plus the calendar-aligned `[start, end)` window it applies
269
+ * to (via {@link resolveCalendarWindow}).
270
+ *
271
+ * Returns `{ limit: null, periodStart: null, periodEnd: null }` when
272
+ * `feature` is omitted or no limit is configured for it — the store then
273
+ * skips enforcement entirely (mirrors `resolveAllowancePeriodStart`).
274
+ */
275
+ private resolveFeatureLimit;
276
+ /**
277
+ * Compute the credit cost and model from metrics, or pass a raw amount through.
278
+ *
279
+ * For {@link UsageMetrics} the cost is ``engine.calculate(...).total`` (exact
280
+ * `Decimal`, no truncation); a raw amount is used as-is with no model.
281
+ */
282
+ private costOf;
283
+ /** Map a store business code to the coherent typed exception (M2). */
284
+ private raiseLeaseError;
285
+ /**
286
+ * Atomically acquire a lease — the only admission control (D4).
287
+ *
288
+ * Resolves the effective policy, enforces ``requiredFeature``, sizes the hold
289
+ * from ``metricsOrAmount`` (worst-case in strict, estimate in overdraft — the
290
+ * caller chooses what to pass), and calls the store's atomic ``createLease``. On
291
+ * any business failure throws the coherent typed exception; on success emits
292
+ * ``credits.reserved`` and returns the {@link LeaseResult}.
293
+ */
294
+ reserve(userId: string, metricsOrAmount: MetricsOrAmount, options?: ReserveOptions): Promise<LeaseResult>;
295
+ /**
296
+ * Charge the ACTUAL cost against a lease and finalize it (D5).
297
+ *
298
+ * De-clamped: bills the full actual cost even if it exceeds the lease hold
299
+ * (overdraft). Never blocks on floor/cap at settle — a cap breach surfaces as a
300
+ * non-blocking ``credits.cap_warning``/``credits.cap_reached`` signal. Emits
301
+ * ``credits.deducted``, then multi-level ``credits.low_balance`` and a
302
+ * ``credits.overdraft`` signal if the balance went negative.
303
+ */
304
+ settle(userId: string, leaseId: string, metricsOrAmount: MetricsOrAmount, options?: SettleOptions): Promise<DeductionResult>;
305
+ /** Release a lease without charging (work failed/aborted) — idempotent (H1). */
306
+ release(userId: string, leaseId: string): Promise<ReleaseResult>;
307
+ /** Extend a lease's TTL for long batch/agentic jobs (B4). */
308
+ renew(userId: string, leaseId: string, ttl?: number | null): Promise<LeaseResult>;
309
+ /**
310
+ * Advisory affordability check — UI only, non-locking, may be stale (D4/H3).
311
+ *
312
+ * Never use this as an admission gate; only ``reserve`` is authoritative.
313
+ */
314
+ canAfford(userId: string, metricsOrAmount: MetricsOrAmount, options?: CanAffordOptions): Promise<CanAffordResult>;
315
+ /** Advisory ``available = balance − Σ active holds`` read (UI only, D4/H3). */
316
+ getAvailable(userId: string): Promise<AvailableResult>;
317
+ /** Get a user's per-tier credit balances (credit tiers). Thin pass-through, no event emission. */
318
+ getCreditTiers(userId: string): Promise<TierBalancesResult>;
319
+ /**
320
+ * Get remaining free allowance for the current billing period.
321
+ *
322
+ * Convenience wrapper that routes through the manager so callers never need
323
+ * to reach past it into the raw store. Returns a zero-allowance result for
324
+ * planless users (no exception).
325
+ *
326
+ * For ``rolling_30d``/``anniversary`` plans (WS9), resolves and threads
327
+ * ``periodStart`` so the reported window matches the one actually used by
328
+ * ``deduct``/``settle``/``reserve`` — a ``calendar_month`` plan (the default)
329
+ * takes the fast path unchanged.
330
+ */
331
+ checkAllowance(userId: string): Promise<AllowanceResult>;
332
+ /**
333
+ * One-call shortcut wiring reserve → doWork → settle (interface plan §4).
334
+ *
335
+ * ``doWork`` runs the operation and returns ``{ result, actual }`` where
336
+ * ``actual`` is the real usage metrics (or amount) to settle. On any exception
337
+ * from ``doWork`` the lease is released and the error re-raised. For long jobs
338
+ * ``doWork`` may call {@link renew}. A crash between reserve and settle is
339
+ * covered by the lease TTL (and the store's reaper).
340
+ */
341
+ runBilled<T>(userId: string, options: RunBilledOptions<T>): Promise<{
342
+ result: T;
343
+ deduction: DeductionResult;
344
+ }>;
345
+ /** Emit overdraft + multi-level low_balance after a balance-decreasing op. */
346
+ private postChargeSignals;
347
+ /** Edge-triggered low_balance: multi-level if configured, else single (§6). */
348
+ private emitLowBalance;
349
+ /** Emit ``credits.low_balance`` and invoke the non-blocking ``onLowBalance``. */
350
+ private fireLowBalance;
351
+ /**
352
+ * Full deduction flow as one atomic store call (contract §2).
353
+ *
354
+ * 1. ``breakdown = engine.calculate(metrics)``; ``cost = breakdown.total``
355
+ * (exact `Decimal`, **no truncation**).
356
+ * 2. If ``cost <= 0`` short-circuit with a zero-amount result.
357
+ * 3. Otherwise ``store.deductWithAllowance`` consumes allowance, enforces caps,
358
+ * applies the balance floor and debits — idempotency-keyed end-to-end.
359
+ *
360
+ * On a store ``error`` a ``credits.deduct_failed`` event is emitted and a
361
+ * typed exception is thrown (``insufficient_credits`` → InsufficientCreditsError,
362
+ * ``cap_reached`` → CapReachedError). No success event is emitted on error.
363
+ */
364
+ deduct(userId: string, metrics: UsageMetrics, idempotencyKey?: string | null, metadata?: CreditMetadata | null,
365
+ /** Named feature to enforce/tag a per-feature invocation-count limit for. */
366
+ feature?: string | null): Promise<DeductionResult>;
367
+ /**
368
+ * Refund a previous credit deduction.
369
+ *
370
+ * H3: the store's ``error`` is checked **before** emitting. A successful refund
371
+ * emits ``credits.refunded``; a failed/duplicate/over-refund emits
372
+ * ``credits.refund_failed`` and throws a typed ``RefundError`` (no success
373
+ * event is ever emitted for a failed refund).
374
+ */
375
+ refundCredits(transactionId: string, amount?: Decimal | number, reason?: string, metadata?: CreditMetadata | null): Promise<RefundResult>;
376
+ /**
377
+ * Deduct from a team's shared balance pool.
378
+ *
379
+ * Calculates the cost via the pricing engine (exact `Decimal`, no truncation),
380
+ * then debits the team balance. Threads an optional ``idempotencyKey`` through
381
+ * to the store so retried team charges are not double-counted (H12).
382
+ */
383
+ deductTeam(teamId: string, userId: string, metrics: UsageMetrics, idempotencyKey?: string | null, metadata?: CreditMetadata | null): Promise<TeamDeductionResult>;
384
+ /**
385
+ * Shortcut for fixed-cost batch jobs.
386
+ *
387
+ * L1: an unknown/typo'd ``jobName`` is rejected (throws) instead of silently
388
+ * charging 0 credits — ``engine.getFixedCost(jobName) === null`` means the job
389
+ * is not configured.
390
+ */
391
+ deductFixed(userId: string, jobName: string, idempotencyKey?: string | null, metadata?: CreditMetadata | null): Promise<DeductionResult>;
392
+ /**
393
+ * Sweep expired credits — global when ``userId`` is omitted, scoped to a
394
+ * single user when given (used by ``maybeLazyExpire``). Shared by the public
395
+ * ``sweepExpiredCredits`` (always global) and the lazy-on-read trigger.
396
+ */
397
+ private runSweep;
398
+ /**
399
+ * Sweep expired credits from all users' balances.
400
+ *
401
+ * When ``dryRun`` is true, reports what would be expired without modifying
402
+ * any balances. Unaffected by ``options.lazyExpiry`` — this always runs a
403
+ * global sweep; lazy expiry only scopes *automatic* per-user sweeps.
404
+ */
405
+ sweepExpiredCredits(dryRun?: boolean): Promise<SweepResult>;
406
+ /** Aggregate statistics across all users in a time window. */
407
+ aggregateStats(start: Date, end: Date): Promise<AggregateStats>;
408
+ /** Aggregate spend by user in a time window. */
409
+ spendByUser(start: Date, end: Date): Promise<SpendByUserRow[]>;
410
+ /** Aggregate spend by model in a time window. */
411
+ spendByModel(start: Date, end: Date): Promise<SpendByModelRow[]>;
412
+ /** List all user credit transactions with pagination. */
413
+ listUserTransactions(userId: string, options?: ListTransactionsOptions): Promise<PaginatedTransactions>;
414
+ listUsageEvents(userId: string, options?: ListUsageEventsOptions): Promise<PaginatedTransactions>;
415
+ /** Top users by spend in a time window with limit. */
416
+ topUsers(limit: number, start: Date, end: Date): Promise<TopUserRow[]>;
417
+ /** Daily spend aggregation in a time window. */
418
+ dailySpend(start: Date, end: Date): Promise<DailySpendRow[]>;
419
+ }
420
+ export {};
421
+ //# sourceMappingURL=manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../src/manager.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AAajC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KA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