@stacklink/sdk 0.3.15 → 0.6.2
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/README.md +26 -0
- package/compatibility.json +1 -1
- package/dist/src/domain/billing-plans.d.ts +827 -0
- package/dist/src/domain/billing-plans.d.ts.map +1 -0
- package/dist/src/domain/billing-plans.js +893 -0
- package/dist/src/domain/billing-plans.js.map +1 -0
- package/dist/src/domain/bot-avatar.d.ts +46 -0
- package/dist/src/domain/bot-avatar.d.ts.map +1 -0
- package/dist/src/domain/bot-avatar.js +436 -0
- package/dist/src/domain/bot-avatar.js.map +1 -0
- package/dist/src/domain/bot-contract.d.ts +1472 -700
- package/dist/src/domain/bot-contract.d.ts.map +1 -1
- package/dist/src/domain/bot-contract.js +133 -10
- package/dist/src/domain/bot-contract.js.map +1 -1
- package/dist/src/domain/memory-contract.d.ts +275 -275
- package/dist/src/domain/platform-approval-contract.d.ts +10 -4
- package/dist/src/domain/platform-approval-contract.d.ts.map +1 -1
- package/dist/src/domain/platform-approval-contract.js.map +1 -1
- package/dist/src/domain/provider-branding.d.ts.map +1 -1
- package/dist/src/domain/provider-branding.js +3 -0
- package/dist/src/domain/provider-branding.js.map +1 -1
- package/dist/src/domain/stacklink-meta-tools.d.ts +21 -5
- package/dist/src/domain/stacklink-meta-tools.d.ts.map +1 -1
- package/dist/src/domain/stacklink-meta-tools.js +73 -45
- package/dist/src/domain/stacklink-meta-tools.js.map +1 -1
- package/dist/src/domain/workflow-contract.d.ts +24338 -0
- package/dist/src/domain/workflow-contract.d.ts.map +1 -0
- package/dist/src/domain/workflow-contract.js +95 -0
- package/dist/src/domain/workflow-contract.js.map +1 -0
- package/dist/src/sdk/index.d.ts +329 -30
- package/dist/src/sdk/index.d.ts.map +1 -1
- package/dist/src/sdk/index.js +194 -47
- package/dist/src/sdk/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,827 @@
|
|
|
1
|
+
export type BillingPlanKey = 'free' | 'builder' | 'startup' | 'scale' | 'developer' | 'pro' | 'growth' | 'business' | 'enterprise';
|
|
2
|
+
export type BillingInterval = 'monthly' | 'annual';
|
|
3
|
+
export type UsageOperationClass = 'standard' | 'premium' | 'free';
|
|
4
|
+
export type BillingPolicyClass = 'free' | 'rate_limit_only' | 'standard_ops' | 'premium_ops';
|
|
5
|
+
export type BillingProductArea = 'provider' | 'knowledge' | 'memory' | 'model' | 'workbench' | 'platform';
|
|
6
|
+
export type PricingRuleScope = 'provider' | 'tool' | 'knowledge_pack' | 'model' | 'runtime_kind' | 'source_type' | 'global';
|
|
7
|
+
export type PricingMarkupBasis = 'upstream_cost' | 'stacklink_base_rate' | 'fixed_unit_price' | 'none';
|
|
8
|
+
export declare const stacklinkBillingContractVersion: "stacklink-billing-v1";
|
|
9
|
+
export declare const stacklinkPricingCatalogVersion: "stacklink-pricing-v1";
|
|
10
|
+
export declare const customerAgreementVersion: "stacklink-pricing-2026-10";
|
|
11
|
+
export declare const previousResourceAgreementVersion: "stacklink-resources-2026-10";
|
|
12
|
+
export declare const stagingCallAgreementVersion: "stacklink-calls-2026-10";
|
|
13
|
+
export declare const resourceAgreementVersion: "stacklink-calls-2026-10-01";
|
|
14
|
+
export declare const resourceAgreementVersions: readonly ["stacklink-resources-2026-10", "stacklink-calls-2026-10", "stacklink-calls-2026-10-01"];
|
|
15
|
+
export declare function isResourceAgreement(version: string | undefined): boolean;
|
|
16
|
+
export declare function usesMemoryCallAllowance(version: string): boolean;
|
|
17
|
+
export declare const selfServePlanKeys: readonly ["pro", "growth"];
|
|
18
|
+
export declare const previousSelfServePlanKeys: readonly ["developer", "growth", "business"];
|
|
19
|
+
export declare function isCustomerAgreement(version: string): boolean;
|
|
20
|
+
export declare const trialPolicy: {
|
|
21
|
+
readonly days: 30;
|
|
22
|
+
readonly standardOperations: 50000;
|
|
23
|
+
readonly managedCreditMicros: 1000000n;
|
|
24
|
+
};
|
|
25
|
+
export declare const premiumRuntimeUnitSeconds = 10;
|
|
26
|
+
export declare const premiumRuntimeUnitMs: number;
|
|
27
|
+
export declare const tokenBillingBlockSize = 1000;
|
|
28
|
+
export declare const byteBillingBlockSize: number;
|
|
29
|
+
export declare const richContentBillingBlocks: {
|
|
30
|
+
readonly normalizedCharacters: 100000;
|
|
31
|
+
readonly pages: 10;
|
|
32
|
+
readonly spreadsheetRows: 5000;
|
|
33
|
+
readonly slides: 10;
|
|
34
|
+
readonly mediaSeconds: 300;
|
|
35
|
+
readonly images: 1;
|
|
36
|
+
};
|
|
37
|
+
export interface RichContentBillingDimensions {
|
|
38
|
+
normalizedCharacters?: number | undefined;
|
|
39
|
+
pages?: number | undefined;
|
|
40
|
+
spreadsheetRows?: number | undefined;
|
|
41
|
+
slides?: number | undefined;
|
|
42
|
+
mediaSeconds?: number | undefined;
|
|
43
|
+
images?: number | undefined;
|
|
44
|
+
}
|
|
45
|
+
export type BillingUnit = 'call' | 'runtime_10s' | 'token_block' | 'byte_block';
|
|
46
|
+
export type PricingUnit = 'operation' | 'call' | '1000_calls' | '1m_input_tokens' | '1m_output_tokens' | '1m_reasoning_tokens' | 'runtime_10s' | 'byte_block';
|
|
47
|
+
export type BillingQuantitySource = 'fixed' | 'duration_ms' | 'tokens' | 'bytes';
|
|
48
|
+
export type BillingMultiplier = 1 | 2 | 3;
|
|
49
|
+
export interface StacklinkBillingDescriptor {
|
|
50
|
+
class: UsageOperationClass;
|
|
51
|
+
unit: BillingUnit;
|
|
52
|
+
multiplier?: BillingMultiplier | undefined;
|
|
53
|
+
quantitySource: BillingQuantitySource;
|
|
54
|
+
version: typeof stacklinkBillingContractVersion;
|
|
55
|
+
}
|
|
56
|
+
export interface BillingBaseRateDefinition {
|
|
57
|
+
key: string;
|
|
58
|
+
productArea: BillingProductArea;
|
|
59
|
+
unit: PricingUnit;
|
|
60
|
+
basePriceMicros: bigint;
|
|
61
|
+
currency: 'USD';
|
|
62
|
+
publicLabel: string;
|
|
63
|
+
publicUnitLabel: string;
|
|
64
|
+
publicNotes: string[];
|
|
65
|
+
publicVisible: boolean;
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
metadata: Record<string, unknown>;
|
|
68
|
+
}
|
|
69
|
+
export interface PricingRuleDefinition {
|
|
70
|
+
key: string;
|
|
71
|
+
scope: PricingRuleScope;
|
|
72
|
+
productArea?: BillingProductArea | undefined;
|
|
73
|
+
sourceType?: string | undefined;
|
|
74
|
+
operationClass?: UsageOperationClass | undefined;
|
|
75
|
+
providerKey?: string | undefined;
|
|
76
|
+
toolKey?: string | undefined;
|
|
77
|
+
runtimeKind?: string | undefined;
|
|
78
|
+
knowledgePackKey?: string | undefined;
|
|
79
|
+
modelProvider?: string | undefined;
|
|
80
|
+
model?: string | undefined;
|
|
81
|
+
baseRateKey?: string | undefined;
|
|
82
|
+
markupBasis: PricingMarkupBasis;
|
|
83
|
+
markupBps: number;
|
|
84
|
+
fixedUnitPriceMicros?: bigint | undefined;
|
|
85
|
+
minChargeMicros?: bigint | undefined;
|
|
86
|
+
maxChargeMicros?: bigint | undefined;
|
|
87
|
+
priority: number;
|
|
88
|
+
currency: 'USD';
|
|
89
|
+
publicLabel: string;
|
|
90
|
+
publicDescription: string;
|
|
91
|
+
publicUnitLabel?: string | undefined;
|
|
92
|
+
publicNotes: string[];
|
|
93
|
+
publicVisible: boolean;
|
|
94
|
+
enabled: boolean;
|
|
95
|
+
version: typeof stacklinkPricingCatalogVersion;
|
|
96
|
+
metadata: Record<string, unknown>;
|
|
97
|
+
}
|
|
98
|
+
export interface InternalPricingSummary {
|
|
99
|
+
billingModel: 'included' | 'free' | 'metered' | 'token_metered' | 'custom';
|
|
100
|
+
productArea: BillingProductArea;
|
|
101
|
+
unit: PricingUnit;
|
|
102
|
+
unitLabel: string;
|
|
103
|
+
priceMicros: string;
|
|
104
|
+
priceText: string;
|
|
105
|
+
currency: 'USD';
|
|
106
|
+
effectiveFrom?: Date | string | undefined;
|
|
107
|
+
notes: string[];
|
|
108
|
+
}
|
|
109
|
+
export interface PublicBillingSummary {
|
|
110
|
+
policy: BillingPolicyClass;
|
|
111
|
+
operationClass: UsageOperationClass | null;
|
|
112
|
+
meterName: typeof billingContract.standardMeterName | typeof billingContract.premiumMeterName | 'tool_calls' | null;
|
|
113
|
+
label: 'No usage charge' | 'Rate limit only' | 'Included as standard ops' | 'Counts as premium ops' | 'Tool calls' | 'Custom pricing';
|
|
114
|
+
description: string;
|
|
115
|
+
}
|
|
116
|
+
export interface MeteredOpsInput {
|
|
117
|
+
billing: StacklinkBillingDescriptor;
|
|
118
|
+
durationMs?: number | null | undefined;
|
|
119
|
+
tokenCount?: number | null | undefined;
|
|
120
|
+
byteCount?: number | bigint | null | undefined;
|
|
121
|
+
fixedQuantity?: number | null | undefined;
|
|
122
|
+
}
|
|
123
|
+
export interface MeteredOpsResult {
|
|
124
|
+
operationClass: UsageOperationClass;
|
|
125
|
+
quantity: number;
|
|
126
|
+
baseQuantity: number;
|
|
127
|
+
billing: StacklinkBillingDescriptor;
|
|
128
|
+
}
|
|
129
|
+
export declare const sandboxPremiumMultipliers: {
|
|
130
|
+
readonly standard: 1;
|
|
131
|
+
readonly medium: 2;
|
|
132
|
+
readonly large: 3;
|
|
133
|
+
};
|
|
134
|
+
export declare const billingContract: {
|
|
135
|
+
readonly version: "stacklink-billing-v1";
|
|
136
|
+
readonly standardMeterName: "standard_ops";
|
|
137
|
+
readonly premiumMeterName: "premium_ops";
|
|
138
|
+
readonly premiumRuntimeUnitSeconds: 10;
|
|
139
|
+
readonly sandboxMultipliers: {
|
|
140
|
+
readonly standard: 1;
|
|
141
|
+
readonly medium: 2;
|
|
142
|
+
readonly large: 3;
|
|
143
|
+
};
|
|
144
|
+
readonly meters: {
|
|
145
|
+
readonly standard_ops: {
|
|
146
|
+
readonly label: "Standard ops";
|
|
147
|
+
readonly description: "Normal Stacklink API, MCP, provider tool, trigger, webhook, knowledge, and connection work.";
|
|
148
|
+
};
|
|
149
|
+
readonly premium_ops: {
|
|
150
|
+
readonly label: "Premium ops";
|
|
151
|
+
readonly description: "Stacklink-paid variable infra work such as workbench runtime, web search, LLM helpers, OCR, extraction, and heavy compute.";
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export declare const billingOperationPolicyCatalog: {
|
|
156
|
+
readonly 'platform.health.read': "free";
|
|
157
|
+
readonly 'platform.readiness.read': "free";
|
|
158
|
+
readonly 'platform.worker.bookkeeping': "free";
|
|
159
|
+
readonly 'billing.plans.read': "rate_limit_only";
|
|
160
|
+
readonly 'billing.summary.read': "rate_limit_only";
|
|
161
|
+
readonly 'billing.usage.read': "rate_limit_only";
|
|
162
|
+
readonly 'billing.usage_events.read': "rate_limit_only";
|
|
163
|
+
readonly 'billing.checkout.create': "rate_limit_only";
|
|
164
|
+
readonly 'billing.portal.create': "rate_limit_only";
|
|
165
|
+
readonly 'billing.invoices.read': "rate_limit_only";
|
|
166
|
+
readonly 'billing.webhook.receive': "free";
|
|
167
|
+
readonly 'api_key.lifecycle': "rate_limit_only";
|
|
168
|
+
readonly 'project.read': "rate_limit_only";
|
|
169
|
+
readonly 'project.lifecycle': "rate_limit_only";
|
|
170
|
+
readonly 'provider.catalog.read': "rate_limit_only";
|
|
171
|
+
readonly 'provider.tool_schema.read': "rate_limit_only";
|
|
172
|
+
readonly 'provider.auth_config.read': "rate_limit_only";
|
|
173
|
+
readonly 'provider.auth_config.lifecycle': "standard_ops";
|
|
174
|
+
readonly 'connection.read': "rate_limit_only";
|
|
175
|
+
readonly 'provider.connection.lifecycle': "standard_ops";
|
|
176
|
+
readonly 'provider.tool.execution': "standard_ops";
|
|
177
|
+
readonly 'session.read': "rate_limit_only";
|
|
178
|
+
readonly 'session.lifecycle': "rate_limit_only";
|
|
179
|
+
readonly 'session.event_stream.read': "rate_limit_only";
|
|
180
|
+
readonly 'tool.discovery': "rate_limit_only";
|
|
181
|
+
readonly 'tool.execution.read': "rate_limit_only";
|
|
182
|
+
readonly 'mcp.tool.call': "standard_ops";
|
|
183
|
+
readonly 'mcp.server.request': "rate_limit_only";
|
|
184
|
+
readonly 'trigger.subscription.read': "rate_limit_only";
|
|
185
|
+
readonly 'trigger.subscription.lifecycle': "standard_ops";
|
|
186
|
+
readonly 'trigger.event.process': "standard_ops";
|
|
187
|
+
readonly 'trigger.worker.run': "free";
|
|
188
|
+
readonly 'webhook.endpoint.read': "rate_limit_only";
|
|
189
|
+
readonly 'webhook.endpoint.lifecycle': "standard_ops";
|
|
190
|
+
readonly 'webhook.delivery': "standard_ops";
|
|
191
|
+
readonly 'log.read': "rate_limit_only";
|
|
192
|
+
readonly 'artifact.read': "rate_limit_only";
|
|
193
|
+
readonly 'knowledge.pack.lifecycle': "standard_ops";
|
|
194
|
+
readonly 'knowledge.pack.read': "rate_limit_only";
|
|
195
|
+
readonly 'knowledge.lookup': "standard_ops";
|
|
196
|
+
readonly 'knowledge.search': "standard_ops";
|
|
197
|
+
readonly 'knowledge.verify.heavy': "premium_ops";
|
|
198
|
+
readonly 'compliance.rule.lookup': "standard_ops";
|
|
199
|
+
readonly 'compliance.rule.calculation': "standard_ops";
|
|
200
|
+
readonly 'workbench.metadata.read': "rate_limit_only";
|
|
201
|
+
readonly 'workbench.artifact.read': "rate_limit_only";
|
|
202
|
+
readonly 'workbench.artifact.write': "premium_ops";
|
|
203
|
+
readonly 'workbench.budget.lifecycle': "rate_limit_only";
|
|
204
|
+
readonly 'workbench.runtime': "premium_ops";
|
|
205
|
+
readonly 'workbench.code_execution': "premium_ops";
|
|
206
|
+
readonly 'workbench.model_call.stacklink_paid': "premium_ops";
|
|
207
|
+
readonly 'workbench.web_search.stacklink_paid': "premium_ops";
|
|
208
|
+
readonly 'model.call.stacklink_paid': "premium_ops";
|
|
209
|
+
readonly 'model.call.customer_owned': "standard_ops";
|
|
210
|
+
readonly 'memory.read': "standard_ops";
|
|
211
|
+
readonly 'memory.manage': "standard_ops";
|
|
212
|
+
readonly 'memory.delete': "standard_ops";
|
|
213
|
+
readonly 'memory.write.indexed': "premium_ops";
|
|
214
|
+
readonly 'memory.search.vector': "premium_ops";
|
|
215
|
+
readonly 'memory.context': "premium_ops";
|
|
216
|
+
readonly 'memory.extraction': "premium_ops";
|
|
217
|
+
readonly 'memory.graph': "premium_ops";
|
|
218
|
+
readonly 'memory.profile.rebuild': "premium_ops";
|
|
219
|
+
readonly 'memory.export': "premium_ops";
|
|
220
|
+
readonly 'memory.dashboard.read': "rate_limit_only";
|
|
221
|
+
};
|
|
222
|
+
export type BillingOperationKey = keyof typeof billingOperationPolicyCatalog;
|
|
223
|
+
export declare const freeCallBillingDescriptor: StacklinkBillingDescriptor;
|
|
224
|
+
export declare const standardCallBillingDescriptor: StacklinkBillingDescriptor;
|
|
225
|
+
export declare const premiumCallBillingDescriptor: StacklinkBillingDescriptor;
|
|
226
|
+
export declare const premiumTokenBlockBillingDescriptor: StacklinkBillingDescriptor;
|
|
227
|
+
export declare const premiumByteBlockBillingDescriptor: StacklinkBillingDescriptor;
|
|
228
|
+
export interface BillingPlanDefinition {
|
|
229
|
+
key: BillingPlanKey;
|
|
230
|
+
displayName: string;
|
|
231
|
+
monthlyPriceCents: number;
|
|
232
|
+
annualPriceCents?: number | null | undefined;
|
|
233
|
+
standardOpsIncluded: number;
|
|
234
|
+
premiumOpsIncluded: number;
|
|
235
|
+
standardOveragePerThousandCents: number;
|
|
236
|
+
premiumOveragePerThousandCents: number;
|
|
237
|
+
rateLimitPerMinute: number;
|
|
238
|
+
logRetentionDays: number;
|
|
239
|
+
projectsIncluded: number | null;
|
|
240
|
+
metadata: Record<string, unknown>;
|
|
241
|
+
}
|
|
242
|
+
export declare const billingResourceKeys: readonly ["tool_calls", "delivered_events", "memory_calls", "memory_input_tokens", "memory_retrievals", "workbench_standard", "workbench_medium", "workbench_large", "workbench_ready_standard", "workbench_ready_medium", "workbench_ready_large", "ai_model_usage"];
|
|
243
|
+
export type BillingResourceKey = typeof billingResourceKeys[number];
|
|
244
|
+
export declare const resourceBudgetKinds: readonly ["tool-calls", "delivered-events", "memory", "workbench", "ai"];
|
|
245
|
+
export type ResourceBudgetKind = typeof resourceBudgetKinds[number];
|
|
246
|
+
export type BillingBudgetKind = ResourceBudgetKind | 'additional-operations' | 'managed-resources';
|
|
247
|
+
/** Funding is separate from the accepted resource rates and subscription price. */
|
|
248
|
+
export declare const prepaidFundingVersion: "stacklink-credits-2026-11-04";
|
|
249
|
+
export declare const creditPurchaseLimits: {
|
|
250
|
+
readonly presetsCents: readonly [2000, 5000, 10000];
|
|
251
|
+
readonly minimumCents: 1000;
|
|
252
|
+
readonly maximumCents: 200000;
|
|
253
|
+
};
|
|
254
|
+
export interface BillingCreditPurchase {
|
|
255
|
+
id: string;
|
|
256
|
+
provider: 'stripe' | 'shopify';
|
|
257
|
+
amountCents: number;
|
|
258
|
+
currency: 'USD';
|
|
259
|
+
status: 'creating' | 'confirming' | 'completed' | 'failed' | 'canceled' | 'expired';
|
|
260
|
+
paymentUrl: string | null;
|
|
261
|
+
expiresAt: string | null;
|
|
262
|
+
createdAt: string;
|
|
263
|
+
receiptUrl: string | null;
|
|
264
|
+
}
|
|
265
|
+
export interface BillingCreditsSummary {
|
|
266
|
+
mode: 'prepaid';
|
|
267
|
+
currency: 'USD';
|
|
268
|
+
/** Historical invoices must be settled before credit-funded work can start. */
|
|
269
|
+
activation: {
|
|
270
|
+
status: 'ready' | 'reconciling' | 'payment_required' | 'review_required';
|
|
271
|
+
outstandingCents: number | null;
|
|
272
|
+
paymentUrl: string | null;
|
|
273
|
+
invoiceNumber: string | null;
|
|
274
|
+
};
|
|
275
|
+
balanceMicros: string;
|
|
276
|
+
reservedMicros: string;
|
|
277
|
+
availableMicros: string;
|
|
278
|
+
access: 'plan' | 'credits_only' | 'blocked';
|
|
279
|
+
purchase: {
|
|
280
|
+
allowed: boolean;
|
|
281
|
+
reason: string | null;
|
|
282
|
+
provider: 'stripe' | 'shopify' | null;
|
|
283
|
+
payerStore: string | null;
|
|
284
|
+
presetsCents: readonly number[];
|
|
285
|
+
minimumCents: number;
|
|
286
|
+
maximumCents: number;
|
|
287
|
+
};
|
|
288
|
+
controls: Array<{
|
|
289
|
+
kind: ResourceBudgetKind;
|
|
290
|
+
enabled: boolean;
|
|
291
|
+
}>;
|
|
292
|
+
settingsVersion: string;
|
|
293
|
+
lowBalanceEmail: {
|
|
294
|
+
enabled: boolean;
|
|
295
|
+
thresholdCents: number;
|
|
296
|
+
};
|
|
297
|
+
pendingPurchase: BillingCreditPurchase | null;
|
|
298
|
+
}
|
|
299
|
+
export interface BillingCreditSettingsInput {
|
|
300
|
+
expectedVersion: string;
|
|
301
|
+
controls: Array<{
|
|
302
|
+
kind: ResourceBudgetKind;
|
|
303
|
+
enabled: boolean;
|
|
304
|
+
}>;
|
|
305
|
+
lowBalanceEmail: {
|
|
306
|
+
enabled: boolean;
|
|
307
|
+
thresholdCents: number;
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
export interface BillingActivityItem {
|
|
311
|
+
id: string;
|
|
312
|
+
createdAt: string;
|
|
313
|
+
kind: 'purchase' | 'usage' | 'refund' | 'adjustment' | 'controls';
|
|
314
|
+
label: string;
|
|
315
|
+
amountMicros: string;
|
|
316
|
+
balanceAfterMicros: string | null;
|
|
317
|
+
resource: string | null;
|
|
318
|
+
projectId: string | null;
|
|
319
|
+
botId: string | null;
|
|
320
|
+
runId: string | null;
|
|
321
|
+
purchaseId: string | null;
|
|
322
|
+
provider: string | null;
|
|
323
|
+
receiptUrl: string | null;
|
|
324
|
+
}
|
|
325
|
+
export interface BillingActivityPage {
|
|
326
|
+
items: BillingActivityItem[];
|
|
327
|
+
nextCursor: string | null;
|
|
328
|
+
}
|
|
329
|
+
export interface ResourceTerms {
|
|
330
|
+
key: BillingResourceKey;
|
|
331
|
+
label: string;
|
|
332
|
+
budgetKind: ResourceBudgetKind;
|
|
333
|
+
unit: 'calls' | 'events' | 'tokens' | 'retrievals' | 'milliseconds' | 'microdollars';
|
|
334
|
+
included: number;
|
|
335
|
+
priceMicros: string;
|
|
336
|
+
unitQuantity: number;
|
|
337
|
+
rateVersion: string;
|
|
338
|
+
testOnly: boolean;
|
|
339
|
+
}
|
|
340
|
+
export interface ResourceCounter extends ResourceTerms {
|
|
341
|
+
used: number;
|
|
342
|
+
reserved: number;
|
|
343
|
+
credited?: number;
|
|
344
|
+
includedUsed?: number;
|
|
345
|
+
includedReserved?: number;
|
|
346
|
+
chargedMicros?: string;
|
|
347
|
+
}
|
|
348
|
+
export type ResourceCounters = Partial<Record<BillingResourceKey, ResourceCounter>>;
|
|
349
|
+
export declare function isBillingResourceKey(value: unknown): value is BillingResourceKey;
|
|
350
|
+
/** Quantities and rates are retained until the complete resource line is rounded. */
|
|
351
|
+
export declare function resourceChargeMicros(quantity: number, terms: ResourceTerms): bigint;
|
|
352
|
+
export declare function resourceKeysForAgreement(version: string): BillingResourceKey[];
|
|
353
|
+
export declare function resourceDimensions(key: BillingResourceKey): ResourceTerms;
|
|
354
|
+
/** An additive AI offer: existing tool, Memory and Workbench agreements do not change. */
|
|
355
|
+
export declare const aiRateCardVersion: "stacklink-ai-2026-10-23";
|
|
356
|
+
export declare function aiResourceTerms(includedMicros: number): ResourceTerms;
|
|
357
|
+
/** Scribe file transcription uses duration, never invented token counts. */
|
|
358
|
+
export interface AudioTranscriptionRateSnapshot {
|
|
359
|
+
version: 'stacklink-audio-2026-10-29';
|
|
360
|
+
provider: 'elevenlabs';
|
|
361
|
+
model: 'scribe_v2';
|
|
362
|
+
currency: 'USD';
|
|
363
|
+
providerMicrosPerHour: 220000;
|
|
364
|
+
markupBps: 5000;
|
|
365
|
+
effectiveAt: string;
|
|
366
|
+
}
|
|
367
|
+
export declare function audioTranscriptionRateSnapshot(at?: Date): AudioTranscriptionRateSnapshot;
|
|
368
|
+
export declare function audioTranscriptionPrice(rate: AudioTranscriptionRateSnapshot, durationMs: number): {
|
|
369
|
+
providerMicros: bigint;
|
|
370
|
+
customerMicros: number;
|
|
371
|
+
};
|
|
372
|
+
interface ModelTokenRates {
|
|
373
|
+
inputMicrosPerMillion: number;
|
|
374
|
+
cachedInputMicrosPerMillion: number;
|
|
375
|
+
outputMicrosPerMillion: number;
|
|
376
|
+
cacheWriteMicrosPerMillion?: number;
|
|
377
|
+
}
|
|
378
|
+
export interface ModelRateSnapshot extends ModelTokenRates {
|
|
379
|
+
version: typeof aiRateCardVersion | 'stacklink-ai-2026-10-30';
|
|
380
|
+
provider: 'openai' | 'deepseek' | 'anthropic' | 'gemini' | 'qwen' | 'kimi' | 'xai' | 'zai';
|
|
381
|
+
model: string;
|
|
382
|
+
effectiveAt: string;
|
|
383
|
+
tier: 'standard' | 'peak' | 'off_peak';
|
|
384
|
+
/** The whole request uses this band, selected using the actual input receipt. */
|
|
385
|
+
longContext?: ModelTokenRates & {
|
|
386
|
+
minimumInputTokens: number;
|
|
387
|
+
};
|
|
388
|
+
markupBps: 5000;
|
|
389
|
+
}
|
|
390
|
+
/** Published provider rates; expanded catalog checked 31 October 2026. No model-name inference. */
|
|
391
|
+
export declare function modelRateSnapshot(provider: string, model: string, at?: Date): ModelRateSnapshot;
|
|
392
|
+
export interface ModelTokenUsage {
|
|
393
|
+
inputTokens: number;
|
|
394
|
+
cachedInputTokens: number;
|
|
395
|
+
outputTokens: number;
|
|
396
|
+
/** Disjoint from cached reads and ordinary input; the configured provider lifetime selects the write tariff. */
|
|
397
|
+
cacheWriteTokens?: number;
|
|
398
|
+
}
|
|
399
|
+
/** Search is a separate supplier unit. Tokens retain the model rate and markup. */
|
|
400
|
+
export interface NativeSearchRateSnapshot {
|
|
401
|
+
version: 'stacklink-native-search-2026-10-27';
|
|
402
|
+
provider: 'openai' | 'deepseek';
|
|
403
|
+
effectiveAt?: string;
|
|
404
|
+
tool: 'web_search';
|
|
405
|
+
providerMicrosPerRequest: 10_000 | 750 | 0;
|
|
406
|
+
markupBps: 1500;
|
|
407
|
+
}
|
|
408
|
+
export declare function nativeSearchRateSnapshot(provider: string, model: string, at?: Date): NativeSearchRateSnapshot;
|
|
409
|
+
export declare function nativeSearchUsagePrice(rate: NativeSearchRateSnapshot, requests: number): {
|
|
410
|
+
providerMicros: bigint;
|
|
411
|
+
customerMicros: number;
|
|
412
|
+
};
|
|
413
|
+
export declare function modelUsagePrice(rate: ModelRateSnapshot, usage: ModelTokenUsage): {
|
|
414
|
+
providerMicros: bigint;
|
|
415
|
+
customerMicros: number;
|
|
416
|
+
};
|
|
417
|
+
/** Reserve the most expensive supported input treatment, including cache creation. */
|
|
418
|
+
export declare function modelUsageReservation(rate: ModelRateSnapshot, inputTokens: number, outputTokens: number): {
|
|
419
|
+
providerMicros: bigint;
|
|
420
|
+
customerMicros: number;
|
|
421
|
+
};
|
|
422
|
+
export declare function workbenchReadyResourceSize(key: string): 'standard' | 'medium' | 'large' | undefined;
|
|
423
|
+
/** Retention is an explicitly purchased resource. It never borrows included execution minutes. */
|
|
424
|
+
export declare function workbenchReadyResourceTerms(activeTerms: readonly ResourceTerms[]): ResourceTerms[];
|
|
425
|
+
export declare function resourceTermsForPlan(planKey: string, trial?: boolean, version?: string): ResourceTerms[];
|
|
426
|
+
export declare function resourceCountersFromJson(value: unknown): ResourceCounters;
|
|
427
|
+
/** Older counters are converted while holding the workspace admission lock. */
|
|
428
|
+
export declare function resourceIncludedAllocation(row: ResourceCounter): {
|
|
429
|
+
used: number;
|
|
430
|
+
reserved: number;
|
|
431
|
+
available: number;
|
|
432
|
+
};
|
|
433
|
+
export declare function resourceBudgetAmounts(counters: ResourceCounters, kind: ResourceBudgetKind): {
|
|
434
|
+
usedCents: number;
|
|
435
|
+
reservedCents: number;
|
|
436
|
+
};
|
|
437
|
+
export declare const billingPlanCatalog: [{
|
|
438
|
+
readonly key: "free";
|
|
439
|
+
readonly displayName: "Free";
|
|
440
|
+
readonly monthlyPriceCents: 0;
|
|
441
|
+
readonly annualPriceCents: null;
|
|
442
|
+
readonly standardOpsIncluded: 20000;
|
|
443
|
+
readonly premiumOpsIncluded: 1000;
|
|
444
|
+
readonly standardOveragePerThousandCents: 0;
|
|
445
|
+
readonly premiumOveragePerThousandCents: 0;
|
|
446
|
+
readonly rateLimitPerMinute: 120;
|
|
447
|
+
readonly logRetentionDays: 30;
|
|
448
|
+
readonly projectsIncluded: 2;
|
|
449
|
+
readonly metadata: {
|
|
450
|
+
readonly overagePolicy: "hard_cap";
|
|
451
|
+
};
|
|
452
|
+
}, {
|
|
453
|
+
readonly key: "builder";
|
|
454
|
+
readonly displayName: "Builder";
|
|
455
|
+
readonly monthlyPriceCents: 900;
|
|
456
|
+
readonly annualPriceCents: 8000;
|
|
457
|
+
readonly standardOpsIncluded: 200000;
|
|
458
|
+
readonly premiumOpsIncluded: 10000;
|
|
459
|
+
readonly standardOveragePerThousandCents: 29;
|
|
460
|
+
readonly premiumOveragePerThousandCents: 87;
|
|
461
|
+
readonly rateLimitPerMinute: 600;
|
|
462
|
+
readonly logRetentionDays: 60;
|
|
463
|
+
readonly projectsIncluded: 5;
|
|
464
|
+
readonly metadata: {
|
|
465
|
+
readonly overagePolicy: "soft_meter";
|
|
466
|
+
};
|
|
467
|
+
}, {
|
|
468
|
+
readonly key: "startup";
|
|
469
|
+
readonly displayName: "Startup";
|
|
470
|
+
readonly monthlyPriceCents: 4900;
|
|
471
|
+
readonly annualPriceCents: 49000;
|
|
472
|
+
readonly standardOpsIncluded: 1000000;
|
|
473
|
+
readonly premiumOpsIncluded: 50000;
|
|
474
|
+
readonly standardOveragePerThousandCents: 25;
|
|
475
|
+
readonly premiumOveragePerThousandCents: 75;
|
|
476
|
+
readonly rateLimitPerMinute: 1800;
|
|
477
|
+
readonly logRetentionDays: 90;
|
|
478
|
+
readonly projectsIncluded: 10;
|
|
479
|
+
readonly metadata: {
|
|
480
|
+
readonly overagePolicy: "soft_meter";
|
|
481
|
+
};
|
|
482
|
+
}, {
|
|
483
|
+
readonly key: "scale";
|
|
484
|
+
readonly displayName: "Scale";
|
|
485
|
+
readonly monthlyPriceCents: 19900;
|
|
486
|
+
readonly annualPriceCents: 199000;
|
|
487
|
+
readonly standardOpsIncluded: 5000000;
|
|
488
|
+
readonly premiumOpsIncluded: 250000;
|
|
489
|
+
readonly standardOveragePerThousandCents: 20;
|
|
490
|
+
readonly premiumOveragePerThousandCents: 60;
|
|
491
|
+
readonly rateLimitPerMinute: 6000;
|
|
492
|
+
readonly logRetentionDays: 180;
|
|
493
|
+
readonly projectsIncluded: 25;
|
|
494
|
+
readonly metadata: {
|
|
495
|
+
readonly overagePolicy: "soft_meter";
|
|
496
|
+
};
|
|
497
|
+
}, {
|
|
498
|
+
readonly key: "pro";
|
|
499
|
+
readonly displayName: "Pro";
|
|
500
|
+
readonly monthlyPriceCents: 3000;
|
|
501
|
+
readonly annualPriceCents: null;
|
|
502
|
+
readonly standardOpsIncluded: 100000;
|
|
503
|
+
readonly premiumOpsIncluded: 0;
|
|
504
|
+
readonly standardOveragePerThousandCents: 50;
|
|
505
|
+
readonly premiumOveragePerThousandCents: 0;
|
|
506
|
+
readonly rateLimitPerMinute: 300;
|
|
507
|
+
readonly logRetentionDays: 60;
|
|
508
|
+
readonly projectsIncluded: 2;
|
|
509
|
+
readonly metadata: {
|
|
510
|
+
readonly agreementVersion: "stacklink-calls-2026-10-01";
|
|
511
|
+
readonly description: "Build and launch production integrations";
|
|
512
|
+
readonly supportLabel: "Email";
|
|
513
|
+
readonly overagePolicy: "budget";
|
|
514
|
+
};
|
|
515
|
+
}, {
|
|
516
|
+
readonly key: "developer";
|
|
517
|
+
readonly displayName: "Developer";
|
|
518
|
+
readonly monthlyPriceCents: 2900;
|
|
519
|
+
readonly annualPriceCents: 31320;
|
|
520
|
+
readonly standardOpsIncluded: 50000;
|
|
521
|
+
readonly premiumOpsIncluded: 0;
|
|
522
|
+
readonly standardOveragePerThousandCents: 50;
|
|
523
|
+
readonly premiumOveragePerThousandCents: 0;
|
|
524
|
+
readonly rateLimitPerMinute: 600;
|
|
525
|
+
readonly logRetentionDays: 30;
|
|
526
|
+
readonly projectsIncluded: 2;
|
|
527
|
+
readonly metadata: {
|
|
528
|
+
readonly agreementVersion: "stacklink-pricing-2026-10";
|
|
529
|
+
readonly description: "Developers and small production applications";
|
|
530
|
+
readonly supportLabel: "Standard email";
|
|
531
|
+
readonly overagePolicy: "budget";
|
|
532
|
+
};
|
|
533
|
+
}, {
|
|
534
|
+
readonly key: "growth";
|
|
535
|
+
readonly displayName: "Growth";
|
|
536
|
+
readonly monthlyPriceCents: 20000;
|
|
537
|
+
readonly annualPriceCents: null;
|
|
538
|
+
readonly standardOpsIncluded: 1500000;
|
|
539
|
+
readonly premiumOpsIncluded: 0;
|
|
540
|
+
readonly standardOveragePerThousandCents: 30;
|
|
541
|
+
readonly premiumOveragePerThousandCents: 0;
|
|
542
|
+
readonly rateLimitPerMinute: 1800;
|
|
543
|
+
readonly logRetentionDays: 120;
|
|
544
|
+
readonly projectsIncluded: 10;
|
|
545
|
+
readonly metadata: {
|
|
546
|
+
readonly agreementVersion: "stacklink-calls-2026-10-01";
|
|
547
|
+
readonly description: "Growing products and startups";
|
|
548
|
+
readonly supportLabel: "Email";
|
|
549
|
+
readonly overagePolicy: "budget";
|
|
550
|
+
};
|
|
551
|
+
}, {
|
|
552
|
+
readonly key: "business";
|
|
553
|
+
readonly displayName: "Business";
|
|
554
|
+
readonly monthlyPriceCents: 50000;
|
|
555
|
+
readonly annualPriceCents: 540000;
|
|
556
|
+
readonly standardOpsIncluded: 1000000;
|
|
557
|
+
readonly premiumOpsIncluded: 0;
|
|
558
|
+
readonly standardOveragePerThousandCents: 30;
|
|
559
|
+
readonly premiumOveragePerThousandCents: 0;
|
|
560
|
+
readonly rateLimitPerMinute: 6000;
|
|
561
|
+
readonly logRetentionDays: 90;
|
|
562
|
+
readonly projectsIncluded: 25;
|
|
563
|
+
readonly metadata: {
|
|
564
|
+
readonly agreementVersion: "stacklink-pricing-2026-10";
|
|
565
|
+
readonly description: "Larger production deployments";
|
|
566
|
+
readonly supportLabel: "Priority email, business hours";
|
|
567
|
+
readonly overagePolicy: "budget";
|
|
568
|
+
};
|
|
569
|
+
}, {
|
|
570
|
+
readonly key: "enterprise";
|
|
571
|
+
readonly displayName: "Enterprise";
|
|
572
|
+
readonly monthlyPriceCents: 0;
|
|
573
|
+
readonly annualPriceCents: null;
|
|
574
|
+
readonly standardOpsIncluded: 50000000;
|
|
575
|
+
readonly premiumOpsIncluded: 1000000;
|
|
576
|
+
readonly standardOveragePerThousandCents: 0;
|
|
577
|
+
readonly premiumOveragePerThousandCents: 0;
|
|
578
|
+
readonly rateLimitPerMinute: 0;
|
|
579
|
+
readonly logRetentionDays: 365;
|
|
580
|
+
readonly projectsIncluded: null;
|
|
581
|
+
readonly metadata: {
|
|
582
|
+
readonly overagePolicy: "custom";
|
|
583
|
+
readonly customLimits: true;
|
|
584
|
+
};
|
|
585
|
+
}];
|
|
586
|
+
export declare const billingBaseRateCatalog: [{
|
|
587
|
+
readonly key: "standard_ops_included";
|
|
588
|
+
readonly productArea: "platform";
|
|
589
|
+
readonly unit: "operation";
|
|
590
|
+
readonly basePriceMicros: 0n;
|
|
591
|
+
readonly currency: "USD";
|
|
592
|
+
readonly publicLabel: "Standard operation";
|
|
593
|
+
readonly publicUnitLabel: "operation";
|
|
594
|
+
readonly publicNotes: ["Included with the project plan unless a more specific pricing rule applies."];
|
|
595
|
+
readonly publicVisible: true;
|
|
596
|
+
readonly enabled: true;
|
|
597
|
+
readonly metadata: {
|
|
598
|
+
readonly source: "default_pricing_catalog";
|
|
599
|
+
};
|
|
600
|
+
}, {
|
|
601
|
+
readonly key: "premium_ops_included";
|
|
602
|
+
readonly productArea: "platform";
|
|
603
|
+
readonly unit: "operation";
|
|
604
|
+
readonly basePriceMicros: 0n;
|
|
605
|
+
readonly currency: "USD";
|
|
606
|
+
readonly publicLabel: "Premium operation";
|
|
607
|
+
readonly publicUnitLabel: "operation";
|
|
608
|
+
readonly publicNotes: ["Included with the project plan unless a more specific pricing rule applies."];
|
|
609
|
+
readonly publicVisible: true;
|
|
610
|
+
readonly enabled: true;
|
|
611
|
+
readonly metadata: {
|
|
612
|
+
readonly source: "default_pricing_catalog";
|
|
613
|
+
};
|
|
614
|
+
}, {
|
|
615
|
+
readonly key: "remote_mcp_standard_call";
|
|
616
|
+
readonly productArea: "provider";
|
|
617
|
+
readonly unit: "1000_calls";
|
|
618
|
+
readonly basePriceMicros: 100000n;
|
|
619
|
+
readonly currency: "USD";
|
|
620
|
+
readonly publicLabel: "Remote MCP tool call";
|
|
621
|
+
readonly publicUnitLabel: "1,000 successful tool calls";
|
|
622
|
+
readonly publicNotes: ["Billed only after successful tool execution. Provider-specific rules may override this rate."];
|
|
623
|
+
readonly publicVisible: true;
|
|
624
|
+
readonly enabled: true;
|
|
625
|
+
readonly metadata: {
|
|
626
|
+
readonly source: "default_pricing_catalog";
|
|
627
|
+
};
|
|
628
|
+
}, {
|
|
629
|
+
readonly key: "knowledge_search_standard";
|
|
630
|
+
readonly productArea: "knowledge";
|
|
631
|
+
readonly unit: "1000_calls";
|
|
632
|
+
readonly basePriceMicros: 400000n;
|
|
633
|
+
readonly currency: "USD";
|
|
634
|
+
readonly publicLabel: "Knowledge search";
|
|
635
|
+
readonly publicUnitLabel: "1,000 searches";
|
|
636
|
+
readonly publicNotes: ["Knowledge lookup, search, verification, and indexing can have separate rules."];
|
|
637
|
+
readonly publicVisible: true;
|
|
638
|
+
readonly enabled: true;
|
|
639
|
+
readonly metadata: {
|
|
640
|
+
readonly source: "default_pricing_catalog";
|
|
641
|
+
};
|
|
642
|
+
}, {
|
|
643
|
+
readonly key: "model_input_tokens_default";
|
|
644
|
+
readonly productArea: "model";
|
|
645
|
+
readonly unit: "1m_input_tokens";
|
|
646
|
+
readonly basePriceMicros: 0n;
|
|
647
|
+
readonly currency: "USD";
|
|
648
|
+
readonly publicLabel: "Model input tokens";
|
|
649
|
+
readonly publicUnitLabel: "1M input tokens";
|
|
650
|
+
readonly publicNotes: ["Stacklink Models will publish model-specific token rates."];
|
|
651
|
+
readonly publicVisible: true;
|
|
652
|
+
readonly enabled: true;
|
|
653
|
+
readonly metadata: {
|
|
654
|
+
readonly source: "default_pricing_catalog";
|
|
655
|
+
};
|
|
656
|
+
}, {
|
|
657
|
+
readonly key: "model_output_tokens_default";
|
|
658
|
+
readonly productArea: "model";
|
|
659
|
+
readonly unit: "1m_output_tokens";
|
|
660
|
+
readonly basePriceMicros: 0n;
|
|
661
|
+
readonly currency: "USD";
|
|
662
|
+
readonly publicLabel: "Model output tokens";
|
|
663
|
+
readonly publicUnitLabel: "1M output tokens";
|
|
664
|
+
readonly publicNotes: ["Stacklink Models will publish model-specific token rates."];
|
|
665
|
+
readonly publicVisible: true;
|
|
666
|
+
readonly enabled: true;
|
|
667
|
+
readonly metadata: {
|
|
668
|
+
readonly source: "default_pricing_catalog";
|
|
669
|
+
};
|
|
670
|
+
}];
|
|
671
|
+
export declare const pricingRuleCatalog: [{
|
|
672
|
+
readonly key: "standard_ops_default";
|
|
673
|
+
readonly scope: "global";
|
|
674
|
+
readonly operationClass: "standard";
|
|
675
|
+
readonly baseRateKey: "standard_ops_included";
|
|
676
|
+
readonly markupBasis: "none";
|
|
677
|
+
readonly markupBps: 0;
|
|
678
|
+
readonly priority: 100000;
|
|
679
|
+
readonly currency: "USD";
|
|
680
|
+
readonly publicLabel: "Standard operations";
|
|
681
|
+
readonly publicDescription: "Standard Stacklink work is included with the project plan unless a more specific pricing rule applies.";
|
|
682
|
+
readonly publicUnitLabel: "operation";
|
|
683
|
+
readonly publicNotes: ["Included plan limits and overage rules still apply."];
|
|
684
|
+
readonly publicVisible: true;
|
|
685
|
+
readonly enabled: true;
|
|
686
|
+
readonly version: "stacklink-pricing-v1";
|
|
687
|
+
readonly metadata: {
|
|
688
|
+
readonly source: "default_pricing_catalog";
|
|
689
|
+
};
|
|
690
|
+
}, {
|
|
691
|
+
readonly key: "premium_ops_default";
|
|
692
|
+
readonly scope: "global";
|
|
693
|
+
readonly operationClass: "premium";
|
|
694
|
+
readonly baseRateKey: "premium_ops_included";
|
|
695
|
+
readonly markupBasis: "none";
|
|
696
|
+
readonly markupBps: 0;
|
|
697
|
+
readonly priority: 100001;
|
|
698
|
+
readonly currency: "USD";
|
|
699
|
+
readonly publicLabel: "Premium operations";
|
|
700
|
+
readonly publicDescription: "Premium Stacklink work is included with the project plan unless a more specific pricing rule applies.";
|
|
701
|
+
readonly publicUnitLabel: "operation";
|
|
702
|
+
readonly publicNotes: ["Included plan limits and overage rules still apply."];
|
|
703
|
+
readonly publicVisible: true;
|
|
704
|
+
readonly enabled: true;
|
|
705
|
+
readonly version: "stacklink-pricing-v1";
|
|
706
|
+
readonly metadata: {
|
|
707
|
+
readonly source: "default_pricing_catalog";
|
|
708
|
+
};
|
|
709
|
+
}, {
|
|
710
|
+
readonly key: "free_ops_default";
|
|
711
|
+
readonly scope: "global";
|
|
712
|
+
readonly operationClass: "free";
|
|
713
|
+
readonly baseRateKey: "standard_ops_included";
|
|
714
|
+
readonly markupBasis: "none";
|
|
715
|
+
readonly markupBps: 0;
|
|
716
|
+
readonly priority: 100002;
|
|
717
|
+
readonly currency: "USD";
|
|
718
|
+
readonly publicLabel: "Free operations";
|
|
719
|
+
readonly publicDescription: "Free Stacklink operations do not count toward metered usage.";
|
|
720
|
+
readonly publicUnitLabel: "operation";
|
|
721
|
+
readonly publicNotes: ["No usage charge applies."];
|
|
722
|
+
readonly publicVisible: true;
|
|
723
|
+
readonly enabled: true;
|
|
724
|
+
readonly version: "stacklink-pricing-v1";
|
|
725
|
+
readonly metadata: {
|
|
726
|
+
readonly source: "default_pricing_catalog";
|
|
727
|
+
};
|
|
728
|
+
}];
|
|
729
|
+
export declare const defaultBillingPlanKey: BillingPlanKey;
|
|
730
|
+
export declare function billingPlanByKey(key: string, agreementVersion?: string): BillingPlanDefinition | undefined;
|
|
731
|
+
export declare function serializeBillingPlanDefinition(plan: BillingPlanDefinition): {
|
|
732
|
+
key: BillingPlanKey;
|
|
733
|
+
displayName: string;
|
|
734
|
+
monthlyPriceCents: number;
|
|
735
|
+
annualPriceCents: number | null;
|
|
736
|
+
standardOpsIncluded: number;
|
|
737
|
+
premiumOpsIncluded: number;
|
|
738
|
+
standardOveragePerThousandCents: number;
|
|
739
|
+
premiumOveragePerThousandCents: number;
|
|
740
|
+
rateLimitPerMinute: number;
|
|
741
|
+
logRetentionDays: number;
|
|
742
|
+
projectsIncluded: number | null;
|
|
743
|
+
description: string | null;
|
|
744
|
+
supportLabel: string | null;
|
|
745
|
+
selfServe: boolean;
|
|
746
|
+
metadata: Record<string, unknown>;
|
|
747
|
+
resources: ResourceTerms[];
|
|
748
|
+
availableIntervals: "monthly"[];
|
|
749
|
+
};
|
|
750
|
+
export declare function serializeBillingContract(): {
|
|
751
|
+
version: "stacklink-billing-v1";
|
|
752
|
+
standardMeterName: "standard_ops";
|
|
753
|
+
premiumMeterName: "premium_ops";
|
|
754
|
+
premiumRuntimeUnitSeconds: 10;
|
|
755
|
+
sandboxMultipliers: {
|
|
756
|
+
standard: 1;
|
|
757
|
+
medium: 2;
|
|
758
|
+
large: 3;
|
|
759
|
+
};
|
|
760
|
+
meters: {
|
|
761
|
+
standard_ops: {
|
|
762
|
+
label: "Standard ops";
|
|
763
|
+
description: "Normal Stacklink API, MCP, provider tool, trigger, webhook, knowledge, and connection work.";
|
|
764
|
+
};
|
|
765
|
+
premium_ops: {
|
|
766
|
+
label: "Premium ops";
|
|
767
|
+
description: "Stacklink-paid variable infra work such as workbench runtime, web search, LLM helpers, OCR, extraction, and heavy compute.";
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
export declare function billingPolicyForOperation(operation: BillingOperationKey): BillingPolicyClass;
|
|
772
|
+
export declare function publicBillingSummaryForPolicy(policy: BillingPolicyClass, agreementVersion?: string): PublicBillingSummary;
|
|
773
|
+
export declare function publicBillingSummaryForDescriptor(billing: StacklinkBillingDescriptor): PublicBillingSummary;
|
|
774
|
+
export declare function serializeBillingBaseRateDefinition(rate: BillingBaseRateDefinition): {
|
|
775
|
+
key: string;
|
|
776
|
+
productArea: BillingProductArea;
|
|
777
|
+
unit: PricingUnit;
|
|
778
|
+
basePriceMicros: string;
|
|
779
|
+
currency: "USD";
|
|
780
|
+
publicLabel: string;
|
|
781
|
+
publicUnitLabel: string;
|
|
782
|
+
publicNotes: string[];
|
|
783
|
+
publicVisible: boolean;
|
|
784
|
+
enabled: boolean;
|
|
785
|
+
metadata: Record<string, unknown>;
|
|
786
|
+
};
|
|
787
|
+
export declare function formatPricingPriceText(input: {
|
|
788
|
+
billingModel: InternalPricingSummary['billingModel'];
|
|
789
|
+
unitLabel: string;
|
|
790
|
+
priceMicros: bigint;
|
|
791
|
+
currency: 'USD';
|
|
792
|
+
}): string;
|
|
793
|
+
export declare function billingDescriptor(operationClass: UsageOperationClass, unit: BillingUnit, quantitySource: BillingQuantitySource, multiplier?: BillingMultiplier | undefined): StacklinkBillingDescriptor;
|
|
794
|
+
export declare function runtimeBillingDescriptorForSandboxSize(sandboxSize: 'standard' | 'medium' | 'large' | string | null | undefined): StacklinkBillingDescriptor;
|
|
795
|
+
export declare function billingDescriptorFromUnknown(value: unknown): StacklinkBillingDescriptor | undefined;
|
|
796
|
+
export declare function calculateMeteredOps(input: MeteredOpsInput): MeteredOpsResult;
|
|
797
|
+
/**
|
|
798
|
+
* Returns one transparent customer quantity for a normalized rich-content
|
|
799
|
+
* item. The largest typed dimension wins so the same content is not charged
|
|
800
|
+
* once for its text and again for its pages or duration.
|
|
801
|
+
*/
|
|
802
|
+
export declare function calculateRichContentPremiumQuantity(input: RichContentBillingDimensions): number;
|
|
803
|
+
export declare function calculateOverageCents(overage: number, overagePerThousandCents: number): number;
|
|
804
|
+
/** Integer micro-dollars are retained until a complete invoice line is rounded. */
|
|
805
|
+
export declare function microsToCents(micros: bigint): number;
|
|
806
|
+
export declare function standardChargeMicros(used: number, included: number, ratePerThousandCents: number): bigint;
|
|
807
|
+
/** Anchor each boundary to the original day, including January 31 and leap years. */
|
|
808
|
+
export declare function billingMonthBoundary(anchor: Date, months: number): Date;
|
|
809
|
+
export declare function allowancePeriod(anchor: Date, now: Date, paidEnd?: Date | null): {
|
|
810
|
+
periodStart: Date;
|
|
811
|
+
periodEnd: Date;
|
|
812
|
+
};
|
|
813
|
+
export declare const stagingManagedRateCard: {
|
|
814
|
+
readonly version: "staging-test-2026-09";
|
|
815
|
+
readonly testOnly: true;
|
|
816
|
+
readonly unitMicros: {
|
|
817
|
+
readonly call: 10000n;
|
|
818
|
+
readonly runtime_10s: 20000n;
|
|
819
|
+
readonly token_block: 10000n;
|
|
820
|
+
readonly byte_block: 1000n;
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
/** The current self-service upgrade. Legacy agreement migrations retain their
|
|
824
|
+
* explicit renewal flow; price comparisons must not change negotiated terms. */
|
|
825
|
+
export declare function billingPlanChangeTiming(from: string, to: string): 'immediate' | 'renewal';
|
|
826
|
+
export {};
|
|
827
|
+
//# sourceMappingURL=billing-plans.d.ts.map
|