@opengeni/config 3.2.1-canary.37062299158001 → 3.2.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/claude-subscription-usage.d.ts +2 -4
- package/dist/index.d.ts +3 -199
- package/dist/index.js +31 -481
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/claude-subscription-usage.ts +5 -225
- package/src/index.ts +21 -333
- package/dist/claude-subscription-capacity.d.ts +0 -9
- package/dist/subscription-account-selection.d.ts +0 -17
- package/src/claude-subscription-capacity.ts +0 -129
- package/src/subscription-account-selection.ts +0 -36
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { type ClaudeSubscriptionUsage, type ClaudeUsageWindow
|
|
1
|
+
import { type ClaudeSubscriptionUsage, type ClaudeUsageWindow } 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[];
|
|
8
6
|
};
|
|
9
|
-
export declare function parseClaudeUsageHeaders(headers: Headers, now?: Date
|
|
7
|
+
export declare function parseClaudeUsageHeaders(headers: Headers, now?: Date): ClaudeUsageObservation | null;
|
|
10
8
|
export declare function parseClaudeUsageResponse(value: unknown, now?: Date): ClaudeUsageObservation | null;
|
|
11
9
|
export declare function emptyClaudeUsage(credentialVersion: number | null): ClaudeSubscriptionUsage;
|
|
12
10
|
/** Preserve omitted windows and reject observations older than their individual window. */
|
package/dist/index.d.ts
CHANGED
|
@@ -130,9 +130,6 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
130
130
|
analyticsPosthogProjectKey: z.ZodOptional<z.ZodString>;
|
|
131
131
|
analyticsPosthogHost: z.ZodOptional<z.ZodString>;
|
|
132
132
|
analyticsGa4MeasurementId: z.ZodOptional<z.ZodString>;
|
|
133
|
-
legalPrivacyPolicyUrl: z.ZodOptional<z.ZodString>;
|
|
134
|
-
legalTermsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
135
|
-
supportEmail: z.ZodOptional<z.ZodString>;
|
|
136
133
|
publicBaseUrl: z.ZodOptional<z.ZodString>;
|
|
137
134
|
documentationUrl: z.ZodPreprocess<z.ZodDefault<z.ZodNullable<z.ZodURL>>>;
|
|
138
135
|
mcpOauthEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
|
|
@@ -183,8 +180,6 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
183
180
|
browser_auth: "browser_auth";
|
|
184
181
|
browser_clipboard: "browser_clipboard";
|
|
185
182
|
browser_debug: "browser_debug";
|
|
186
|
-
browser_download_save: "browser_download_save";
|
|
187
|
-
browser_downloads: "browser_downloads";
|
|
188
183
|
browser_identity: "browser_identity";
|
|
189
184
|
browser_lifecycle: "browser_lifecycle";
|
|
190
185
|
browser_observe: "browser_observe";
|
|
@@ -362,8 +357,6 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
362
357
|
browser_auth: "browser_auth";
|
|
363
358
|
browser_clipboard: "browser_clipboard";
|
|
364
359
|
browser_debug: "browser_debug";
|
|
365
|
-
browser_download_save: "browser_download_save";
|
|
366
|
-
browser_downloads: "browser_downloads";
|
|
367
360
|
browser_identity: "browser_identity";
|
|
368
361
|
browser_lifecycle: "browser_lifecycle";
|
|
369
362
|
browser_observe: "browser_observe";
|
|
@@ -832,7 +825,6 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
832
825
|
sandboxViewerHolderTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
833
826
|
sandboxInteractionHolderTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
834
827
|
sandboxIdleGraceMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
835
|
-
sandboxIdleCommandContainmentMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
836
828
|
sandboxSnapshotIntervalMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
837
829
|
sandboxSnapshotTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
838
830
|
sandboxDrainSnapshotTimeoutMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
@@ -1421,8 +1413,6 @@ export declare const RegistryProviderKind: z.ZodEnum<{
|
|
|
1421
1413
|
"claude-subscription-organization": "claude-subscription-organization";
|
|
1422
1414
|
"claude-subscription-workspace": "claude-subscription-workspace";
|
|
1423
1415
|
"codex-subscription": "codex-subscription";
|
|
1424
|
-
"direct-azure-workspace": "direct-azure-workspace";
|
|
1425
|
-
"direct-openai-workspace": "direct-openai-workspace";
|
|
1426
1416
|
"openrouter-organization": "openrouter-organization";
|
|
1427
1417
|
"openrouter-workspace": "openrouter-workspace";
|
|
1428
1418
|
"vercel-gateway-managed": "vercel-gateway-managed";
|
|
@@ -1480,8 +1470,6 @@ declare const RegistryProviderSchema: z.ZodObject<{
|
|
|
1480
1470
|
"claude-subscription-organization": "claude-subscription-organization";
|
|
1481
1471
|
"claude-subscription-workspace": "claude-subscription-workspace";
|
|
1482
1472
|
"codex-subscription": "codex-subscription";
|
|
1483
|
-
"direct-azure-workspace": "direct-azure-workspace";
|
|
1484
|
-
"direct-openai-workspace": "direct-openai-workspace";
|
|
1485
1473
|
"openrouter-organization": "openrouter-organization";
|
|
1486
1474
|
"openrouter-workspace": "openrouter-workspace";
|
|
1487
1475
|
"vercel-gateway-managed": "vercel-gateway-managed";
|
|
@@ -2154,7 +2142,7 @@ export declare const ModelCatalogDocument: z.ZodObject<{
|
|
|
2154
2142
|
publicDefaultHeaderNames: z.ZodOptional<z.ZodNever>;
|
|
2155
2143
|
publicDefaultQueryNames: z.ZodOptional<z.ZodNever>;
|
|
2156
2144
|
}, z.core.$strict>>>;
|
|
2157
|
-
codexModels: z.ZodOptional<z.ZodArray<z.
|
|
2145
|
+
codexModels: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2158
2146
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
2159
2147
|
label: z.ZodOptional<z.ZodString>;
|
|
2160
2148
|
shortLabel: z.ZodOptional<z.ZodString>;
|
|
@@ -2313,165 +2301,7 @@ export declare const ModelCatalogDocument: z.ZodObject<{
|
|
|
2313
2301
|
}, z.core.$strip>>;
|
|
2314
2302
|
}, z.core.$strip>;
|
|
2315
2303
|
pricing: z.ZodOptional<z.ZodNever>;
|
|
2316
|
-
}, z.core.$strict
|
|
2317
|
-
aliases?: string[] | undefined;
|
|
2318
|
-
label?: string | undefined;
|
|
2319
|
-
shortLabel?: string | undefined;
|
|
2320
|
-
contextWindowTokens?: number | undefined;
|
|
2321
|
-
effectiveContextWindowTokens?: number | undefined;
|
|
2322
|
-
autoCompactTokenLimit?: number | undefined;
|
|
2323
|
-
toolOutputTruncationTokens?: number | undefined;
|
|
2324
|
-
reasoningEffort?: boolean | undefined;
|
|
2325
|
-
hostedWebSearch?: boolean | undefined;
|
|
2326
|
-
credentialSource?: undefined;
|
|
2327
|
-
billing?: undefined;
|
|
2328
|
-
retired?: boolean | undefined;
|
|
2329
|
-
id: string;
|
|
2330
|
-
upstreamModelId: string;
|
|
2331
|
-
pricing?: undefined;
|
|
2332
|
-
capabilities: {
|
|
2333
|
-
reasoning: {
|
|
2334
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2335
|
-
runnable: boolean;
|
|
2336
|
-
efforts: ("high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh")[];
|
|
2337
|
-
defaultEffort: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | null;
|
|
2338
|
-
required: boolean;
|
|
2339
|
-
};
|
|
2340
|
-
functionCalling: {
|
|
2341
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2342
|
-
runnable: boolean;
|
|
2343
|
-
};
|
|
2344
|
-
structuredOutput: {
|
|
2345
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2346
|
-
runnable: boolean;
|
|
2347
|
-
};
|
|
2348
|
-
hostedTools: {
|
|
2349
|
-
webSearch: {
|
|
2350
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2351
|
-
runnable: boolean;
|
|
2352
|
-
};
|
|
2353
|
-
xSearch: {
|
|
2354
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2355
|
-
runnable: boolean;
|
|
2356
|
-
};
|
|
2357
|
-
codeExecution: {
|
|
2358
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2359
|
-
runnable: boolean;
|
|
2360
|
-
};
|
|
2361
|
-
imageGeneration: {
|
|
2362
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2363
|
-
runnable: boolean;
|
|
2364
|
-
};
|
|
2365
|
-
};
|
|
2366
|
-
inputModalities: ("audio" | "image" | "text")[];
|
|
2367
|
-
inputFileMediaTypes: string[];
|
|
2368
|
-
outputModalities: ("audio" | "image" | "text")[];
|
|
2369
|
-
transports: {
|
|
2370
|
-
sse: {
|
|
2371
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2372
|
-
runnable: boolean;
|
|
2373
|
-
};
|
|
2374
|
-
responsesWebSocket: {
|
|
2375
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2376
|
-
runnable: boolean;
|
|
2377
|
-
};
|
|
2378
|
-
realtimeAudio: {
|
|
2379
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2380
|
-
runnable: boolean;
|
|
2381
|
-
};
|
|
2382
|
-
};
|
|
2383
|
-
promptCaching?: {
|
|
2384
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2385
|
-
runnable: boolean;
|
|
2386
|
-
mode: "automatic" | "implicit" | "none";
|
|
2387
|
-
} | undefined;
|
|
2388
|
-
latencyModes: {
|
|
2389
|
-
id: "fast" | "priority" | "standard";
|
|
2390
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2391
|
-
runnable: boolean;
|
|
2392
|
-
billingMultiplierBps?: number | undefined;
|
|
2393
|
-
}[];
|
|
2394
|
-
};
|
|
2395
|
-
}, {
|
|
2396
|
-
aliases?: string[] | undefined;
|
|
2397
|
-
label?: string | undefined;
|
|
2398
|
-
shortLabel?: string | undefined;
|
|
2399
|
-
contextWindowTokens?: number | undefined;
|
|
2400
|
-
effectiveContextWindowTokens?: number | undefined;
|
|
2401
|
-
autoCompactTokenLimit?: number | undefined;
|
|
2402
|
-
toolOutputTruncationTokens?: number | undefined;
|
|
2403
|
-
reasoningEffort?: boolean | undefined;
|
|
2404
|
-
hostedWebSearch?: boolean | undefined;
|
|
2405
|
-
credentialSource?: undefined;
|
|
2406
|
-
billing?: undefined;
|
|
2407
|
-
retired?: boolean | undefined;
|
|
2408
|
-
id: string;
|
|
2409
|
-
upstreamModelId: string;
|
|
2410
|
-
capabilities: {
|
|
2411
|
-
reasoning: {
|
|
2412
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2413
|
-
runnable: boolean;
|
|
2414
|
-
efforts: ("high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh")[];
|
|
2415
|
-
defaultEffort: "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh" | null;
|
|
2416
|
-
required: boolean;
|
|
2417
|
-
};
|
|
2418
|
-
functionCalling: {
|
|
2419
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2420
|
-
runnable: boolean;
|
|
2421
|
-
};
|
|
2422
|
-
structuredOutput: {
|
|
2423
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2424
|
-
runnable: boolean;
|
|
2425
|
-
};
|
|
2426
|
-
hostedTools: {
|
|
2427
|
-
webSearch: {
|
|
2428
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2429
|
-
runnable: boolean;
|
|
2430
|
-
};
|
|
2431
|
-
xSearch: {
|
|
2432
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2433
|
-
runnable: boolean;
|
|
2434
|
-
};
|
|
2435
|
-
codeExecution: {
|
|
2436
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2437
|
-
runnable: boolean;
|
|
2438
|
-
};
|
|
2439
|
-
imageGeneration: {
|
|
2440
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2441
|
-
runnable: boolean;
|
|
2442
|
-
};
|
|
2443
|
-
};
|
|
2444
|
-
inputModalities: ("audio" | "image" | "text")[];
|
|
2445
|
-
inputFileMediaTypes: string[];
|
|
2446
|
-
outputModalities: ("audio" | "image" | "text")[];
|
|
2447
|
-
transports: {
|
|
2448
|
-
sse: {
|
|
2449
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2450
|
-
runnable: boolean;
|
|
2451
|
-
};
|
|
2452
|
-
responsesWebSocket: {
|
|
2453
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2454
|
-
runnable: boolean;
|
|
2455
|
-
};
|
|
2456
|
-
realtimeAudio: {
|
|
2457
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2458
|
-
runnable: boolean;
|
|
2459
|
-
};
|
|
2460
|
-
};
|
|
2461
|
-
promptCaching?: {
|
|
2462
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2463
|
-
runnable: boolean;
|
|
2464
|
-
mode: "automatic" | "implicit" | "none";
|
|
2465
|
-
} | undefined;
|
|
2466
|
-
latencyModes: {
|
|
2467
|
-
id: "fast" | "priority" | "standard";
|
|
2468
|
-
upstream: "supported" | "unknown" | "unsupported";
|
|
2469
|
-
runnable: boolean;
|
|
2470
|
-
billingMultiplierBps?: number | undefined;
|
|
2471
|
-
}[];
|
|
2472
|
-
};
|
|
2473
|
-
pricing?: undefined;
|
|
2474
|
-
}>>>>;
|
|
2304
|
+
}, z.core.$strict>>>;
|
|
2475
2305
|
gatewayModels: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
2476
2306
|
productId: z.ZodString;
|
|
2477
2307
|
workspaceProductId: z.ZodString;
|
|
@@ -2892,17 +2722,6 @@ export declare function collectSandboxEnvironment(settings: Settings, source?: N
|
|
|
2892
2722
|
*/
|
|
2893
2723
|
export declare function resolveProviderApiKey(provider: Pick<RegistryProvider, "apiKey" | "apiKeyEnv">, source?: NodeJS.ProcessEnv): string | undefined;
|
|
2894
2724
|
export declare function gatewayRequestPolicyForUpstreamModel(upstreamModelId: string, models?: readonly GatewayCatalogModel[]): ConfiguredModel["requestPolicy"];
|
|
2895
|
-
/** Customer-owned OpenAI/Azure routes, bound to immutable connection identity. */
|
|
2896
|
-
export declare function withDirectModelProviders(settings: Settings, connections: readonly {
|
|
2897
|
-
id: string;
|
|
2898
|
-
version: number;
|
|
2899
|
-
subjectId: string | null;
|
|
2900
|
-
kind: string;
|
|
2901
|
-
status: string;
|
|
2902
|
-
providerDomain: string;
|
|
2903
|
-
metadata: Record<string, unknown>;
|
|
2904
|
-
apiKey?: string;
|
|
2905
|
-
}[]): Settings;
|
|
2906
2725
|
/** Static catalog overlay; it contains no concrete workspace credential. */
|
|
2907
2726
|
export declare function withWorkspaceGatewayCatalogProvider(settings: Settings, customModels?: readonly {
|
|
2908
2727
|
upstreamModelId: string;
|
|
@@ -2964,13 +2783,6 @@ export declare function serviceTierForLatencyMode(providerId: string, latencyMod
|
|
|
2964
2783
|
/** True when the response tier fulfills a non-standard Fast/priority request. */
|
|
2965
2784
|
export declare function responseSatisfiesLatencyMode(requested: LatencyMode, responseServiceTier: string | null | undefined): boolean;
|
|
2966
2785
|
export declare function runnableLatencyModesForModel(settings: Settings, modelId: string): LatencyMode[];
|
|
2967
|
-
export declare class UnsupportedLatencyModeError extends Error {
|
|
2968
|
-
readonly modelId: string;
|
|
2969
|
-
readonly latencyMode: LatencyMode;
|
|
2970
|
-
readonly allowedLatencyModes: readonly LatencyMode[];
|
|
2971
|
-
readonly code = "UNSUPPORTED_LATENCY_MODE";
|
|
2972
|
-
constructor(modelId: string, latencyMode: LatencyMode, allowedLatencyModes: readonly LatencyMode[]);
|
|
2973
|
-
}
|
|
2974
2786
|
export declare function modelCostClassForConfiguredModel(_settings: Settings, model: Pick<ConfiguredModel, "cost">): ConfiguredModelCostClass;
|
|
2975
2787
|
/**
|
|
2976
2788
|
* The built-in provider's stable id: "openai" on the OpenAI platform, "azure"
|
|
@@ -3086,7 +2898,7 @@ export declare class TurnExecutionPolicyDefinitionMismatchError extends Error {
|
|
|
3086
2898
|
/**
|
|
3087
2899
|
* Parse-time validation lives in @opengeni/contracts; this verifier binds a
|
|
3088
2900
|
* present snapshot to the current executable definition and exact turn row.
|
|
3089
|
-
*
|
|
2901
|
+
* Any deployment/provider drift fails before a provider or compaction call.
|
|
3090
2902
|
*/
|
|
3091
2903
|
export declare function assertTurnExecutionPolicyMatchesConfigV1(settings: Settings, policy: TurnExecutionPolicyV1, expected: {
|
|
3092
2904
|
modelId: string;
|
|
@@ -3410,12 +3222,6 @@ export declare function sandboxImageAllowlist(settings: Pick<Settings, "sandboxI
|
|
|
3410
3222
|
/** Native Claude connections reuse the encrypted workspace and organization boundaries. */
|
|
3411
3223
|
export declare const CLAUDE_CONNECTION_KINDS: readonly ["anthropic", "claude_subscription"];
|
|
3412
3224
|
export type ClaudeConnectionKind = (typeof CLAUDE_CONNECTION_KINDS)[number];
|
|
3413
|
-
export declare function claudeNativeModelProfile(upstreamModelId: string): Readonly<{
|
|
3414
|
-
efforts: readonly ReasoningEffort[];
|
|
3415
|
-
defaultEffort: ReasoningEffort | null;
|
|
3416
|
-
contextWindowTokens: number;
|
|
3417
|
-
maxOutputTokens: number;
|
|
3418
|
-
}> | undefined;
|
|
3419
3225
|
export declare function claudeProviderId(kind: ClaudeConnectionKind, scope?: "workspace" | "organization"): string;
|
|
3420
3226
|
export type ClaudeConnectionCatalog = Partial<Record<ClaudeConnectionKind, {
|
|
3421
3227
|
active?: boolean;
|
|
@@ -3431,5 +3237,3 @@ export declare function withClaudeConnectionCredential(settings: Settings, kind:
|
|
|
3431
3237
|
}): Settings;
|
|
3432
3238
|
export * from "./claude-subscription-usage.js";
|
|
3433
3239
|
export * from "./claude-subscription-oauth.js";
|
|
3434
|
-
export * from "./subscription-account-selection.js";
|
|
3435
|
-
export * from "./claude-subscription-capacity.js";
|