spl-pay-per-suite 1.1.4 → 1.1.5

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/package.json +8 -7
  2. package/src/quote.mjs +26 -45
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spl-pay-per-suite",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "SPL Pay Per Suite — freemium (free first 1 GB · then ~1.5¢/GB), Stripe + x402. Library, CLI, MCP. Try Gate retired.",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
@@ -84,7 +84,7 @@
84
84
  "site": "https://www.slidphilabs.com",
85
85
  "llms_txt": "https://www.slidphilabs.com/llms.txt",
86
86
  "agents_json": "https://www.slidphilabs.com/agents.json",
87
- "one_liner": "Free first 1 GB suite · then from $2 min · ~3¢/GB. GET https://www.slidphilabs.com/api/agent. Try Gate retired.",
87
+ "one_liner": "Free first 100 GB suite (equal free-tier $0) · then ~5c/GB under ~9c first paid egress. GET https://www.slidphilabs.com/api/agent. Try Gate retired.",
88
88
  "agent_platform": {
89
89
  "cuni": "https://cuni-studio.fly.dev/",
90
90
  "agent_rider": "https://agentrider.vercel.app/",
@@ -92,12 +92,13 @@
92
92
  },
93
93
  "suite": "https://www.slidphilabs.com/pps",
94
94
  "suite_pricing": {
95
- "free_cap_gb": 1,
96
- "min_paid_usd": 2,
97
- "usd_per_gb_after_free": 0.03,
98
- "usd_per_gb_bulk": 0.02,
95
+ "free_cap_gb": 100,
96
+ "min_paid_usd": 0.05,
97
+ "usd_per_gb_after_free": 0.05,
98
+ "usd_per_gb_bulk": 0.04,
99
+ "first_paid_egress_ref_usd": 0.09,
99
100
  "try_gate": "retired",
100
- "model": "freemium_suite_v3_money"
101
+ "model": "freemium_suite_v4_undercut"
101
102
  },
102
103
  "welcome": "https://www.slidphilabs.com/api/welcome",
103
104
  "platform_json": "https://www.slidphilabs.com/platform.json"
package/src/quote.mjs CHANGED
@@ -1,24 +1,17 @@
1
1
  /**
2
- * SPL Pay Per Suite — local quote (matches site freemium money model).
3
- * Free first 1 GiB · over free: min $2 · ~3¢/GB (2¢ after 50 GB over free).
4
- * Try Gate retired.
2
+ * SPL Pay Per Suite — local quote (matches site).
3
+ * Free first 100 GiB (equal when competitor free-tier size is $0).
4
+ * Over free: under first paid egress (~$0.09/GB) at ~5¢/GB.
5
5
  */
6
-
7
- export const FREE_BYTES = 1 * 1024 * 1024 * 1024;
8
- export const MAX_BYTES = 100 * 1024 * 1024 * 1024;
6
+ export const FREE_BYTES = 100 * 1024 * 1024 * 1024;
7
+ export const MAX_BYTES = 1024 * 1024 * 1024 * 1024;
9
8
  export const MAX_CENTS = 1_000_000;
10
- export const MIN_PAID_CENTS = 200; // $2.00
11
- /** @deprecated free tier can be $0 */
9
+ export const MIN_PAID_CENTS = 5;
12
10
  export const MIN_CENTS = 0;
13
11
 
14
12
  export const PRODUCT_ADD_CENTS = {
15
- auto: 0,
16
- zrw: 0,
17
- "cddg-split": 100,
18
- blackjack: 0,
19
- "shard-zip": 0,
20
- "shard-tsdb": 0,
21
- "slid-phi": 0,
13
+ auto: 0, zrw: 0, "cddg-split": 25, blackjack: 0,
14
+ "shard-zip": 0, "shard-tsdb": 0, "slid-phi": 0,
22
15
  };
23
16
  export const PRODUCT_BASE = PRODUCT_ADD_CENTS;
24
17
 
@@ -40,8 +33,8 @@ export function usageFeeCents(billableBytes) {
40
33
  const b = Math.max(0, Number(billableBytes) || 0);
41
34
  if (b <= 0) return 0;
42
35
  const gb = b / (1024 * 1024 * 1024);
43
- if (gb <= 50) return Math.round(gb * 3);
44
- return Math.round(50 * 3 + (gb - 50) * 2);
36
+ if (gb <= 100) return Math.round(gb * 5);
37
+ return Math.round(100 * 5 + (gb - 100) * 4);
45
38
  }
46
39
 
47
40
  export function computeQuote({
@@ -58,62 +51,50 @@ export function computeQuote({
58
51
  const billable = Math.max(0, b - free_bytes);
59
52
  const free = billable <= 0;
60
53
  const rates = {
61
- free_cap_gb: 1,
62
- min_paid_usd: 2.0,
63
- usd_per_gb_first_50: 0.03,
64
- usd_per_gb_after_50: 0.02,
54
+ free_cap_gb: 100,
55
+ min_paid_usd: 0.05,
56
+ usd_per_gb_first_100: 0.05,
57
+ usd_per_gb_after_100: 0.04,
58
+ first_paid_egress_ref: 0.09,
65
59
  };
66
60
 
67
61
  if (free) {
68
62
  return {
69
- ok: true,
70
- service: "SPL Pay Per Suite",
71
- currency: "usd",
72
- amount_cents: 0,
73
- amount_display: "0.00",
74
- free: true,
75
- tier: "free_showcase",
76
- message: "Free showcase — first 1 GB $0. Over free: from $2 min · ~3¢/GB.",
63
+ ok: true, service: "SPL Pay Per Suite", currency: "usd",
64
+ amount_cents: 0, amount_display: "0.00", free: true, tier: "free_match",
65
+ message: "Free through 100 GB (equal when competitor free-tier size is $0).",
77
66
  breakdown: {
78
67
  product: prod, product_add_cents: 0, product_base_cents: 0,
79
- free_bytes, free_gb: 1, billable_bytes: 0, usage_cents: 0, size_cents: 0,
68
+ free_bytes, free_gb: 100, billable_bytes: 0, usage_cents: 0, size_cents: 0,
80
69
  data_class: cls, data_multiplier: DATA_MULT[cls],
81
70
  op: operation, op_multiplier: OP_MULT[operation],
82
71
  bytes: b, mb: +(b/1024/1024).toFixed(4), gb: +(b/1024/1024/1024).toFixed(6),
83
72
  min_cents: 0, min_paid_cents: MIN_PAID_CENTS, max_cents: MAX_CENTS, rates,
84
73
  },
85
- pay_url: STRIPE_PAYMENT_LINK,
86
- suite_url: SITE_PPS,
74
+ pay_url: STRIPE_PAYMENT_LINK, suite_url: SITE_PPS,
87
75
  };
88
76
  }
89
-
90
77
  const usage = usageFeeCents(billable);
91
78
  const add = PRODUCT_ADD_CENTS[prod] || 0;
92
79
  const raw = Math.round((usage + add) * DATA_MULT[cls] * OP_MULT[operation]);
93
80
  const cents = Math.min(MAX_CENTS, Math.max(MIN_PAID_CENTS, raw));
94
81
  return {
95
- ok: true,
96
- service: "SPL Pay Per Suite",
97
- currency: "usd",
98
- amount_cents: cents,
99
- amount_display: (cents / 100).toFixed(2),
100
- free: false,
101
- tier: "usage",
102
- message: "Usage — free 1 GB, then from $2 min · ~3¢/GB (2¢ after 50 GB over free).",
82
+ ok: true, service: "SPL Pay Per Suite", currency: "usd",
83
+ amount_cents: cents, amount_display: (cents / 100).toFixed(2),
84
+ free: false, tier: "usage_undercut",
85
+ message: "Over free: ~5¢/GB (under first paid egress ~9¢/GB).",
103
86
  breakdown: {
104
87
  product: prod, product_add_cents: add, product_base_cents: add,
105
- free_bytes, free_gb: 1, billable_bytes: billable, usage_cents: usage, size_cents: usage,
88
+ free_bytes, free_gb: 100, billable_bytes: billable, usage_cents: usage, size_cents: usage,
106
89
  data_class: cls, data_multiplier: DATA_MULT[cls],
107
90
  op: operation, op_multiplier: OP_MULT[operation],
108
91
  bytes: b, mb: +(b/1024/1024).toFixed(4), gb: +(b/1024/1024/1024).toFixed(6),
109
92
  min_cents: MIN_PAID_CENTS, min_paid_cents: MIN_PAID_CENTS, max_cents: MAX_CENTS, rates,
110
93
  },
111
- pay_url: STRIPE_PAYMENT_LINK,
112
- suite_url: SITE_PPS,
94
+ pay_url: STRIPE_PAYMENT_LINK, suite_url: SITE_PPS,
113
95
  };
114
96
  }
115
97
 
116
-
117
98
  export function classifyBytes(buf) {
118
99
  if (!buf || !buf.length) return { dataClass: "unknown", tool: "auto", confidence: 0 };
119
100
  const u8 = buf instanceof Uint8Array ? buf : new Uint8Array(buf);