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