@opengeni/config 0.11.0 → 0.13.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/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
- import { Entitlements, LatencyMode, ReasoningEffort, SandboxBackend, StaticUsageLimits, TurnExecutionPolicyV1, type TurnExecutionLatencyModeSourceV1, type TurnExecutionModelSourceV1, type TurnExecutionReasoningSourceV1 } from "@opengeni/contracts";
1
+ import { Entitlements, LatencyMode, ReasoningEffort, SandboxBackend, StaticUsageLimits, TurnExecutionPolicyV1, type TurnExecutionLatencyModeSourceV1, type TurnExecutionModelSourceV1, type TurnExecutionReasoningSourceV1, type VideoGenerationResolution } from "@opengeni/contracts";
2
2
  import { z } from "zod";
3
+ export declare const SANDBOX_ARCHIVE_CAPTURE_MAX_TIMEOUT_MS: number;
4
+ export declare const SANDBOX_ARCHIVE_CAPTURE_SETTLEMENT_GRACE_MS = 10000;
5
+ export declare const SANDBOX_SNAPSHOT_MAX_TIMEOUT_MS: number;
6
+ export declare const SANDBOX_LIFECYCLE_TRANSITION_MAX_WAIT_MS: number;
7
+ export declare const SANDBOX_LIFECYCLE_RETRY_HANDOFF_GRACE_MS = 10000;
3
8
  export declare const sandboxPreparationProfiles: Record<string, {
4
9
  env: string[];
5
10
  hooks: string[];
@@ -84,6 +89,9 @@ declare const SettingsSchema: z.ZodObject<{
84
89
  turnWorkerMaxConcurrentTurns: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
85
90
  turnWorkerTargetCpuUsage: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
86
91
  turnWorkerTargetMemoryUsage: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
92
+ turnWorkerEmergencyMemoryUsage: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
93
+ turnWorkerMemoryGuardIntervalMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
94
+ turnWorkerMemoryGuardSustainMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
87
95
  observabilityStructuredLogs: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
88
96
  observabilityMetricsEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
89
97
  observabilityOtlpEndpoint: z.ZodOptional<z.ZodString>;
@@ -98,6 +106,7 @@ declare const SettingsSchema: z.ZodObject<{
98
106
  webBaseUrl: z.ZodOptional<z.ZodString>;
99
107
  agentReleasesBaseUrl: z.ZodDefault<z.ZodString>;
100
108
  agentStableVersion: z.ZodDefault<z.ZodString>;
109
+ agentBetaVersion: z.ZodOptional<z.ZodString>;
101
110
  productAccessMode: z.ZodDefault<z.ZodEnum<{
102
111
  configured: "configured";
103
112
  local: "local";
@@ -122,19 +131,22 @@ declare const SettingsSchema: z.ZodObject<{
122
131
  delegationSecret: z.ZodOptional<z.ZodString>;
123
132
  streamTokenSecret: z.ZodOptional<z.ZodString>;
124
133
  streamControlEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
125
- toolspaceEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
126
- toolspaceMaxCallsPerTurn: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
134
+ codemodeMaxCallsPerTurn: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
127
135
  ogtoolPackageSpec: z.ZodOptional<z.ZodString>;
128
136
  environmentsEncryptionKey: z.ZodOptional<z.ZodString>;
129
137
  integrationsEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
130
138
  integrationsStateSecret: z.ZodOptional<z.ZodString>;
131
139
  integrationsAllowPrivateNetworkTargets: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
132
140
  integrationsOauthClientsJson: z.ZodDefault<z.ZodString>;
141
+ gmailRestAdapterEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
133
142
  slackClientId: z.ZodOptional<z.ZodString>;
134
143
  slackClientSecret: z.ZodOptional<z.ZodString>;
135
144
  slackSigningSecret: z.ZodOptional<z.ZodString>;
136
145
  googleDriveClientId: z.ZodOptional<z.ZodString>;
137
146
  googleDriveClientSecret: z.ZodOptional<z.ZodString>;
147
+ googleDriveWorkspaceEventsEnabled: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
148
+ atlassianClientId: z.ZodOptional<z.ZodString>;
149
+ atlassianClientSecret: z.ZodOptional<z.ZodString>;
138
150
  maxNestedAgentDepth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
139
151
  socialOauthClientsJson: z.ZodDefault<z.ZodString>;
140
152
  goalMaxAutoContinuations: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
@@ -164,6 +176,16 @@ declare const SettingsSchema: z.ZodObject<{
164
176
  openaiModel: z.ZodDefault<z.ZodString>;
165
177
  openaiAllowedModels: z.ZodDefault<z.ZodString>;
166
178
  vercelAiGatewayApiKey: z.ZodOptional<z.ZodString>;
179
+ imageGenerationModel: z.ZodDefault<z.ZodString>;
180
+ videoGenerationPollIntervalMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
181
+ videoGenerationRecoveryDeadlineMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
182
+ videoGenerationReferenceUrlTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
183
+ videoGenerationMaxConcurrentPerWorkspace: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
184
+ videoGenerationWorkspaceQuotaBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
185
+ videoGenerationTempDirectory: z.ZodDefault<z.ZodString>;
186
+ videoGenerationFfprobePath: z.ZodDefault<z.ZodString>;
187
+ videoGenerationCredit480pMicrosPerSecond: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
188
+ videoGenerationCredit720pMicrosPerSecond: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
167
189
  voiceInputMaxDurationSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
168
190
  voiceInputMaxSizeBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
169
191
  voiceInputResumableEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
@@ -190,6 +212,7 @@ declare const SettingsSchema: z.ZodObject<{
190
212
  codexConnectedAppsEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
191
213
  codexProductSku: z.ZodOptional<z.ZodString>;
192
214
  codexToolSearchEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
215
+ lazyToolSearchEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
193
216
  codexCredentialLeasingEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
194
217
  codexFleetPolicyShadowEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
195
218
  codexRotationNearExhaustionPct: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -236,6 +259,7 @@ declare const SettingsSchema: z.ZodObject<{
236
259
  vercel: "vercel";
237
260
  }>>;
238
261
  dockerImage: z.ZodDefault<z.ZodString>;
262
+ sandboxArtifactRuntimeEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
239
263
  dockerExposedPorts: z.ZodDefault<z.ZodString>;
240
264
  dockerNetwork: z.ZodOptional<z.ZodString>;
241
265
  dockerWorkspaceBaseDir: z.ZodOptional<z.ZodString>;
@@ -329,6 +353,7 @@ declare const SettingsSchema: z.ZodObject<{
329
353
  sandboxSelfhostedControlTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
330
354
  sandboxLeaseReaperPeriodMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
331
355
  sandboxViewerHolderTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
356
+ sandboxInteractionHolderTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
332
357
  sandboxIdleGraceMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
333
358
  sandboxSnapshotIntervalMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
334
359
  sandboxSnapshotTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -507,6 +532,12 @@ export type ModelUsageInput = {
507
532
  inputTokensDetails?: Record<string, number> | Array<Record<string, number>> | undefined;
508
533
  requestUsageEntries?: ModelUsageInput[] | undefined;
509
534
  };
535
+ export type ModelUsageCostBreakdown = {
536
+ /** Provider-rate cost basis for the exact usage, before OpenGeni margin. */
537
+ providerCostMicros: number;
538
+ /** OpenGeni credit price after configured margin and latency-mode multiplier. */
539
+ creditCostMicros: number;
540
+ };
510
541
  export type StaticUsageLimitsConfig = StaticUsageLimits;
511
542
  export type EntitlementsConfig = Entitlements;
512
543
  export declare const CapabilitySupportV1: z.ZodEnum<{
@@ -593,6 +624,14 @@ export declare const ModelCapabilitiesV1Schema: z.ZodObject<{
593
624
  }>;
594
625
  runnable: z.ZodBoolean;
595
626
  }, z.core.$strip>;
627
+ imageGeneration: z.ZodDefault<z.ZodObject<{
628
+ upstream: z.ZodEnum<{
629
+ supported: "supported";
630
+ unknown: "unknown";
631
+ unsupported: "unsupported";
632
+ }>;
633
+ runnable: z.ZodBoolean;
634
+ }, z.core.$strip>>;
596
635
  }, z.core.$strip>;
597
636
  inputModalities: z.ZodArray<z.ZodEnum<{
598
637
  audio: "audio";
@@ -812,6 +851,14 @@ declare const RegistryProviderSchema: z.ZodObject<{
812
851
  }>;
813
852
  runnable: z.ZodBoolean;
814
853
  }, z.core.$strip>;
854
+ imageGeneration: z.ZodDefault<z.ZodObject<{
855
+ upstream: z.ZodEnum<{
856
+ supported: "supported";
857
+ unknown: "unknown";
858
+ unsupported: "unsupported";
859
+ }>;
860
+ runnable: z.ZodBoolean;
861
+ }, z.core.$strip>>;
815
862
  }, z.core.$strip>;
816
863
  inputModalities: z.ZodArray<z.ZodEnum<{
817
864
  audio: "audio";
@@ -1080,6 +1127,7 @@ export declare function effectiveModalIdleTimeoutSeconds(settings: Settings): nu
1080
1127
  * consumers at one hour.
1081
1128
  */
1082
1129
  export declare function sandboxArchiveCaptureTimeoutMs(settings: Pick<Settings, "sandboxSnapshotTimeoutMs">): number;
1130
+ export declare function sandboxLifecycleTransitionWaitMs(settings: Pick<Settings, "sandboxSnapshotTimeoutMs" | "sandboxLeaseReaperPeriodMs">): number;
1083
1131
  export declare function collectSandboxEnvironment(settings: Settings, source?: NodeJS.ProcessEnv): Record<string, string>;
1084
1132
  /**
1085
1133
  * Resolved API key for a registry provider: the inline `apiKey` when present,
@@ -1105,6 +1153,8 @@ export declare function productLabelForModelId(modelId: string): string;
1105
1153
  * everything else returns null so callers fall back to the full `label`.
1106
1154
  */
1107
1155
  export declare function productShortLabelForModelId(modelId: string): string | null;
1156
+ /** Undefined and the exact public OpenAI v1 endpoint are the same direct route. */
1157
+ export declare function isDirectOpenAiApiBaseUrl(baseUrl: string | undefined): boolean;
1108
1158
  /**
1109
1159
  * Map OpenGeni latency mode to the provider `service_tier` wire value.
1110
1160
  * Azure and Codex ChatGPT accept `priority`; OpenAI API accepts `fast` (alias of priority).
@@ -1240,6 +1290,9 @@ export declare function configuredEntitlements(settings: Settings): Entitlements
1240
1290
  export declare function calculateModelUsageCostMicros(settings: Settings, model: string, usage: ModelUsageInput, options?: {
1241
1291
  latencyMode?: LatencyMode;
1242
1292
  }): number;
1293
+ export declare function calculateModelUsageCostBreakdown(settings: Settings, model: string, usage: ModelUsageInput, options?: {
1294
+ latencyMode?: LatencyMode;
1295
+ }): ModelUsageCostBreakdown;
1243
1296
  /**
1244
1297
  * Convert AI Gateway's exact USD inference cost to OpenGeni credit micros and
1245
1298
  * apply the configured model margin. Decimal arithmetic is integer-only so a
@@ -1248,6 +1301,19 @@ export declare function calculateModelUsageCostMicros(settings: Settings, model:
1248
1301
  export declare function calculateGatewayReportedCostMicros(settings: Settings, model: string, inferenceCostUsd: string, options?: {
1249
1302
  inputTokens?: number;
1250
1303
  }): number;
1304
+ export declare function calculateGatewayReportedCostBreakdown(settings: Settings, model: string, inferenceCostUsd: string, options?: {
1305
+ inputTokens?: number;
1306
+ }): ModelUsageCostBreakdown;
1307
+ /**
1308
+ * Exact OpenGeni product price frozen before a managed video request starts.
1309
+ * Gateway reporting is delayed for asynchronous video, so this deliberately
1310
+ * does not masquerade as provider-reported cost.
1311
+ */
1312
+ export declare function calculateVideoGenerationCreditCostMicros(settings: Settings, input: {
1313
+ modelId: string;
1314
+ resolution: VideoGenerationResolution;
1315
+ durationSeconds: number;
1316
+ }): number;
1251
1317
  export declare function configuredAllowedReasoningEfforts(settings: Settings): Array<z.infer<typeof ReasoningEffort>>;
1252
1318
  /**
1253
1319
  * Decodes OPENGENI_ENVIRONMENTS_ENCRYPTION_KEY (base64, exactly 32 bytes) for
@@ -1411,6 +1477,7 @@ export declare function parseStaticEntitlementsJson(raw: string): EntitlementsCo
1411
1477
  */
1412
1478
  export declare function firstPartyMcpBaseUrl(settings: Settings): string;
1413
1479
  export declare function firstPartyMcpWorkspaceUrl(settings: Settings, workspaceId: string): string;
1480
+ export declare function codemodeWorkspaceUrl(settings: Settings, workspaceId: string): string;
1414
1481
  /**
1415
1482
  * Resolve the secret used to sign/verify scoped stream tokens (sandbox contract
1416
1483
  * §C.3). Falls back to `delegationSecret` (the same HMAC envelope family —