@opengeni/config 0.22.5-canary.1 → 0.23.2-canary.0
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/index.d.ts +56 -10
- package/dist/index.js +215 -48
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +306 -59
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export declare const McpServerConnectionRefSchema: z.ZodObject<{
|
|
|
59
59
|
id: z.ZodString;
|
|
60
60
|
kind: z.ZodLiteral<"repository">;
|
|
61
61
|
}, z.core.$strict>>>;
|
|
62
|
+
authoritySource: z.ZodOptional<z.ZodLiteral<"host">>;
|
|
62
63
|
subjectScope: z.ZodOptional<z.ZodEnum<{
|
|
63
64
|
subject: "subject";
|
|
64
65
|
workspace: "workspace";
|
|
@@ -474,6 +475,7 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
474
475
|
goalIdleBackoffMs: z.ZodDefault<z.ZodPreprocess<z.ZodReadonly<z.ZodArray<z.ZodNumber>>>>;
|
|
475
476
|
goalIdleBackoffMaxMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
476
477
|
childLifecycleNoticesEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
|
|
478
|
+
hostMcpAuthoritySourceAdmissionEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
|
|
477
479
|
slackWorkspaceRoutingEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
|
|
478
480
|
agentMaxModelCallsPerTurn: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
479
481
|
contextWindowTokens: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -710,6 +712,7 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
710
712
|
sandboxIdleGraceMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
711
713
|
sandboxSnapshotIntervalMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
712
714
|
sandboxSnapshotTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
715
|
+
sandboxDrainSnapshotTimeoutMs: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
713
716
|
sandboxRotationLeadMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
714
717
|
sandboxRotationBatchSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
715
718
|
sandboxLeaseTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
@@ -829,6 +832,7 @@ declare const SettingsSchema: z.ZodObject<{
|
|
|
829
832
|
id: z.ZodString;
|
|
830
833
|
kind: z.ZodLiteral<"repository">;
|
|
831
834
|
}, z.core.$strict>>>;
|
|
835
|
+
authoritySource: z.ZodOptional<z.ZodLiteral<"host">>;
|
|
832
836
|
subjectScope: z.ZodOptional<z.ZodEnum<{
|
|
833
837
|
subject: "subject";
|
|
834
838
|
workspace: "workspace";
|
|
@@ -920,6 +924,7 @@ export type TemporalConnectionOptions = {
|
|
|
920
924
|
export type ModelPricing = {
|
|
921
925
|
inputMicrosPerMillionTokens: number;
|
|
922
926
|
cachedInputMicrosPerMillionTokens?: number | undefined;
|
|
927
|
+
cacheWriteMicrosPerMillionTokens?: number | undefined;
|
|
923
928
|
outputMicrosPerMillionTokens: number;
|
|
924
929
|
marginBps?: number | undefined;
|
|
925
930
|
};
|
|
@@ -1123,9 +1128,12 @@ export type CredentialSourceV1 = {
|
|
|
1123
1128
|
} | {
|
|
1124
1129
|
kind: "workspace_connection";
|
|
1125
1130
|
mechanism: "api_key";
|
|
1131
|
+
} | {
|
|
1132
|
+
kind: "organization_connection";
|
|
1133
|
+
mechanism: "api_key";
|
|
1126
1134
|
};
|
|
1127
1135
|
export type BillingAttributionV1 = {
|
|
1128
|
-
upstreamPayer: "deployment" | "workspace" | "connected_subscription";
|
|
1136
|
+
upstreamPayer: "deployment" | "workspace" | "organization" | "connected_subscription";
|
|
1129
1137
|
metering: "opengeni_credits" | "external";
|
|
1130
1138
|
};
|
|
1131
1139
|
/**
|
|
@@ -1160,8 +1168,10 @@ export declare const RegistryProviderKind: z.ZodEnum<{
|
|
|
1160
1168
|
anonymous: "anonymous";
|
|
1161
1169
|
"api-key": "api-key";
|
|
1162
1170
|
"codex-subscription": "codex-subscription";
|
|
1171
|
+
"openrouter-organization": "openrouter-organization";
|
|
1163
1172
|
"openrouter-workspace": "openrouter-workspace";
|
|
1164
1173
|
"vercel-gateway-managed": "vercel-gateway-managed";
|
|
1174
|
+
"vercel-gateway-organization": "vercel-gateway-organization";
|
|
1165
1175
|
"vercel-gateway-workspace": "vercel-gateway-workspace";
|
|
1166
1176
|
"xai-subscription": "xai-subscription";
|
|
1167
1177
|
}>;
|
|
@@ -1172,8 +1182,10 @@ declare const RegistryProviderSchema: z.ZodObject<{
|
|
|
1172
1182
|
anonymous: "anonymous";
|
|
1173
1183
|
"api-key": "api-key";
|
|
1174
1184
|
"codex-subscription": "codex-subscription";
|
|
1185
|
+
"openrouter-organization": "openrouter-organization";
|
|
1175
1186
|
"openrouter-workspace": "openrouter-workspace";
|
|
1176
1187
|
"vercel-gateway-managed": "vercel-gateway-managed";
|
|
1188
|
+
"vercel-gateway-organization": "vercel-gateway-organization";
|
|
1177
1189
|
"vercel-gateway-workspace": "vercel-gateway-workspace";
|
|
1178
1190
|
"xai-subscription": "xai-subscription";
|
|
1179
1191
|
}>>;
|
|
@@ -1354,12 +1366,14 @@ declare const RegistryProviderSchema: z.ZodObject<{
|
|
|
1354
1366
|
pricing: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1355
1367
|
inputMicrosPerMillionTokens: z.ZodNumber;
|
|
1356
1368
|
cachedInputMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1369
|
+
cacheWriteMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1357
1370
|
outputMicrosPerMillionTokens: z.ZodNumber;
|
|
1358
1371
|
marginBps: z.ZodOptional<z.ZodNumber>;
|
|
1359
1372
|
}, z.core.$strip>, z.ZodObject<{
|
|
1360
1373
|
default: z.ZodObject<{
|
|
1361
1374
|
inputMicrosPerMillionTokens: z.ZodNumber;
|
|
1362
1375
|
cachedInputMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1376
|
+
cacheWriteMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1363
1377
|
outputMicrosPerMillionTokens: z.ZodNumber;
|
|
1364
1378
|
marginBps: z.ZodOptional<z.ZodNumber>;
|
|
1365
1379
|
}, z.core.$strip>;
|
|
@@ -1368,6 +1382,7 @@ declare const RegistryProviderSchema: z.ZodObject<{
|
|
|
1368
1382
|
pricing: z.ZodObject<{
|
|
1369
1383
|
inputMicrosPerMillionTokens: z.ZodNumber;
|
|
1370
1384
|
cachedInputMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1385
|
+
cacheWriteMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1371
1386
|
outputMicrosPerMillionTokens: z.ZodNumber;
|
|
1372
1387
|
marginBps: z.ZodOptional<z.ZodNumber>;
|
|
1373
1388
|
}, z.core.$strip>;
|
|
@@ -1381,10 +1396,14 @@ export type RegistryProvider = z.infer<typeof RegistryProviderSchema>;
|
|
|
1381
1396
|
export declare const OPENGENI_GATEWAY_PROVIDER_ID: "opengeni-gateway";
|
|
1382
1397
|
export declare const WORKSPACE_GATEWAY_PROVIDER_ID: "workspace-gateway";
|
|
1383
1398
|
export declare const WORKSPACE_GATEWAY_MODEL_ID_PREFIX: "workspace-gateway/";
|
|
1399
|
+
export declare const ORGANIZATION_GATEWAY_PROVIDER_ID: "organization-gateway";
|
|
1400
|
+
export declare const ORGANIZATION_GATEWAY_MODEL_ID_PREFIX: "organization-gateway/";
|
|
1384
1401
|
export declare const OPENROUTER_PROVIDER_ID: "openrouter";
|
|
1385
1402
|
export declare const OPENROUTER_MODEL_ID_PREFIX: "openrouter/";
|
|
1386
1403
|
export declare const WORKSPACE_OPENROUTER_PROVIDER_ID: "workspace-openrouter";
|
|
1387
1404
|
export declare const WORKSPACE_OPENROUTER_MODEL_ID_PREFIX: "workspace-openrouter/";
|
|
1405
|
+
export declare const ORGANIZATION_OPENROUTER_PROVIDER_ID: "organization-openrouter";
|
|
1406
|
+
export declare const ORGANIZATION_OPENROUTER_MODEL_ID_PREFIX: "organization-openrouter/";
|
|
1388
1407
|
export declare const OPENROUTER_BASE_URL: "https://openrouter.ai/api/v1";
|
|
1389
1408
|
export declare const ModelCostClass: z.ZodEnum<{
|
|
1390
1409
|
credits: "credits";
|
|
@@ -1394,6 +1413,7 @@ export type ModelCostClass = z.infer<typeof ModelCostClass>;
|
|
|
1394
1413
|
export declare const ConfiguredModelCostClass: z.ZodEnum<{
|
|
1395
1414
|
credits: "credits";
|
|
1396
1415
|
free: "free";
|
|
1416
|
+
organization: "organization";
|
|
1397
1417
|
subscription: "subscription";
|
|
1398
1418
|
workspace: "workspace";
|
|
1399
1419
|
}>;
|
|
@@ -1417,12 +1437,14 @@ export declare const GatewayCatalogModel: z.ZodObject<{
|
|
|
1417
1437
|
pricing: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1418
1438
|
inputMicrosPerMillionTokens: z.ZodNumber;
|
|
1419
1439
|
cachedInputMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1440
|
+
cacheWriteMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1420
1441
|
outputMicrosPerMillionTokens: z.ZodNumber;
|
|
1421
1442
|
marginBps: z.ZodOptional<z.ZodNumber>;
|
|
1422
1443
|
}, z.core.$strip>, z.ZodObject<{
|
|
1423
1444
|
default: z.ZodObject<{
|
|
1424
1445
|
inputMicrosPerMillionTokens: z.ZodNumber;
|
|
1425
1446
|
cachedInputMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1447
|
+
cacheWriteMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1426
1448
|
outputMicrosPerMillionTokens: z.ZodNumber;
|
|
1427
1449
|
marginBps: z.ZodOptional<z.ZodNumber>;
|
|
1428
1450
|
}, z.core.$strip>;
|
|
@@ -1431,6 +1453,7 @@ export declare const GatewayCatalogModel: z.ZodObject<{
|
|
|
1431
1453
|
pricing: z.ZodObject<{
|
|
1432
1454
|
inputMicrosPerMillionTokens: z.ZodNumber;
|
|
1433
1455
|
cachedInputMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1456
|
+
cacheWriteMicrosPerMillionTokens: z.ZodOptional<z.ZodNumber>;
|
|
1434
1457
|
outputMicrosPerMillionTokens: z.ZodNumber;
|
|
1435
1458
|
marginBps: z.ZodOptional<z.ZodNumber>;
|
|
1436
1459
|
}, z.core.$strip>;
|
|
@@ -2101,19 +2124,22 @@ export declare const OPENGENI_GATEWAY_MODELS: {
|
|
|
2101
2124
|
export declare const OPENGENI_OPENROUTER_MODELS: readonly OpenRouterCatalogModel[];
|
|
2102
2125
|
export declare function configuredGatewayUpstreamModelIds(settings: Settings): string[];
|
|
2103
2126
|
export declare function configuredGatewayWorkspaceProductModelIds(settings: Settings): string[];
|
|
2127
|
+
export declare function configuredGatewayOrganizationProductModelIds(settings: Settings): string[];
|
|
2104
2128
|
export declare function configuredModelInputIdentities(settings: Settings): string[];
|
|
2105
2129
|
export declare function configuredOpenRouterUpstreamModelIds(settings: Settings): string[];
|
|
2106
2130
|
export declare function configuredOpenRouterWorkspaceProductModelIds(settings: Settings): string[];
|
|
2131
|
+
export declare function configuredOpenRouterOrganizationProductModelIds(settings: Settings): string[];
|
|
2107
2132
|
/**
|
|
2108
2133
|
* Built-in OpenGeni credit pricing schedules.
|
|
2109
2134
|
*
|
|
2110
2135
|
* Rates are provider list prices in USD micros per 1M tokens. Debit applies
|
|
2111
|
-
* `marginBps` (
|
|
2136
|
+
* `marginBps` (500 = +5%) on top. Long-context tiers follow OpenAI's
|
|
2112
2137
|
* ">272K input tokens" rule (threshold exclusive of 272_000).
|
|
2113
2138
|
*
|
|
2114
2139
|
* GPT-5.4 and older families are intentionally omitted — they are no longer
|
|
2115
|
-
* offered. Codex / connected-subscription turns use `metering: external
|
|
2116
|
-
* never
|
|
2140
|
+
* offered. Codex / connected-subscription turns use `metering: external`, so
|
|
2141
|
+
* this map never debits them, but it does provide their equivalent OpenGeni
|
|
2142
|
+
* credit price when a matching product model is configured.
|
|
2117
2143
|
*
|
|
2118
2144
|
* When adding or changing a billed model, run `bun run check:model-pricing`
|
|
2119
2145
|
* (see docs/model-providers.md § Price audit). That compares this map to
|
|
@@ -2175,7 +2201,10 @@ export declare function effectiveSandboxLifecycle(settings: Settings, backend?:
|
|
|
2175
2201
|
* consumers at one hour.
|
|
2176
2202
|
*/
|
|
2177
2203
|
export declare function sandboxArchiveCaptureTimeoutMs(settings: Pick<Settings, "sandboxSnapshotTimeoutMs">): number;
|
|
2178
|
-
|
|
2204
|
+
/** Provider operation budget used only by zero-holder drain/rotation capture.
|
|
2205
|
+
* Unset preserves the historical shared snapshot budget exactly. */
|
|
2206
|
+
export declare function effectiveSandboxDrainSnapshotTimeoutMs(settings: Pick<Settings, "sandboxSnapshotTimeoutMs" | "sandboxDrainSnapshotTimeoutMs">): number;
|
|
2207
|
+
export declare function sandboxLifecycleTransitionWaitMs(settings: Pick<Settings, "sandboxSnapshotTimeoutMs" | "sandboxDrainSnapshotTimeoutMs" | "sandboxLeaseReaperPeriodMs">): number;
|
|
2179
2208
|
export declare function collectSandboxEnvironment(settings: Settings, source?: NodeJS.ProcessEnv): Record<string, string>;
|
|
2180
2209
|
/**
|
|
2181
2210
|
* Resolved API key for a registry provider: the inline `apiKey` when present,
|
|
@@ -2206,6 +2235,24 @@ export declare function withWorkspaceOpenRouterCredential(settings: Settings, ap
|
|
|
2206
2235
|
upstreamModelId: string;
|
|
2207
2236
|
label?: string | null;
|
|
2208
2237
|
}[]): Settings;
|
|
2238
|
+
/** Secret-free organization Vercel AI Gateway catalog overlay. */
|
|
2239
|
+
export declare function withOrganizationGatewayCatalogProvider(settings: Settings, customModels?: readonly {
|
|
2240
|
+
upstreamModelId: string;
|
|
2241
|
+
label?: string | null;
|
|
2242
|
+
}[]): Settings;
|
|
2243
|
+
export declare function withOrganizationGatewayCredential(settings: Settings, apiKey: string, customModels?: readonly {
|
|
2244
|
+
upstreamModelId: string;
|
|
2245
|
+
label?: string | null;
|
|
2246
|
+
}[]): Settings;
|
|
2247
|
+
/** Secret-free organization OpenRouter catalog overlay. */
|
|
2248
|
+
export declare function withOrganizationOpenRouterCatalogProvider(settings: Settings, customModels?: readonly {
|
|
2249
|
+
upstreamModelId: string;
|
|
2250
|
+
label?: string | null;
|
|
2251
|
+
}[]): Settings;
|
|
2252
|
+
export declare function withOrganizationOpenRouterCredential(settings: Settings, apiKey: string, customModels?: readonly {
|
|
2253
|
+
upstreamModelId: string;
|
|
2254
|
+
label?: string | null;
|
|
2255
|
+
}[]): Settings;
|
|
2209
2256
|
/**
|
|
2210
2257
|
* Product display label for catalog/picker UI.
|
|
2211
2258
|
* Same string for OpenAI and Codex copies of a slug (`gpt-5.6-luna` and
|
|
@@ -2342,10 +2389,9 @@ export declare function assertTurnExecutionPolicyMatchesConfigV1(settings: Setti
|
|
|
2342
2389
|
};
|
|
2343
2390
|
/**
|
|
2344
2391
|
* Effective per-model pricing schedules. Merge order (later wins): built-in
|
|
2345
|
-
* flat defaults → registry model flat/scheduled pricing → explicit
|
|
2346
|
-
* OPENGENI_MODEL_PRICING_JSON.
|
|
2347
|
-
*
|
|
2348
|
-
* exact.
|
|
2392
|
+
* flat defaults → registry model flat/scheduled pricing → explicit
|
|
2393
|
+
* OPENGENI_MODEL_PRICING_JSON. Explicit entries may be legacy flat prices or a
|
|
2394
|
+
* complete schedule, and always replace the lower-precedence schedule.
|
|
2349
2395
|
*/
|
|
2350
2396
|
export declare function configuredModelPricingSchedules(settings: Settings): Record<string, ModelPricingScheduleV1>;
|
|
2351
2397
|
/** Legacy flat projection: returns the default/below-threshold price. */
|
|
@@ -2515,7 +2561,7 @@ export declare function sandboxEnvironmentVariableNames(settings: Settings): str
|
|
|
2515
2561
|
export declare function sandboxLifecycleHookIds(settings: Settings): string[];
|
|
2516
2562
|
export declare function parseExposedPorts(raw: string): number[];
|
|
2517
2563
|
export declare function parseMcpServers(raw: string | undefined): unknown[] | undefined;
|
|
2518
|
-
export declare function parseModelPricingJson(raw: string): Record<string, ModelPricing>;
|
|
2564
|
+
export declare function parseModelPricingJson(raw: string): Record<string, ModelPricing | ModelPricingScheduleV1>;
|
|
2519
2565
|
export declare function parseSandboxWarmRateJson(raw: string): Record<string, number>;
|
|
2520
2566
|
export declare function sandboxWarmRateMicrosPerSecond(settings: Settings, backend: string): number;
|
|
2521
2567
|
/**
|