@opengeni/config 3.1.1-canary.36898512512001 → 3.1.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/dist/claude-subscription-capacity.d.ts +9 -0
- package/dist/claude-subscription-usage.d.ts +4 -2
- package/dist/credit-promotions.d.ts +25 -0
- package/dist/index.d.ts +1544 -65
- package/dist/index.js +3473 -642
- package/dist/index.js.map +1 -1
- package/dist/realtime-voice-pricing.d.ts +30 -0
- package/dist/subscription-account-selection.d.ts +17 -0
- package/dist/web-search.d.ts +174 -0
- package/package.json +5 -5
- package/src/claude-subscription-capacity.ts +129 -0
- package/src/claude-subscription-usage.ts +225 -5
- package/src/credit-promotions.ts +68 -0
- package/src/index.ts +3345 -201
- package/src/realtime-voice-pricing.ts +83 -0
- package/src/subscription-account-selection.ts +36 -0
- package/src/web-search.ts +600 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ClaudeSubscriptionUsage, ClaudeUsageWindow } from "@opengeni/contracts";
|
|
2
|
+
/** Evaluate provider-reported plan capacity and its explicitly allowed paid fallback. */
|
|
3
|
+
export declare function claudeSubscriptionCapacity(usage: ClaudeSubscriptionUsage, upstreamModelId: string, now: Date, options?: {
|
|
4
|
+
allowOverage?: boolean;
|
|
5
|
+
}): {
|
|
6
|
+
available: boolean;
|
|
7
|
+
nextCheckAt: Date | null;
|
|
8
|
+
blockingWindows: ClaudeUsageWindow["id"][];
|
|
9
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { type ClaudeSubscriptionUsage, type ClaudeUsageWindow } from "@opengeni/contracts";
|
|
1
|
+
import { type ClaudeSubscriptionUsage, type ClaudeUsageWindow, type ClaudeUsageRequestStatus } from "@opengeni/contracts";
|
|
2
2
|
export type ClaudeUsageObservation = {
|
|
3
3
|
windows: ClaudeUsageWindow[];
|
|
4
4
|
observedAt: string;
|
|
5
5
|
source: "response_headers" | "provider";
|
|
6
|
+
requestStatus?: ClaudeUsageRequestStatus | null;
|
|
7
|
+
requestRestrictions?: ClaudeUsageRequestStatus[];
|
|
6
8
|
};
|
|
7
|
-
export declare function parseClaudeUsageHeaders(headers: Headers, now?: Date): ClaudeUsageObservation | null;
|
|
9
|
+
export declare function parseClaudeUsageHeaders(headers: Headers, now?: Date, upstreamModelId?: string): ClaudeUsageObservation | null;
|
|
8
10
|
export declare function parseClaudeUsageResponse(value: unknown, now?: Date): ClaudeUsageObservation | null;
|
|
9
11
|
export declare function emptyClaudeUsage(credentialVersion: number | null): ClaudeSubscriptionUsage;
|
|
10
12
|
/** Preserve omitted windows and reject observations older than their individual window. */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PromotionalCreditScope } from "@opengeni/contracts";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** Operator configuration only. Keys are Stripe coupon IDs, never customer account IDs. */
|
|
4
|
+
export declare const CreditPromotionPolicy: z.ZodObject<{
|
|
5
|
+
defaultModelIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
6
|
+
signupModelIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
7
|
+
offers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8
|
+
label: z.ZodString;
|
|
9
|
+
eligibleModelIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
10
|
+
}, z.core.$strict>>>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export declare const EnvCreditPromotionPolicy: z.ZodPreprocess<z.ZodDefault<z.ZodObject<{
|
|
13
|
+
defaultModelIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
14
|
+
signupModelIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
15
|
+
offers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
16
|
+
label: z.ZodString;
|
|
17
|
+
eligibleModelIds: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
18
|
+
}, z.core.$strict>>>;
|
|
19
|
+
}, z.core.$strict>>>;
|
|
20
|
+
export declare function signupCreditModelIds(settings: {
|
|
21
|
+
creditPromotionPolicy: z.infer<typeof CreditPromotionPolicy>;
|
|
22
|
+
}): string[] | undefined;
|
|
23
|
+
export declare function promotionalCreditScope(settings: {
|
|
24
|
+
creditPromotionPolicy: z.infer<typeof CreditPromotionPolicy>;
|
|
25
|
+
}, couponId: string): PromotionalCreditScope | undefined;
|