@opengeni/config 0.7.11 → 0.7.22

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,7 +1,6 @@
1
- import { Entitlements, TurnExecutionModelSourceV1, TurnExecutionReasoningSourceV1, SandboxBackend, StaticUsageLimits, TurnExecutionPolicyV1, ReasoningEffort } from '@opengeni/contracts';
2
- import { z } from 'zod';
3
-
4
- declare const sandboxPreparationProfiles: Record<string, {
1
+ import { Entitlements, LatencyMode, ReasoningEffort, SandboxBackend, StaticUsageLimits, TurnExecutionPolicyV1, type TurnExecutionLatencyModeSourceV1, type TurnExecutionModelSourceV1, type TurnExecutionReasoningSourceV1 } from "@opengeni/contracts";
2
+ import { z } from "zod";
3
+ export declare const sandboxPreparationProfiles: Record<string, {
5
4
  env: string[];
6
5
  hooks: string[];
7
6
  }>;
@@ -13,7 +12,7 @@ declare const sandboxPreparationProfiles: Record<string, {
13
12
  * so a white-labelled persona can never drop the goal-loop contract or the
14
13
  * environment metadata the agent depends on.
15
14
  */
16
- declare const AGENT_INSTRUCTIONS_CORE_PLACEHOLDER = "{{core}}";
15
+ export declare const AGENT_INSTRUCTIONS_CORE_PLACEHOLDER = "{{core}}";
17
16
  /**
18
17
  * Default per-workspace agent persona template. This is the BRAND + tool-usage
19
18
  * opinion (the white-labellable surface): the "You are an OpenGeni workspace
@@ -30,16 +29,16 @@ declare const AGENT_INSTRUCTIONS_CORE_PLACEHOLDER = "{{core}}";
30
29
  * Changing a single character here changes that default; update the pin
31
30
  * intentionally.
32
31
  */
33
- declare const DEFAULT_AGENT_INSTRUCTIONS: string;
34
- declare const McpServerConnectionRefSchema: z.ZodObject<{
32
+ export declare const DEFAULT_AGENT_INSTRUCTIONS: string;
33
+ export declare const McpServerConnectionRefSchema: z.ZodObject<{
35
34
  connectionId: z.ZodOptional<z.ZodString>;
36
35
  provider: z.ZodOptional<z.ZodString>;
37
36
  providerDomain: z.ZodString;
38
37
  kind: z.ZodOptional<z.ZodEnum<{
39
- oauth2: "oauth2";
40
38
  api_key: "api_key";
41
39
  app_install: "app_install";
42
40
  delegated: "delegated";
41
+ oauth2: "oauth2";
43
42
  }>>;
44
43
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
44
  resource: z.ZodOptional<z.ZodString>;
@@ -48,11 +47,11 @@ declare const McpServerConnectionRefSchema: z.ZodObject<{
48
47
  kind: z.ZodLiteral<"repository">;
49
48
  }, z.core.$strict>>>;
50
49
  subjectScope: z.ZodOptional<z.ZodEnum<{
51
- workspace: "workspace";
52
50
  subject: "subject";
51
+ workspace: "workspace";
53
52
  }>>;
54
53
  }, z.core.$strict>;
55
- type McpServerConnectionRef = z.infer<typeof McpServerConnectionRefSchema>;
54
+ export type McpServerConnectionRef = z.infer<typeof McpServerConnectionRefSchema>;
56
55
  declare const SettingsSchema: z.ZodObject<{
57
56
  serviceName: z.ZodDefault<z.ZodString>;
58
57
  environment: z.ZodDefault<z.ZodString>;
@@ -90,11 +89,12 @@ declare const SettingsSchema: z.ZodObject<{
90
89
  observabilityOtlpEndpoint: z.ZodOptional<z.ZodString>;
91
90
  observabilityOtlpHeaders: z.ZodDefault<z.ZodString>;
92
91
  publicBaseUrl: z.ZodOptional<z.ZodString>;
92
+ webBaseUrl: z.ZodOptional<z.ZodString>;
93
93
  agentReleasesBaseUrl: z.ZodDefault<z.ZodString>;
94
94
  agentStableVersion: z.ZodDefault<z.ZodString>;
95
95
  productAccessMode: z.ZodDefault<z.ZodEnum<{
96
- local: "local";
97
96
  configured: "configured";
97
+ local: "local";
98
98
  managed: "managed";
99
99
  }>>;
100
100
  billingMode: z.ZodDefault<z.ZodEnum<{
@@ -102,13 +102,13 @@ declare const SettingsSchema: z.ZodObject<{
102
102
  stripe: "stripe";
103
103
  }>>;
104
104
  entitlementsMode: z.ZodDefault<z.ZodEnum<{
105
- none: "none";
106
105
  managed: "managed";
106
+ none: "none";
107
107
  static: "static";
108
108
  }>>;
109
109
  usageLimitsMode: z.ZodDefault<z.ZodEnum<{
110
- none: "none";
111
110
  managed: "managed";
111
+ none: "none";
112
112
  static: "static";
113
113
  }>>;
114
114
  staticEntitlementsJson: z.ZodDefault<z.ZodString>;
@@ -116,7 +116,6 @@ declare const SettingsSchema: z.ZodObject<{
116
116
  delegationSecret: z.ZodOptional<z.ZodString>;
117
117
  streamTokenSecret: z.ZodOptional<z.ZodString>;
118
118
  streamControlEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
119
- sessionTurnToolReplacementEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
120
119
  toolspaceEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
121
120
  toolspaceMaxCallsPerTurn: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
122
121
  ogtoolPackageSpec: z.ZodOptional<z.ZodString>;
@@ -127,6 +126,8 @@ declare const SettingsSchema: z.ZodObject<{
127
126
  integrationsOauthClientsJson: z.ZodDefault<z.ZodString>;
128
127
  slackClientId: z.ZodOptional<z.ZodString>;
129
128
  slackClientSecret: z.ZodOptional<z.ZodString>;
129
+ googleDriveClientId: z.ZodOptional<z.ZodString>;
130
+ googleDriveClientSecret: z.ZodOptional<z.ZodString>;
130
131
  maxNestedAgentDepth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
131
132
  goalMaxAutoContinuations: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
132
133
  goalNoProgressLimit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -154,6 +155,20 @@ declare const SettingsSchema: z.ZodObject<{
154
155
  openaiBaseUrl: z.ZodOptional<z.ZodString>;
155
156
  openaiModel: z.ZodDefault<z.ZodString>;
156
157
  openaiAllowedModels: z.ZodDefault<z.ZodString>;
158
+ voiceInputMaxDurationSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
159
+ voiceInputMaxSizeBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
160
+ voiceInputProviderOrder: z.ZodDefault<z.ZodString>;
161
+ voiceInputOpenaiEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
162
+ voiceInputOpenaiApiKey: z.ZodOptional<z.ZodString>;
163
+ voiceInputOpenaiBaseUrl: z.ZodOptional<z.ZodString>;
164
+ voiceInputOpenaiModel: z.ZodDefault<z.ZodString>;
165
+ voiceInputAzureEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
166
+ voiceInputAzureEndpoint: z.ZodOptional<z.ZodString>;
167
+ voiceInputAzureDeployment: z.ZodOptional<z.ZodString>;
168
+ voiceInputAzureApiVersion: z.ZodOptional<z.ZodString>;
169
+ voiceInputAzureApiKey: z.ZodOptional<z.ZodString>;
170
+ voiceInputAzureAdToken: z.ZodOptional<z.ZodString>;
171
+ voiceInputCodexExperimentalEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
157
172
  modelPricingJson: z.ZodDefault<z.ZodString>;
158
173
  modelProvidersJson: z.ZodDefault<z.ZodString>;
159
174
  codexSubscriptionEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
@@ -164,11 +179,11 @@ declare const SettingsSchema: z.ZodObject<{
164
179
  codexFleetPolicyShadowEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
165
180
  codexRotationNearExhaustionPct: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
166
181
  openaiReasoningEffort: z.ZodDefault<z.ZodEnum<{
167
- none: "none";
168
- minimal: "minimal";
182
+ high: "high";
169
183
  low: "low";
170
184
  medium: "medium";
171
- high: "high";
185
+ minimal: "minimal";
186
+ none: "none";
172
187
  xhigh: "xhigh";
173
188
  }>>;
174
189
  openaiAllowedReasoningEfforts: z.ZodDefault<z.ZodString>;
@@ -177,8 +192,8 @@ declare const SettingsSchema: z.ZodObject<{
177
192
  websocket: "websocket";
178
193
  }>>;
179
194
  openaiProviderItemIds: z.ZodDefault<z.ZodEnum<{
180
- strip: "strip";
181
195
  preserve: "preserve";
196
+ strip: "strip";
182
197
  }>>;
183
198
  openaiReasoningEncryptedContent: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
184
199
  openaiMaxRetries: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -192,21 +207,22 @@ declare const SettingsSchema: z.ZodObject<{
192
207
  azureOpenaiAdToken: z.ZodOptional<z.ZodString>;
193
208
  disableOpenaiTracing: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
194
209
  sandboxBackend: z.ZodDefault<z.ZodEnum<{
195
- none: "none";
196
- local: "local";
210
+ blaxel: "blaxel";
211
+ cloudflare: "cloudflare";
212
+ daytona: "daytona";
197
213
  docker: "docker";
214
+ e2b: "e2b";
215
+ local: "local";
198
216
  modal: "modal";
199
- daytona: "daytona";
217
+ none: "none";
200
218
  runloop: "runloop";
201
- e2b: "e2b";
202
- blaxel: "blaxel";
203
- cloudflare: "cloudflare";
204
- vercel: "vercel";
205
219
  selfhosted: "selfhosted";
220
+ vercel: "vercel";
206
221
  }>>;
207
222
  dockerImage: z.ZodDefault<z.ZodString>;
208
223
  dockerExposedPorts: z.ZodDefault<z.ZodString>;
209
224
  dockerNetwork: z.ZodOptional<z.ZodString>;
225
+ dockerWorkspaceBaseDir: z.ZodOptional<z.ZodString>;
210
226
  modalAppName: z.ZodDefault<z.ZodString>;
211
227
  modalImageRef: z.ZodOptional<z.ZodString>;
212
228
  modalImageRegistrySecret: z.ZodOptional<z.ZodString>;
@@ -216,11 +232,10 @@ declare const SettingsSchema: z.ZodObject<{
216
232
  modalEnvironment: z.ZodOptional<z.ZodString>;
217
233
  modalIdleTimeoutSeconds: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
218
234
  modalWorkspacePersistence: z.ZodDefault<z.ZodEnum<{
219
- tar: "tar";
220
- snapshot_filesystem: "snapshot_filesystem";
221
235
  snapshot_directory: "snapshot_directory";
236
+ snapshot_filesystem: "snapshot_filesystem";
237
+ tar: "tar";
222
238
  }>>;
223
- modalSnapshotRetentionSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
224
239
  sandboxDesktopEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
225
240
  sandboxDesktopInteractive: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
226
241
  sandboxTerminalEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
@@ -255,14 +270,14 @@ declare const SettingsSchema: z.ZodObject<{
255
270
  e2bTemplate: z.ZodOptional<z.ZodString>;
256
271
  e2bTimeoutSeconds: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
257
272
  e2bTimeoutAction: z.ZodOptional<z.ZodEnum<{
258
- pause: "pause";
259
273
  kill: "kill";
274
+ pause: "pause";
260
275
  }>>;
261
276
  e2bAllowInternetAccess: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
262
277
  e2bAutoResume: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>;
263
278
  e2bWorkspacePersistence: z.ZodOptional<z.ZodEnum<{
264
- tar: "tar";
265
279
  snapshot: "snapshot";
280
+ tar: "tar";
266
281
  }>>;
267
282
  blaxelApiKey: z.ZodOptional<z.ZodString>;
268
283
  blaxelImage: z.ZodOptional<z.ZodString>;
@@ -300,6 +315,8 @@ declare const SettingsSchema: z.ZodObject<{
300
315
  sandboxIdleGraceMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
301
316
  sandboxSnapshotIntervalMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
302
317
  sandboxSnapshotTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
318
+ sandboxRotationLeadMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
319
+ sandboxRotationBatchSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
303
320
  sandboxLeaseTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
304
321
  sandboxLeaseWarmingTtlMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
305
322
  sandboxWarmingTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -309,12 +326,13 @@ declare const SettingsSchema: z.ZodObject<{
309
326
  sandboxPreparationProfiles: z.ZodDefault<z.ZodString>;
310
327
  sandboxEnvAllowlist: z.ZodDefault<z.ZodString>;
311
328
  objectStorageEndpoint: z.ZodOptional<z.ZodString>;
329
+ objectStorageInternalEndpoint: z.ZodOptional<z.ZodString>;
312
330
  objectStorageSandboxEndpoint: z.ZodOptional<z.ZodString>;
313
331
  objectStorageBackend: z.ZodDefault<z.ZodEnum<{
314
- "s3-compatible": "s3-compatible";
315
332
  "aws-s3": "aws-s3";
316
333
  "azure-blob": "azure-blob";
317
334
  gcs: "gcs";
335
+ "s3-compatible": "s3-compatible";
318
336
  }>>;
319
337
  objectStorageBucket: z.ZodDefault<z.ZodString>;
320
338
  objectStorageRegion: z.ZodDefault<z.ZodString>;
@@ -334,17 +352,17 @@ declare const SettingsSchema: z.ZodObject<{
334
352
  documentChunkSize: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
335
353
  documentChunkOverlap: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
336
354
  documentEmbeddingProvider: z.ZodDefault<z.ZodEnum<{
337
- openai: "openai";
338
355
  deterministic: "deterministic";
356
+ openai: "openai";
339
357
  }>>;
340
358
  documentEmbeddingModel: z.ZodDefault<z.ZodString>;
341
359
  documentEmbeddingDimensions: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
342
360
  documentEmbeddingApiKey: z.ZodOptional<z.ZodString>;
343
361
  documentEmbeddingBaseUrl: z.ZodOptional<z.ZodString>;
344
362
  documentCurationProvider: z.ZodDefault<z.ZodEnum<{
363
+ heuristic: "heuristic";
345
364
  none: "none";
346
365
  openai: "openai";
347
- heuristic: "heuristic";
348
366
  }>>;
349
367
  documentCurationModel: z.ZodDefault<z.ZodString>;
350
368
  documentCurationApiKey: z.ZodOptional<z.ZodString>;
@@ -385,10 +403,10 @@ declare const SettingsSchema: z.ZodObject<{
385
403
  provider: z.ZodOptional<z.ZodString>;
386
404
  providerDomain: z.ZodString;
387
405
  kind: z.ZodOptional<z.ZodEnum<{
388
- oauth2: "oauth2";
389
406
  api_key: "api_key";
390
407
  app_install: "app_install";
391
408
  delegated: "delegated";
409
+ oauth2: "oauth2";
392
410
  }>>;
393
411
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
394
412
  resource: z.ZodOptional<z.ZodString>;
@@ -397,15 +415,49 @@ declare const SettingsSchema: z.ZodObject<{
397
415
  kind: z.ZodLiteral<"repository">;
398
416
  }, z.core.$strict>>>;
399
417
  subjectScope: z.ZodOptional<z.ZodEnum<{
400
- workspace: "workspace";
401
418
  subject: "subject";
419
+ workspace: "workspace";
402
420
  }>>;
403
421
  }, z.core.$strict>>;
404
422
  }, z.core.$strip>>>;
405
423
  }, z.core.$strip>;
406
- type Settings = z.infer<typeof SettingsSchema>;
407
- type McpServerConfig = Settings["mcpServers"][number];
408
- type TemporalTlsConnectionConfig = {
424
+ export type Settings = z.infer<typeof SettingsSchema>;
425
+ export type McpServerConfig = Settings["mcpServers"][number];
426
+ /** Declarative voice-input transcription provider ids. */
427
+ export type VoiceInputProviderId = "openai" | "azure-openai" | "codex-subscription";
428
+ export type VoiceInputProviderConfig = {
429
+ id: "openai";
430
+ kind: "openai";
431
+ apiKey: string;
432
+ baseUrl: string;
433
+ model: string;
434
+ } | {
435
+ id: "azure-openai";
436
+ kind: "azure-openai";
437
+ endpoint: string;
438
+ deployment: string;
439
+ apiVersion: string;
440
+ apiKey: string | null;
441
+ adToken: string | null;
442
+ } | {
443
+ id: "codex-subscription";
444
+ kind: "codex-subscription";
445
+ experimental: true;
446
+ };
447
+ /**
448
+ * Reject empty / template secrets so `.env.example` placeholders like
449
+ * `your-key` cannot advertise voice input as available and then 401 upstream.
450
+ */
451
+ export declare function isUsableVoiceInputSecret(value: string | null | undefined): value is string;
452
+ /**
453
+ * Resolve the configured voice-input provider registry in selection order.
454
+ * Credentials stay in this server-side structure; ClientConfig only projects
455
+ * whether at least one non-experimental (or probed experimental) provider exists.
456
+ */
457
+ export declare function resolveVoiceInputProviderRegistry(settings: Settings): VoiceInputProviderConfig[];
458
+ /** True when the deployment has at least one supported (non-experimental) provider. */
459
+ export declare function voiceInputDeploymentConfigured(settings: Settings): boolean;
460
+ export type TemporalTlsConnectionConfig = {
409
461
  serverNameOverride?: string;
410
462
  serverRootCACertificate?: Uint8Array;
411
463
  clientCertPair?: {
@@ -413,86 +465,86 @@ type TemporalTlsConnectionConfig = {
413
465
  key: Uint8Array;
414
466
  };
415
467
  };
416
- type TemporalConnectionOptions = {
468
+ export type TemporalConnectionOptions = {
417
469
  address: string;
418
470
  tls?: true | TemporalTlsConnectionConfig;
419
471
  apiKey?: string;
420
472
  };
421
- type ModelPricing = {
473
+ export type ModelPricing = {
422
474
  inputMicrosPerMillionTokens: number;
423
475
  cachedInputMicrosPerMillionTokens?: number | undefined;
424
476
  outputMicrosPerMillionTokens: number;
425
477
  marginBps?: number | undefined;
426
478
  };
427
- type ModelPricingScheduleV1 = {
479
+ export type ModelPricingScheduleV1 = {
428
480
  default: ModelPricing;
429
481
  inputTokenTiers?: Array<{
430
482
  minimumInputTokens: number;
431
483
  pricing: ModelPricing;
432
484
  }> | undefined;
433
485
  };
434
- type ModelUsageInput = {
486
+ export type ModelUsageInput = {
435
487
  inputTokens?: number | undefined;
436
488
  outputTokens?: number | undefined;
437
489
  totalTokens?: number | undefined;
438
490
  inputTokensDetails?: Record<string, number> | Array<Record<string, number>> | undefined;
439
491
  requestUsageEntries?: ModelUsageInput[] | undefined;
440
492
  };
441
- type StaticUsageLimitsConfig = StaticUsageLimits;
442
- type EntitlementsConfig = Entitlements;
443
- declare const CapabilitySupportV1: z.ZodEnum<{
444
- unknown: "unknown";
493
+ export type StaticUsageLimitsConfig = StaticUsageLimits;
494
+ export type EntitlementsConfig = Entitlements;
495
+ export declare const CapabilitySupportV1: z.ZodEnum<{
445
496
  supported: "supported";
497
+ unknown: "unknown";
446
498
  unsupported: "unsupported";
447
499
  }>;
448
- type CapabilitySupportV1 = z.infer<typeof CapabilitySupportV1>;
449
- declare const CapabilityStateV1Schema: z.ZodObject<{
500
+ export type CapabilitySupportV1 = z.infer<typeof CapabilitySupportV1>;
501
+ export declare const CapabilityStateV1Schema: z.ZodObject<{
450
502
  upstream: z.ZodEnum<{
451
- unknown: "unknown";
452
503
  supported: "supported";
504
+ unknown: "unknown";
453
505
  unsupported: "unsupported";
454
506
  }>;
455
507
  runnable: z.ZodBoolean;
456
508
  }, z.core.$strip>;
457
- type CapabilityStateV1 = z.infer<typeof CapabilityStateV1Schema>;
458
- declare const ModelCapabilitiesV1Schema: z.ZodObject<{
509
+ export type CapabilityStateV1 = z.infer<typeof CapabilityStateV1Schema>;
510
+ export declare const ModelCapabilitiesV1Schema: z.ZodObject<{
459
511
  reasoning: z.ZodObject<{
460
512
  upstream: z.ZodEnum<{
461
- unknown: "unknown";
462
513
  supported: "supported";
514
+ unknown: "unknown";
463
515
  unsupported: "unsupported";
464
516
  }>;
465
517
  runnable: z.ZodBoolean;
466
518
  efforts: z.ZodArray<z.ZodEnum<{
467
- none: "none";
468
- minimal: "minimal";
519
+ high: "high";
469
520
  low: "low";
470
521
  medium: "medium";
471
- high: "high";
522
+ minimal: "minimal";
523
+ none: "none";
472
524
  xhigh: "xhigh";
473
525
  }>>;
474
526
  defaultEffort: z.ZodNullable<z.ZodEnum<{
475
- none: "none";
476
- minimal: "minimal";
527
+ high: "high";
477
528
  low: "low";
478
529
  medium: "medium";
479
- high: "high";
530
+ minimal: "minimal";
531
+ none: "none";
480
532
  xhigh: "xhigh";
481
533
  }>>;
482
534
  required: z.ZodBoolean;
483
535
  }, z.core.$strip>;
484
536
  functionCalling: z.ZodObject<{
485
537
  upstream: z.ZodEnum<{
486
- unknown: "unknown";
487
538
  supported: "supported";
539
+ unknown: "unknown";
488
540
  unsupported: "unsupported";
489
541
  }>;
490
542
  runnable: z.ZodBoolean;
491
543
  }, z.core.$strip>;
492
544
  structuredOutput: z.ZodObject<{
493
545
  upstream: z.ZodEnum<{
494
- unknown: "unknown";
495
546
  supported: "supported";
547
+ unknown: "unknown";
496
548
  unsupported: "unsupported";
497
549
  }>;
498
550
  runnable: z.ZodBoolean;
@@ -500,60 +552,60 @@ declare const ModelCapabilitiesV1Schema: z.ZodObject<{
500
552
  hostedTools: z.ZodObject<{
501
553
  webSearch: z.ZodObject<{
502
554
  upstream: z.ZodEnum<{
503
- unknown: "unknown";
504
555
  supported: "supported";
556
+ unknown: "unknown";
505
557
  unsupported: "unsupported";
506
558
  }>;
507
559
  runnable: z.ZodBoolean;
508
560
  }, z.core.$strip>;
509
561
  xSearch: z.ZodObject<{
510
562
  upstream: z.ZodEnum<{
511
- unknown: "unknown";
512
563
  supported: "supported";
564
+ unknown: "unknown";
513
565
  unsupported: "unsupported";
514
566
  }>;
515
567
  runnable: z.ZodBoolean;
516
568
  }, z.core.$strip>;
517
569
  codeExecution: z.ZodObject<{
518
570
  upstream: z.ZodEnum<{
519
- unknown: "unknown";
520
571
  supported: "supported";
572
+ unknown: "unknown";
521
573
  unsupported: "unsupported";
522
574
  }>;
523
575
  runnable: z.ZodBoolean;
524
576
  }, z.core.$strip>;
525
577
  }, z.core.$strip>;
526
578
  inputModalities: z.ZodArray<z.ZodEnum<{
527
- text: "text";
528
- image: "image";
529
579
  audio: "audio";
580
+ image: "image";
581
+ text: "text";
530
582
  }>>;
531
583
  outputModalities: z.ZodArray<z.ZodEnum<{
532
- text: "text";
533
- image: "image";
534
584
  audio: "audio";
585
+ image: "image";
586
+ text: "text";
535
587
  }>>;
536
588
  transports: z.ZodObject<{
537
589
  sse: z.ZodObject<{
538
590
  upstream: z.ZodEnum<{
539
- unknown: "unknown";
540
591
  supported: "supported";
592
+ unknown: "unknown";
541
593
  unsupported: "unsupported";
542
594
  }>;
543
595
  runnable: z.ZodBoolean;
544
596
  }, z.core.$strip>;
545
597
  responsesWebSocket: z.ZodObject<{
546
598
  upstream: z.ZodEnum<{
547
- unknown: "unknown";
548
599
  supported: "supported";
600
+ unknown: "unknown";
549
601
  unsupported: "unsupported";
550
602
  }>;
551
603
  runnable: z.ZodBoolean;
552
604
  }, z.core.$strip>;
553
605
  realtimeAudio: z.ZodObject<{
554
606
  upstream: z.ZodEnum<{
555
- unknown: "unknown";
556
607
  supported: "supported";
608
+ unknown: "unknown";
557
609
  unsupported: "unsupported";
558
610
  }>;
559
611
  runnable: z.ZodBoolean;
@@ -561,31 +613,31 @@ declare const ModelCapabilitiesV1Schema: z.ZodObject<{
561
613
  }, z.core.$strip>;
562
614
  latencyModes: z.ZodArray<z.ZodObject<{
563
615
  id: z.ZodEnum<{
564
- standard: "standard";
565
- priority: "priority";
566
616
  fast: "fast";
617
+ priority: "priority";
618
+ standard: "standard";
567
619
  }>;
568
620
  upstream: z.ZodEnum<{
569
- unknown: "unknown";
570
621
  supported: "supported";
622
+ unknown: "unknown";
571
623
  unsupported: "unsupported";
572
624
  }>;
573
625
  runnable: z.ZodBoolean;
574
626
  billingMultiplierBps: z.ZodOptional<z.ZodNumber>;
575
627
  }, z.core.$strip>>;
576
628
  }, z.core.$strip>;
577
- type ModelCapabilitiesV1 = z.infer<typeof ModelCapabilitiesV1Schema>;
578
- type ModelDeploymentV1 = {
629
+ export type ModelCapabilitiesV1 = z.infer<typeof ModelCapabilitiesV1Schema>;
630
+ export type ModelDeploymentV1 = {
579
631
  upstreamModelId: string;
580
632
  wireApi: ModelProviderApi;
581
633
  };
582
- type ModelExecutionLimitsV1 = {
634
+ export type ModelExecutionLimitsV1 = {
583
635
  contextWindowTokens: number | null;
584
636
  effectiveContextWindowTokens: number | null;
585
637
  autoCompactTokenLimit: number | null;
586
638
  toolOutputTruncationTokens: number | null;
587
639
  };
588
- type CredentialSourceV1 = {
640
+ export type CredentialSourceV1 = {
589
641
  kind: "deployment";
590
642
  mechanism: "api_key" | "azure_ad_bearer";
591
643
  } | {
@@ -595,7 +647,7 @@ type CredentialSourceV1 = {
595
647
  kind: "workspace_connection";
596
648
  mechanism: "api_key";
597
649
  };
598
- type BillingAttributionV1 = {
650
+ export type BillingAttributionV1 = {
599
651
  upstreamPayer: "deployment" | "workspace" | "connected_subscription";
600
652
  metering: "opengeni_credits" | "external";
601
653
  };
@@ -606,21 +658,21 @@ type BillingAttributionV1 = {
606
658
  * wired as "chat" because its beta Responses endpoint echoes input back and
607
659
  * silently no-ops hosted tools (see docs/model-providers.md).
608
660
  */
609
- declare const ModelProviderApi: z.ZodEnum<{
610
- responses: "responses";
661
+ export declare const ModelProviderApi: z.ZodEnum<{
611
662
  chat: "chat";
663
+ responses: "responses";
612
664
  }>;
613
- type ModelProviderApi = z.infer<typeof ModelProviderApi>;
665
+ export type ModelProviderApi = z.infer<typeof ModelProviderApi>;
614
666
  /**
615
667
  * Registry provider kind. "api-key" providers carry their own static key/headers;
616
668
  * "codex-subscription" providers authenticate per-request with a ChatGPT/Codex
617
669
  * subscription token resolved at call time (no static key) — see @opengeni/codex.
618
670
  */
619
- declare const RegistryProviderKind: z.ZodEnum<{
671
+ export declare const RegistryProviderKind: z.ZodEnum<{
620
672
  "api-key": "api-key";
621
673
  "codex-subscription": "codex-subscription";
622
674
  }>;
623
- type RegistryProviderKind = z.infer<typeof RegistryProviderKind>;
675
+ export type RegistryProviderKind = z.infer<typeof RegistryProviderKind>;
624
676
  /** A non-built-in provider declared by the host via OPENGENI_MODEL_PROVIDERS_JSON. */
625
677
  declare const RegistryProviderSchema: z.ZodObject<{
626
678
  kind: z.ZodDefault<z.ZodEnum<{
@@ -630,8 +682,8 @@ declare const RegistryProviderSchema: z.ZodObject<{
630
682
  id: z.ZodString;
631
683
  label: z.ZodOptional<z.ZodString>;
632
684
  api: z.ZodDefault<z.ZodEnum<{
633
- responses: "responses";
634
685
  chat: "chat";
686
+ responses: "responses";
635
687
  }>>;
636
688
  baseUrl: z.ZodString;
637
689
  apiKey: z.ZodOptional<z.ZodString>;
@@ -656,41 +708,41 @@ declare const RegistryProviderSchema: z.ZodObject<{
656
708
  capabilities: z.ZodOptional<z.ZodObject<{
657
709
  reasoning: z.ZodObject<{
658
710
  upstream: z.ZodEnum<{
659
- unknown: "unknown";
660
711
  supported: "supported";
712
+ unknown: "unknown";
661
713
  unsupported: "unsupported";
662
714
  }>;
663
715
  runnable: z.ZodBoolean;
664
716
  efforts: z.ZodArray<z.ZodEnum<{
665
- none: "none";
666
- minimal: "minimal";
717
+ high: "high";
667
718
  low: "low";
668
719
  medium: "medium";
669
- high: "high";
720
+ minimal: "minimal";
721
+ none: "none";
670
722
  xhigh: "xhigh";
671
723
  }>>;
672
724
  defaultEffort: z.ZodNullable<z.ZodEnum<{
673
- none: "none";
674
- minimal: "minimal";
725
+ high: "high";
675
726
  low: "low";
676
727
  medium: "medium";
677
- high: "high";
728
+ minimal: "minimal";
729
+ none: "none";
678
730
  xhigh: "xhigh";
679
731
  }>>;
680
732
  required: z.ZodBoolean;
681
733
  }, z.core.$strip>;
682
734
  functionCalling: z.ZodObject<{
683
735
  upstream: z.ZodEnum<{
684
- unknown: "unknown";
685
736
  supported: "supported";
737
+ unknown: "unknown";
686
738
  unsupported: "unsupported";
687
739
  }>;
688
740
  runnable: z.ZodBoolean;
689
741
  }, z.core.$strip>;
690
742
  structuredOutput: z.ZodObject<{
691
743
  upstream: z.ZodEnum<{
692
- unknown: "unknown";
693
744
  supported: "supported";
745
+ unknown: "unknown";
694
746
  unsupported: "unsupported";
695
747
  }>;
696
748
  runnable: z.ZodBoolean;
@@ -698,60 +750,60 @@ declare const RegistryProviderSchema: z.ZodObject<{
698
750
  hostedTools: z.ZodObject<{
699
751
  webSearch: z.ZodObject<{
700
752
  upstream: z.ZodEnum<{
701
- unknown: "unknown";
702
753
  supported: "supported";
754
+ unknown: "unknown";
703
755
  unsupported: "unsupported";
704
756
  }>;
705
757
  runnable: z.ZodBoolean;
706
758
  }, z.core.$strip>;
707
759
  xSearch: z.ZodObject<{
708
760
  upstream: z.ZodEnum<{
709
- unknown: "unknown";
710
761
  supported: "supported";
762
+ unknown: "unknown";
711
763
  unsupported: "unsupported";
712
764
  }>;
713
765
  runnable: z.ZodBoolean;
714
766
  }, z.core.$strip>;
715
767
  codeExecution: z.ZodObject<{
716
768
  upstream: z.ZodEnum<{
717
- unknown: "unknown";
718
769
  supported: "supported";
770
+ unknown: "unknown";
719
771
  unsupported: "unsupported";
720
772
  }>;
721
773
  runnable: z.ZodBoolean;
722
774
  }, z.core.$strip>;
723
775
  }, z.core.$strip>;
724
776
  inputModalities: z.ZodArray<z.ZodEnum<{
725
- text: "text";
726
- image: "image";
727
777
  audio: "audio";
778
+ image: "image";
779
+ text: "text";
728
780
  }>>;
729
781
  outputModalities: z.ZodArray<z.ZodEnum<{
730
- text: "text";
731
- image: "image";
732
782
  audio: "audio";
783
+ image: "image";
784
+ text: "text";
733
785
  }>>;
734
786
  transports: z.ZodObject<{
735
787
  sse: z.ZodObject<{
736
788
  upstream: z.ZodEnum<{
737
- unknown: "unknown";
738
789
  supported: "supported";
790
+ unknown: "unknown";
739
791
  unsupported: "unsupported";
740
792
  }>;
741
793
  runnable: z.ZodBoolean;
742
794
  }, z.core.$strip>;
743
795
  responsesWebSocket: z.ZodObject<{
744
796
  upstream: z.ZodEnum<{
745
- unknown: "unknown";
746
797
  supported: "supported";
798
+ unknown: "unknown";
747
799
  unsupported: "unsupported";
748
800
  }>;
749
801
  runnable: z.ZodBoolean;
750
802
  }, z.core.$strip>;
751
803
  realtimeAudio: z.ZodObject<{
752
804
  upstream: z.ZodEnum<{
753
- unknown: "unknown";
754
805
  supported: "supported";
806
+ unknown: "unknown";
755
807
  unsupported: "unsupported";
756
808
  }>;
757
809
  runnable: z.ZodBoolean;
@@ -759,13 +811,13 @@ declare const RegistryProviderSchema: z.ZodObject<{
759
811
  }, z.core.$strip>;
760
812
  latencyModes: z.ZodArray<z.ZodObject<{
761
813
  id: z.ZodEnum<{
762
- standard: "standard";
763
- priority: "priority";
764
814
  fast: "fast";
815
+ priority: "priority";
816
+ standard: "standard";
765
817
  }>;
766
818
  upstream: z.ZodEnum<{
767
- unknown: "unknown";
768
819
  supported: "supported";
820
+ unknown: "unknown";
769
821
  unsupported: "unsupported";
770
822
  }>;
771
823
  runnable: z.ZodBoolean;
@@ -798,17 +850,17 @@ declare const RegistryProviderSchema: z.ZodObject<{
798
850
  billing: z.ZodOptional<z.ZodNever>;
799
851
  }, z.core.$strip>>;
800
852
  }, z.core.$strip>;
801
- type RegistryProvider = z.infer<typeof RegistryProviderSchema>;
802
- declare const IntegrationOAuthClientConfigSchema: z.ZodObject<{
853
+ export type RegistryProvider = z.infer<typeof RegistryProviderSchema>;
854
+ export declare const IntegrationOAuthClientConfigSchema: z.ZodObject<{
803
855
  clientId: z.ZodString;
804
856
  clientSecret: z.ZodOptional<z.ZodString>;
805
857
  tokenEndpointAuthMethod: z.ZodDefault<z.ZodEnum<{
806
- none: "none";
807
- client_secret_post: "client_secret_post";
808
858
  client_secret_basic: "client_secret_basic";
859
+ client_secret_post: "client_secret_post";
860
+ none: "none";
809
861
  }>>;
810
862
  }, z.core.$strip>;
811
- type IntegrationOAuthClientConfig = z.infer<typeof IntegrationOAuthClientConfigSchema>;
863
+ export type IntegrationOAuthClientConfig = z.infer<typeof IntegrationOAuthClientConfigSchema>;
812
864
  /**
813
865
  * Runtime-resolved provider (built-in or registry), client-construction-ready.
814
866
  * The built-in OpenAI/Azure provider is always present and always "responses";
@@ -816,7 +868,7 @@ type IntegrationOAuthClientConfig = z.infer<typeof IntegrationOAuthClientConfigS
816
868
  * not a provider capability: all providers use the same durable plaintext
817
869
  * replacement.
818
870
  */
819
- interface ResolvedModelProvider {
871
+ export interface ResolvedModelProvider {
820
872
  id: string;
821
873
  label: string;
822
874
  kind: RegistryProviderKind;
@@ -832,7 +884,7 @@ interface ResolvedModelProvider {
832
884
  billing: BillingAttributionV1;
833
885
  }
834
886
  /** A single exposed model + the provider that serves it. */
835
- interface ConfiguredModel {
887
+ export interface ConfiguredModel {
836
888
  schemaVersion: 1;
837
889
  id: string;
838
890
  aliases: string[];
@@ -855,15 +907,30 @@ interface ConfiguredModel {
855
907
  reasoningEffort: boolean;
856
908
  hostedWebSearch: boolean;
857
909
  }
858
- declare const defaultModelPricing: Record<string, ModelPricing>;
859
- type SandboxRequiredEnv = {
910
+ /**
911
+ * Built-in OpenGeni credit pricing schedules.
912
+ *
913
+ * Rates are provider list prices in USD micros per 1M tokens. Debit applies
914
+ * `marginBps` (2_500 = +25%) on top. Long-context tiers follow OpenAI's
915
+ * ">272K input tokens" rule (threshold exclusive of 272_000).
916
+ *
917
+ * GPT-5.4 and older families are intentionally omitted — they are no longer
918
+ * offered. Codex / connected-subscription turns use `metering: external` and
919
+ * never consult this map.
920
+ *
921
+ * When adding or changing a billed model, run `bun run check:model-pricing`
922
+ * (see docs/model-providers.md § Price audit). That compares this map to
923
+ * llm-prices.com as a ground-truth canary; it does not generate this table.
924
+ */
925
+ export declare const defaultModelPricing: Record<string, ModelPricingScheduleV1>;
926
+ export type SandboxRequiredEnv = {
860
927
  field: keyof Settings;
861
928
  env: string;
862
929
  };
863
- declare const SANDBOX_REQUIRED_ENV: Record<z.infer<typeof SandboxBackend>, readonly SandboxRequiredEnv[]>;
930
+ export declare const SANDBOX_REQUIRED_ENV: Record<z.infer<typeof SandboxBackend>, readonly SandboxRequiredEnv[]>;
864
931
  /** The required OPENGENI_* env var names for a backend (for the deployment manifest). */
865
- declare function requiredSandboxEnvForBackend(backend: z.infer<typeof SandboxBackend>): string[];
866
- declare function getSettings(): Settings;
932
+ export declare function requiredSandboxEnvForBackend(backend: z.infer<typeof SandboxBackend>): string[];
933
+ export declare function getSettings(): Settings;
867
934
  /**
868
935
  * The Modal sandbox idle timeout (seconds) the provider actually passes as
869
936
  * idleTimeoutMs (sandbox-file-persistence). When the operator did not pin
@@ -875,8 +942,17 @@ declare function getSettings(): Settings;
875
942
  * it above reaperPeriod + idleGrace so a drained box still survives long enough
876
943
  * to be persisted).
877
944
  */
878
- declare function effectiveModalIdleTimeoutSeconds(settings: Settings): number;
879
- declare function collectSandboxEnvironment(settings: Settings, source?: NodeJS.ProcessEnv): Record<string, string>;
945
+ export declare function effectiveModalIdleTimeoutSeconds(settings: Settings): number;
946
+ /**
947
+ * One shared upper bound for the durable provider-capture claim and for command
948
+ * admission waiting behind it. The SDK request itself is bounded by
949
+ * sandboxSnapshotTimeoutMs; the extra window lets a non-cancellable provider
950
+ * response settle and release its exact claim without turning a normal
951
+ * checkpoint into a visible command failure. Database validation caps both
952
+ * consumers at one hour.
953
+ */
954
+ export declare function sandboxArchiveCaptureTimeoutMs(settings: Pick<Settings, "sandboxSnapshotTimeoutMs">): number;
955
+ export declare function collectSandboxEnvironment(settings: Settings, source?: NodeJS.ProcessEnv): Record<string, string>;
880
956
  /**
881
957
  * Resolved API key for a registry provider: the inline `apiKey` when present,
882
958
  * else the value of the env var named by `apiKeyEnv`. The preferred form is
@@ -884,7 +960,22 @@ declare function collectSandboxEnvironment(settings: Settings, source?: NodeJS.P
884
960
  * from `source` (defaults to process.env) so callers can resolve against an
885
961
  * explicit environment in tests.
886
962
  */
887
- declare function resolveProviderApiKey(provider: Pick<RegistryProvider, "apiKey" | "apiKeyEnv">, source?: NodeJS.ProcessEnv): string | undefined;
963
+ export declare function resolveProviderApiKey(provider: Pick<RegistryProvider, "apiKey" | "apiKeyEnv">, source?: NodeJS.ProcessEnv): string | undefined;
964
+ /**
965
+ * Product display label for catalog/picker UI.
966
+ * Same string for OpenAI and Codex copies of a slug (`gpt-5.6-luna` and
967
+ * `codex/gpt-5.6-luna` → `GPT-5.6 Luna`). Non-gpt ids pass through unchanged.
968
+ */
969
+ export declare function productLabelForModelId(modelId: string): string;
970
+ /**
971
+ * Map OpenGeni latency mode to the provider `service_tier` wire value.
972
+ * Azure and Codex ChatGPT accept `priority`; OpenAI API accepts `fast` (alias of priority).
973
+ * Standard omits the field.
974
+ */
975
+ export declare function serviceTierForLatencyMode(providerId: string, latencyMode: LatencyMode): "fast" | "priority" | undefined;
976
+ /** True when the response tier fulfills a non-standard Fast/priority request. */
977
+ export declare function responseSatisfiesLatencyMode(requested: LatencyMode, responseServiceTier: string | null | undefined): boolean;
978
+ export declare function runnableLatencyModesForModel(settings: Settings, modelId: string): LatencyMode[];
888
979
  /**
889
980
  * The built-in provider's stable id: "openai" on the OpenAI platform, "azure"
890
981
  * on Azure. Exported because the workspace model-policy gate must attribute
@@ -892,7 +983,7 @@ declare function resolveProviderApiKey(provider: Pick<RegistryProvider, "apiKey"
892
983
  * client) to the SAME identity the router uses — otherwise a policy blocking
893
984
  * the built-in could be bypassed through the null-resolution path.
894
985
  */
895
- declare function builtinProviderId(settings: Pick<Settings, "openaiProvider">): string;
986
+ export declare function builtinProviderId(settings: Pick<Settings, "openaiProvider">): string;
896
987
  /**
897
988
  * Every provider a client may route to: the built-in OpenAI/Azure provider
898
989
  * first (id "openai"/"azure", always "responses"), then each registry provider
@@ -901,14 +992,14 @@ declare function builtinProviderId(settings: Pick<Settings, "openaiProvider">):
901
992
  * registry entry for the rest. Registry ids may not collide with the built-in
902
993
  * id — validateSettings rejects that at boot.
903
994
  */
904
- declare function configuredProviders(settings: Settings): ResolvedModelProvider[];
995
+ export declare function configuredProviders(settings: Settings): ResolvedModelProvider[];
905
996
  /**
906
997
  * Pure catalog overlay for a workspace whose existing Codex connection seam
907
998
  * reports ready. This describes product/provider identity only; it does not
908
999
  * select, lease, refresh, or expose a concrete credential; those runtime
909
1000
  * operations remain owned by the credential allocator.
910
1001
  */
911
- declare function withCodexCatalogProvider(settings: Settings): Settings;
1002
+ export declare function withCodexCatalogProvider(settings: Settings): Settings;
912
1003
  /**
913
1004
  * The provider identity a model id resolves to, for workspace model-policy
914
1005
  * evaluation — MUST agree with the real router (resolveTurnModel /
@@ -922,7 +1013,7 @@ declare function withCodexCatalogProvider(settings: Settings): Settings;
922
1013
  * resolveTurnModel-null fallback, which the built-in OpenAI/Azure client
923
1014
  * serves. A policy blocking the built-in must block this path too.
924
1015
  */
925
- declare function policyProviderIdForModel(settings: Settings, modelId: string): string;
1016
+ export declare function policyProviderIdForModel(settings: Settings, modelId: string): string;
926
1017
  /**
927
1018
  * Every model a client may use, the built-in provider's models first
928
1019
  * (configuredAllowedModels-from-openai, mapped to "responses" with
@@ -931,9 +1022,9 @@ declare function policyProviderIdForModel(settings: Settings, modelId: string):
931
1022
  * default false). De-duplicated by id (first wins) so the default model stays
932
1023
  * first and the built-in allow-list takes precedence over registry entries.
933
1024
  */
934
- declare function configuredModels(settings: Settings): ConfiguredModel[];
1025
+ export declare function configuredModels(settings: Settings): ConfiguredModel[];
935
1026
  /** Resolve a known canonical id or alias. Unknown strings are returned unchanged. */
936
- declare function canonicalizeConfiguredModelId(settings: Settings, modelId: string): string;
1027
+ export declare function canonicalizeConfiguredModelId(settings: Settings, modelId: string): string;
937
1028
  /**
938
1029
  * Allowed model ids in selection order. Reimplemented on top of
939
1030
  * configuredModels so it is the union of the built-in allow-list and every
@@ -941,18 +1032,18 @@ declare function canonicalizeConfiguredModelId(settings: Settings, modelId: stri
941
1032
  * depend on it): settings.openaiModel is always first, then the rest of the
942
1033
  * openai allow-list, then registry ids.
943
1034
  */
944
- declare function configuredAllowedModels(settings: Settings): string[];
1035
+ export declare function configuredAllowedModels(settings: Settings): string[];
945
1036
  /**
946
1037
  * Resolve a model string to the provider that serves it and its configured
947
1038
  * shape. Returns undefined when the id is not exposed (built-in allow-list nor
948
1039
  * any registry provider), so the runtime can fall back to the legacy global
949
1040
  * client path.
950
1041
  */
951
- declare function resolveModelProvider(settings: Settings, modelId: string): {
1042
+ export declare function resolveModelProvider(settings: Settings, modelId: string): {
952
1043
  provider: ResolvedModelProvider;
953
1044
  model: ConfiguredModel;
954
1045
  } | undefined;
955
- type ResolveTurnExecutionPolicyV1Input = {
1046
+ export type ResolveTurnExecutionPolicyV1Input = {
956
1047
  /** Effective persisted turn model. Aliases are accepted and canonicalized. */
957
1048
  modelId: string;
958
1049
  /** Exact caller-supplied input before canonicalization, only for explicit switches. */
@@ -960,21 +1051,24 @@ type ResolveTurnExecutionPolicyV1Input = {
960
1051
  modelSource: TurnExecutionModelSourceV1;
961
1052
  reasoningEffort: Settings["openaiReasoningEffort"];
962
1053
  reasoningSource: TurnExecutionReasoningSourceV1;
1054
+ latencyMode?: LatencyMode;
1055
+ latencyModeSource?: TurnExecutionLatencyModeSourceV1;
963
1056
  };
964
1057
  /**
965
1058
  * Build a trusted, secret-safe execution policy from the normalized catalog.
966
1059
  * The Codex overlay here contains static product/provider identity only; it
967
1060
  * neither proves readiness nor chooses, decrypts, leases, or exposes an account.
968
1061
  */
969
- declare function resolveTurnExecutionPolicyV1(settings: Settings, input: ResolveTurnExecutionPolicyV1Input): TurnExecutionPolicyV1;
1062
+ export declare function resolveTurnExecutionPolicyV1(settings: Settings, input: ResolveTurnExecutionPolicyV1Input): TurnExecutionPolicyV1;
970
1063
  /**
971
1064
  * Parse-time validation lives in @opengeni/contracts; this verifier binds a
972
1065
  * present snapshot to the current executable definition and exact turn row.
973
1066
  * Any deployment/provider drift fails before a provider or compaction call.
974
1067
  */
975
- declare function assertTurnExecutionPolicyMatchesConfigV1(settings: Settings, policy: TurnExecutionPolicyV1, expected: {
1068
+ export declare function assertTurnExecutionPolicyMatchesConfigV1(settings: Settings, policy: TurnExecutionPolicyV1, expected: {
976
1069
  modelId: string;
977
1070
  reasoningEffort: Settings["openaiReasoningEffort"];
1071
+ latencyMode?: LatencyMode;
978
1072
  }): {
979
1073
  policy: TurnExecutionPolicyV1;
980
1074
  provider: ResolvedModelProvider;
@@ -987,39 +1081,41 @@ declare function assertTurnExecutionPolicyMatchesConfigV1(settings: Settings, po
987
1081
  * a registry schedule with one flat default so its historical precedence stays
988
1082
  * exact.
989
1083
  */
990
- declare function configuredModelPricingSchedules(settings: Settings): Record<string, ModelPricingScheduleV1>;
1084
+ export declare function configuredModelPricingSchedules(settings: Settings): Record<string, ModelPricingScheduleV1>;
991
1085
  /** Legacy flat projection: returns the default/below-threshold price. */
992
- declare function configuredModelPricing(settings: Settings): Record<string, ModelPricing>;
1086
+ export declare function configuredModelPricing(settings: Settings): Record<string, ModelPricing>;
993
1087
  /** Select the per-provider-request price at an exact input-token threshold. */
994
- declare function selectModelPricing(schedule: ModelPricingScheduleV1, inputTokens: number): ModelPricing;
1088
+ export declare function selectModelPricing(schedule: ModelPricingScheduleV1, inputTokens: number): ModelPricing;
995
1089
  /**
996
1090
  * Usable input-token budget: an explicit model-catalog effective window when
997
1091
  * available, otherwise the deployment window minus its output reserve.
998
1092
  */
999
- declare function contextInputBudgetTokens(settings: Pick<Settings, "contextWindowTokens" | "contextEffectiveWindowTokens" | "contextReservedOutputTokens">): number;
1093
+ export declare function contextInputBudgetTokens(settings: Pick<Settings, "contextWindowTokens" | "contextEffectiveWindowTokens" | "contextReservedOutputTokens">): number;
1000
1094
  /**
1001
1095
  * Apply the resolved provider/model's context policy to one turn. Registry
1002
1096
  * metadata is authoritative when present; deployment defaults remain the
1003
1097
  * fallback for models that do not declare their own limits.
1004
1098
  */
1005
- declare function settingsWithResolvedModelContext(settings: Settings, model: Pick<ConfiguredModel, "contextWindowTokens" | "effectiveContextWindowTokens" | "autoCompactTokenLimit" | "toolOutputTruncationTokens">): Settings;
1006
- declare function configuredStaticUsageLimits(settings: Settings): StaticUsageLimitsConfig;
1007
- declare function configuredEntitlements(settings: Settings): EntitlementsConfig;
1008
- declare function calculateModelUsageCostMicros(settings: Settings, model: string, usage: ModelUsageInput): number;
1009
- declare function configuredAllowedReasoningEfforts(settings: Settings): Array<z.infer<typeof ReasoningEffort>>;
1099
+ export declare function settingsWithResolvedModelContext(settings: Settings, model: Pick<ConfiguredModel, "contextWindowTokens" | "effectiveContextWindowTokens" | "autoCompactTokenLimit" | "toolOutputTruncationTokens">): Settings;
1100
+ export declare function configuredStaticUsageLimits(settings: Settings): StaticUsageLimitsConfig;
1101
+ export declare function configuredEntitlements(settings: Settings): EntitlementsConfig;
1102
+ export declare function calculateModelUsageCostMicros(settings: Settings, model: string, usage: ModelUsageInput, options?: {
1103
+ latencyMode?: LatencyMode;
1104
+ }): number;
1105
+ export declare function configuredAllowedReasoningEfforts(settings: Settings): Array<z.infer<typeof ReasoningEffort>>;
1010
1106
  /**
1011
1107
  * Decodes OPENGENI_ENVIRONMENTS_ENCRYPTION_KEY (base64, exactly 32 bytes) for
1012
1108
  * AES-256-GCM workspace environment value encryption. Returns null when unset.
1013
1109
  * Throws naming only the env var, never echoing its value.
1014
1110
  */
1015
- declare function environmentsEncryptionKeyBytes(settings: Settings): Uint8Array | null;
1111
+ export declare function environmentsEncryptionKeyBytes(settings: Settings): Uint8Array | null;
1016
1112
  /**
1017
1113
  * Build one structurally compatible connection policy for both
1018
1114
  * `@temporalio/client` and `@temporalio/worker`. An API key or any custom TLS
1019
1115
  * material enables TLS automatically; the explicit flag covers server-auth TLS
1020
1116
  * without credentials. Secret values are never included in validation errors.
1021
1117
  */
1022
- declare function temporalConnectionOptions(settings: Settings): TemporalConnectionOptions;
1118
+ export declare function temporalConnectionOptions(settings: Settings): TemporalConnectionOptions;
1023
1119
  /**
1024
1120
  * The connection `search_path` for OpenGeni's db handles + the managed-auth pool
1025
1121
  * (Step I, §7.8 runtime half). Returns `undefined` when `dbSchema` is unset
@@ -1030,8 +1126,8 @@ declare function temporalConnectionOptions(settings: Settings): TemporalConnecti
1030
1126
  * resolve (the schema-isolation contract live footgun). `opengeni_private` is on the path so the
1031
1127
  * RLS GUC-reader helpers resolve when referenced unqualified.
1032
1128
  */
1033
- declare function dbSearchPath(settings: Pick<Settings, "dbSchema">): string | undefined;
1034
- declare function collectGitIdentityEnvironment(settings: Settings): Record<string, string>;
1129
+ export declare function dbSearchPath(settings: Pick<Settings, "dbSchema">): string | undefined;
1130
+ export declare function collectGitIdentityEnvironment(settings: Settings): Record<string, string>;
1035
1131
  /**
1036
1132
  * The STABLE run-scoped sandbox environment: the subset of a run's box-manifest
1037
1133
  * environment that is IDENTICAL whether the box is first warmed by the worker
@@ -1064,7 +1160,7 @@ declare function collectGitIdentityEnvironment(settings: Settings): Record<strin
1064
1160
  * this helper fixes is for the common (no-repo) and workspace-environment-attached
1065
1161
  * provisioned-box cases.
1066
1162
  */
1067
- declare function stableSandboxEnvironmentForRun(settings: Settings, workspaceEnvironment?: Record<string, string>, options?: {
1163
+ export declare function stableSandboxEnvironmentForRun(settings: Settings, workspaceEnvironment?: Record<string, string>, options?: {
1068
1164
  workspaceId?: string;
1069
1165
  }): Record<string, string>;
1070
1166
  /**
@@ -1074,7 +1170,7 @@ declare function stableSandboxEnvironmentForRun(settings: Settings, workspaceEnv
1074
1170
  * an attach-warmed cold box carries the IDENTICAL manifest env a later repo turn
1075
1171
  * declares (env parity — see applyGitAuthPointerEnvironment).
1076
1172
  */
1077
- declare function hasGitHubRepositorySelection(resources: ReadonlyArray<{
1173
+ export declare function hasGitHubRepositorySelection(resources: ReadonlyArray<{
1078
1174
  kind: string;
1079
1175
  provider?: unknown;
1080
1176
  installationId?: unknown;
@@ -1082,7 +1178,7 @@ declare function hasGitHubRepositorySelection(resources: ReadonlyArray<{
1082
1178
  githubInstallationId?: unknown;
1083
1179
  githubRepositoryId?: unknown;
1084
1180
  }>): boolean;
1085
- declare function hasGitCredentialRepositorySelection(resources: ReadonlyArray<{
1181
+ export declare function hasGitCredentialRepositorySelection(resources: ReadonlyArray<{
1086
1182
  kind: string;
1087
1183
  provider?: unknown;
1088
1184
  githubInstallationId?: unknown;
@@ -1105,11 +1201,11 @@ declare function hasGitCredentialRepositorySelection(resources: ReadonlyArray<{
1105
1201
  * Mutates and returns `environment`. Identity fallbacks preserve values already
1106
1202
  * present (the deployment git-identity allowlist wins over the bot identity).
1107
1203
  */
1108
- declare function applyGitAuthPointerEnvironment(environment: Record<string, string>, identity: {
1204
+ export declare function applyGitAuthPointerEnvironment(environment: Record<string, string>, identity: {
1109
1205
  name: string;
1110
1206
  email: string;
1111
1207
  } | null): Record<string, string>;
1112
- type StartupRetryOptions = {
1208
+ export type StartupRetryOptions = {
1113
1209
  attempts?: number;
1114
1210
  initialDelayMs?: number;
1115
1211
  maxDelayMs?: number;
@@ -1121,24 +1217,24 @@ type StartupRetryOptions = {
1121
1217
  error: unknown;
1122
1218
  }) => void;
1123
1219
  };
1124
- declare function startupRetryOptions(settings: Settings): Required<Omit<StartupRetryOptions, "onRetry">>;
1125
- declare function retryStartupDependency<T>(label: string, operation: () => Promise<T>, options?: StartupRetryOptions): Promise<T>;
1126
- declare function sandboxEnvironmentVariableNames(settings: Settings): string[];
1127
- declare function sandboxLifecycleHookIds(settings: Settings): string[];
1128
- declare function parseExposedPorts(raw: string): number[];
1129
- declare function parseMcpServers(raw: string | undefined): unknown[] | undefined;
1130
- declare function parseModelPricingJson(raw: string): Record<string, ModelPricing>;
1131
- declare function parseSandboxWarmRateJson(raw: string): Record<string, number>;
1132
- declare function sandboxWarmRateMicrosPerSecond(settings: Settings, backend: string): number;
1220
+ export declare function startupRetryOptions(settings: Settings): Required<Omit<StartupRetryOptions, "onRetry">>;
1221
+ export declare function retryStartupDependency<T>(label: string, operation: () => Promise<T>, options?: StartupRetryOptions): Promise<T>;
1222
+ export declare function sandboxEnvironmentVariableNames(settings: Settings): string[];
1223
+ export declare function sandboxLifecycleHookIds(settings: Settings): string[];
1224
+ export declare function parseExposedPorts(raw: string): number[];
1225
+ export declare function parseMcpServers(raw: string | undefined): unknown[] | undefined;
1226
+ export declare function parseModelPricingJson(raw: string): Record<string, ModelPricing>;
1227
+ export declare function parseSandboxWarmRateJson(raw: string): Record<string, number>;
1228
+ export declare function sandboxWarmRateMicrosPerSecond(settings: Settings, backend: string): number;
1133
1229
  /**
1134
1230
  * Parse + validate the extra-provider registry JSON. `[]` (or empty/whitespace)
1135
1231
  * yields an empty list. Surfaces JSON and zod errors prefixed with the env-var
1136
1232
  * name so a malformed registry fails fast at boot (validateSettings calls this).
1137
1233
  */
1138
- declare function parseModelProvidersJson(raw: string): RegistryProvider[];
1139
- declare function parseIntegrationsOauthClientsJson(raw: string | undefined): Record<string, IntegrationOAuthClientConfig>;
1140
- declare function parseStaticUsageLimitsJson(raw: string): StaticUsageLimitsConfig;
1141
- declare function parseStaticEntitlementsJson(raw: string): EntitlementsConfig;
1234
+ export declare function parseModelProvidersJson(raw: string): RegistryProvider[];
1235
+ export declare function parseIntegrationsOauthClientsJson(raw: string | undefined): Record<string, IntegrationOAuthClientConfig>;
1236
+ export declare function parseStaticUsageLimitsJson(raw: string): StaticUsageLimitsConfig;
1237
+ export declare function parseStaticEntitlementsJson(raw: string): EntitlementsConfig;
1142
1238
  /**
1143
1239
  * The base URL of OpenGeni's own first-party MCP endpoint, as a `{workspaceId}`
1144
1240
  * template — the SINGLE source of truth for the `opengeniMcpUrl`-or-loopback
@@ -1160,8 +1256,8 @@ declare function parseStaticEntitlementsJson(raw: string): EntitlementsConfig;
1160
1256
  * `{workspaceId}` template, or a concrete base that gets re-scoped). This is
1161
1257
  * the one binding a mounted embed cannot leave unset.
1162
1258
  */
1163
- declare function firstPartyMcpBaseUrl(settings: Settings): string;
1164
- declare function firstPartyMcpWorkspaceUrl(settings: Settings, workspaceId: string): string;
1259
+ export declare function firstPartyMcpBaseUrl(settings: Settings): string;
1260
+ export declare function firstPartyMcpWorkspaceUrl(settings: Settings, workspaceId: string): string;
1165
1261
  /**
1166
1262
  * Resolve the secret used to sign/verify scoped stream tokens (sandbox contract
1167
1263
  * §C.3). Falls back to `delegationSecret` (the same HMAC envelope family —
@@ -1169,13 +1265,13 @@ declare function firstPartyMcpWorkspaceUrl(settings: Settings, workspaceId: stri
1169
1265
  * secret does not need a second one. Returns undefined when neither is set,
1170
1266
  * which drives the graceful-degrade (DesktopStream.transport:null).
1171
1267
  */
1172
- declare function resolveStreamTokenSecret(settings: Settings): string | undefined;
1268
+ export declare function resolveStreamTokenSecret(settings: Settings): string | undefined;
1173
1269
  /**
1174
1270
  * True iff the desktop pixel plane must GRACEFULLY DEGRADE because desktop is
1175
1271
  * enabled but no stream-token secret is resolvable (stream-token availability contract). When true,
1176
1272
  * negotiateCapabilities forces DesktopStream.transport:null.
1177
1273
  */
1178
- declare function streamTokenDegraded(settings: Settings): boolean;
1274
+ export declare function streamTokenDegraded(settings: Settings): boolean;
1179
1275
  /**
1180
1276
  * Resolve the secret the control plane signs the enrollment bearer credential
1181
1277
  * with (the `oge_` envelope the agent presents back — M5). Falls
@@ -1185,7 +1281,7 @@ declare function streamTokenDegraded(settings: Settings): boolean;
1185
1281
  * reports the credential plane disabled (graceful degrade, never a 500). NEVER log
1186
1282
  * the returned value.
1187
1283
  */
1188
- declare function resolveEnrollmentSigningSecret(settings: Settings): string | undefined;
1284
+ export declare function resolveEnrollmentSigningSecret(settings: Settings): string | undefined;
1189
1285
  /**
1190
1286
  * Resolve the HMAC secret the control plane signs the agent's relay PRODUCER token
1191
1287
  * with (the `ogr_` envelope; M8b). The RELAY verifies the producer
@@ -1196,7 +1292,7 @@ declare function resolveEnrollmentSigningSecret(settings: Settings): string | un
1196
1292
  * none is set — the enrollment poll then returns an empty relayToken (graceful
1197
1293
  * degrade; the stream plane is unavailable until configured). NEVER log the value.
1198
1294
  */
1199
- declare function resolveRelayTokenSecret(settings: Settings): string | undefined;
1295
+ export declare function resolveRelayTokenSecret(settings: Settings): string | undefined;
1200
1296
  /**
1201
1297
  * The resolved NATS auth-callout responder config (M-AUTH). Present only when the
1202
1298
  * callout plane is FULLY configured: the account signing seed + the responder's own
@@ -1204,7 +1300,7 @@ declare function resolveRelayTokenSecret(settings: Settings): string | undefined
1204
1300
  * start (selfhosted agents cannot connect — a graceful disabled state, never a boot
1205
1301
  * crash). The returned `accountSeed` is a secret; NEVER log it.
1206
1302
  */
1207
- interface NatsCalloutConfig {
1303
+ export interface NatsCalloutConfig {
1208
1304
  /** The callout account SIGNING seed (`SA...`) — signs the user + response JWTs. */
1209
1305
  accountSeed: string;
1210
1306
  /** The target account NAME the user is placed into (the response `aud`). */
@@ -1213,17 +1309,16 @@ interface NatsCalloutConfig {
1213
1309
  user: string;
1214
1310
  password: string;
1215
1311
  }
1216
- declare function resolveNatsCalloutConfig(settings: Settings): NatsCalloutConfig | null;
1312
+ export declare function resolveNatsCalloutConfig(settings: Settings): NatsCalloutConfig | null;
1217
1313
  /**
1218
1314
  * The PRIVILEGED control-plane NATS login (api/worker). Present only when BOTH a
1219
1315
  * user and password are set; otherwise null and the bus connects anonymously (local
1220
1316
  * dev / a NATS without auth_callout). When the callout plane is on, this is the
1221
1317
  * static account user permitted to request `agent.*.rpc`.
1222
1318
  */
1223
- interface NatsControlPlaneAuth {
1319
+ export interface NatsControlPlaneAuth {
1224
1320
  user: string;
1225
1321
  password: string;
1226
1322
  }
1227
- declare function resolveNatsControlPlaneAuth(settings: Settings): NatsControlPlaneAuth | null;
1228
-
1229
- export { AGENT_INSTRUCTIONS_CORE_PLACEHOLDER, type BillingAttributionV1, type CapabilityStateV1, CapabilityStateV1Schema, CapabilitySupportV1, type ConfiguredModel, type CredentialSourceV1, DEFAULT_AGENT_INSTRUCTIONS, type EntitlementsConfig, type IntegrationOAuthClientConfig, IntegrationOAuthClientConfigSchema, type McpServerConfig, type McpServerConnectionRef, McpServerConnectionRefSchema, type ModelCapabilitiesV1, ModelCapabilitiesV1Schema, type ModelDeploymentV1, type ModelExecutionLimitsV1, type ModelPricing, type ModelPricingScheduleV1, ModelProviderApi, type ModelUsageInput, type NatsCalloutConfig, type NatsControlPlaneAuth, type RegistryProvider, RegistryProviderKind, type ResolveTurnExecutionPolicyV1Input, type ResolvedModelProvider, SANDBOX_REQUIRED_ENV, type SandboxRequiredEnv, type Settings, type StartupRetryOptions, type StaticUsageLimitsConfig, type TemporalConnectionOptions, type TemporalTlsConnectionConfig, applyGitAuthPointerEnvironment, assertTurnExecutionPolicyMatchesConfigV1, builtinProviderId, calculateModelUsageCostMicros, canonicalizeConfiguredModelId, collectGitIdentityEnvironment, collectSandboxEnvironment, configuredAllowedModels, configuredAllowedReasoningEfforts, configuredEntitlements, configuredModelPricing, configuredModelPricingSchedules, configuredModels, configuredProviders, configuredStaticUsageLimits, contextInputBudgetTokens, dbSearchPath, defaultModelPricing, effectiveModalIdleTimeoutSeconds, environmentsEncryptionKeyBytes, firstPartyMcpBaseUrl, firstPartyMcpWorkspaceUrl, getSettings, hasGitCredentialRepositorySelection, hasGitHubRepositorySelection, parseExposedPorts, parseIntegrationsOauthClientsJson, parseMcpServers, parseModelPricingJson, parseModelProvidersJson, parseSandboxWarmRateJson, parseStaticEntitlementsJson, parseStaticUsageLimitsJson, policyProviderIdForModel, requiredSandboxEnvForBackend, resolveEnrollmentSigningSecret, resolveModelProvider, resolveNatsCalloutConfig, resolveNatsControlPlaneAuth, resolveProviderApiKey, resolveRelayTokenSecret, resolveStreamTokenSecret, resolveTurnExecutionPolicyV1, retryStartupDependency, sandboxEnvironmentVariableNames, sandboxLifecycleHookIds, sandboxPreparationProfiles, sandboxWarmRateMicrosPerSecond, selectModelPricing, settingsWithResolvedModelContext, stableSandboxEnvironmentForRun, startupRetryOptions, streamTokenDegraded, temporalConnectionOptions, withCodexCatalogProvider };
1323
+ export declare function resolveNatsControlPlaneAuth(settings: Settings): NatsControlPlaneAuth | null;
1324
+ export {};