@opengeni/config 2.0.1 → 2.0.2-canary.38789554071001

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
@@ -162,6 +162,7 @@ declare const SettingsSchema: z.ZodObject<{
162
162
  webBaseUrl: z.ZodOptional<z.ZodString>;
163
163
  agentReleasesBaseUrl: z.ZodDefault<z.ZodString>;
164
164
  agentStableVersion: z.ZodDefault<z.ZodString>;
165
+ desktopStableVersion: z.ZodOptional<z.ZodString>;
165
166
  agentBetaVersion: z.ZodOptional<z.ZodString>;
166
167
  agentAutoUpdate: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
167
168
  productAccessMode: z.ZodDefault<z.ZodEnum<{
@@ -359,6 +360,20 @@ declare const SettingsSchema: z.ZodObject<{
359
360
  site_files_delete: "site_files_delete";
360
361
  site_files_list: "site_files_list";
361
362
  site_files_upload: "site_files_upload";
363
+ site_hostname_check: "site_hostname_check";
364
+ site_publication_apply_fix: "site_publication_apply_fix";
365
+ site_publication_get: "site_publication_get";
366
+ site_publication_update: "site_publication_update";
367
+ site_sql_define_query: "site_sql_define_query";
368
+ site_sql_enable: "site_sql_enable";
369
+ site_sql_execute: "site_sql_execute";
370
+ site_sql_export: "site_sql_export";
371
+ site_sql_import: "site_sql_import";
372
+ site_sql_inspect: "site_sql_inspect";
373
+ site_sql_migrate: "site_sql_migrate";
374
+ site_sql_query: "site_sql_query";
375
+ site_sql_reset: "site_sql_reset";
376
+ site_sql_run: "site_sql_run";
362
377
  slack_bot_channel_history: "slack_bot_channel_history";
363
378
  slack_bot_delete_message: "slack_bot_delete_message";
364
379
  slack_bot_file_content: "slack_bot_file_content";
@@ -563,6 +578,20 @@ declare const SettingsSchema: z.ZodObject<{
563
578
  site_files_delete: "site_files_delete";
564
579
  site_files_list: "site_files_list";
565
580
  site_files_upload: "site_files_upload";
581
+ site_hostname_check: "site_hostname_check";
582
+ site_publication_apply_fix: "site_publication_apply_fix";
583
+ site_publication_get: "site_publication_get";
584
+ site_publication_update: "site_publication_update";
585
+ site_sql_define_query: "site_sql_define_query";
586
+ site_sql_enable: "site_sql_enable";
587
+ site_sql_execute: "site_sql_execute";
588
+ site_sql_export: "site_sql_export";
589
+ site_sql_import: "site_sql_import";
590
+ site_sql_inspect: "site_sql_inspect";
591
+ site_sql_migrate: "site_sql_migrate";
592
+ site_sql_query: "site_sql_query";
593
+ site_sql_reset: "site_sql_reset";
594
+ site_sql_run: "site_sql_run";
566
595
  slack_bot_channel_history: "slack_bot_channel_history";
567
596
  slack_bot_delete_message: "slack_bot_delete_message";
568
597
  slack_bot_file_content: "slack_bot_file_content";
@@ -763,6 +792,7 @@ declare const SettingsSchema: z.ZodObject<{
763
792
  codexConnectedAppsEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
764
793
  codexProductSku: z.ZodOptional<z.ZodString>;
765
794
  codexToolSearchEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
795
+ codexResponsesWebSocketEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
766
796
  lazyToolSearchEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
767
797
  codexFleetPolicyShadowEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
768
798
  subscriptionCoreShadowEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
@@ -1023,6 +1053,16 @@ declare const SettingsSchema: z.ZodObject<{
1023
1053
  shadow: "shadow";
1024
1054
  usage_only: "usage_only";
1025
1055
  }>>;
1056
+ sitesCloudflareStorageEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
1057
+ sitesGatewayInternalOrigin: z.ZodOptional<z.ZodString>;
1058
+ sitesSqlFreeStorageBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1059
+ sitesSqlFreeRowsReadPerMonth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1060
+ sitesSqlFreeRowsWrittenPerMonth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1061
+ sitesSqlFreeCallsPerMinutePerViewer: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1062
+ sitesSqlFreeCallsPerMinutePerSite: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1063
+ sitesSqlMaxRowsPerCall: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1064
+ sitesSqlMaxResponseBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1065
+ sitesSqlTimeoutMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1026
1066
  siteDataRecordBytesPerSite: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1027
1067
  siteDataMaxRecordBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1028
1068
  siteDataMaxCollectionsPerSite: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -1036,6 +1076,57 @@ declare const SettingsSchema: z.ZodObject<{
1036
1076
  siteDataSiteValidationMsPerMinute: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1037
1077
  siteDataWorkspaceValidationMsPerMinute: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1038
1078
  siteDataMaxRecordsPerCollection: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1079
+ sitesDomain: z.ZodOptional<z.ZodString>;
1080
+ sitesGatewaySecret: z.ZodOptional<z.ZodString>;
1081
+ sitesGatewaySecretPrevious: z.ZodOptional<z.ZodString>;
1082
+ sitesPublicEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
1083
+ sitesPublicAgentsEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
1084
+ sitesLoginOnly: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
1085
+ sitesForceNoindex: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
1086
+ sitesAbuseEmail: z.ZodOptional<z.ZodString>;
1087
+ sitesGuestAgentHumanCheck: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
1088
+ sitesFreeRequestsPerMinutePerVisitor: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1089
+ sitesFreeGuestWritesPerMinute: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1090
+ sitesFreeConversationsPerVisitorPerDay: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1091
+ sitesFreeConversationsPerSitePerDay: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1092
+ sitesFreeTurnsPerConversation: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1093
+ sitesFreeAgentMicrosPerConversation: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1094
+ sitesFreeAgentMicrosPerVisitorPerDay: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1095
+ sitesFreeAgentMicrosPerSitePerMonth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1096
+ sitesAgentMicrosPerSitePerMonth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1097
+ sitesAgentMicrosPerPersonPerDay: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1098
+ sitesGuestConversationsPerVisitorPerDay: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1099
+ sitesGuestConversationsPerSitePerDay: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1100
+ sitesGuestTurnsPerConversation: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1101
+ sitesGuestAgentMicrosPerConversation: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
1102
+ sitesAgentReservationMicrosPerTurn: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1103
+ sitesCreditsLimitMultiplier: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1104
+ sitesPlatformBillingMode: z.ZodDefault<z.ZodEnum<{
1105
+ credits: "credits";
1106
+ shadow: "shadow";
1107
+ usage_only: "usage_only";
1108
+ }>>;
1109
+ sitesPlatformOverageEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
1110
+ sitesPlatformAllowanceRequests: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1111
+ sitesPlatformAllowanceSqlRowsRead: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1112
+ sitesPlatformAllowanceSqlRowsWritten: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1113
+ sitesPlatformAllowanceStorageBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1114
+ sitesPlatformPriceMicrosPerMillionRequests: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1115
+ sitesPlatformPriceMicrosPerMillionSqlRowsRead: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1116
+ sitesPlatformPriceMicrosPerMillionSqlRowsWritten: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1117
+ sitesPlatformPriceMicrosPerGbMonth: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1118
+ sitesPlatformMonthlyLimitUsd: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1119
+ sitesPlatformAlertPercent: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1120
+ sitesReportsPerMinutePerVisitor: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1121
+ sitesViewerSessionIdleSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1122
+ sitesViewerSessionAbsoluteSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1123
+ sitesHostnameHoldDays: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1124
+ sitesCloudflareApiToken: z.ZodOptional<z.ZodString>;
1125
+ sitesCloudflareAccountId: z.ZodOptional<z.ZodString>;
1126
+ sitesCloudflareKvNamespaceId: z.ZodOptional<z.ZodString>;
1127
+ sitesCloudflareZoneId: z.ZodOptional<z.ZodString>;
1128
+ sitesHostMapTtlSeconds: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1129
+ sitesWebRiskApiKey: z.ZodOptional<z.ZodString>;
1039
1130
  documentEmbeddingCreditsActivatedAt: z.ZodOptional<z.ZodISODateTime>;
1040
1131
  documentEmbeddingRateMicrosPerMillionBytes: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
1041
1132
  documentCurationProvider: z.ZodDefault<z.ZodEnum<{
@@ -4517,6 +4608,13 @@ export declare function localAllowedOriginEntries(raw: string | undefined): stri
4517
4608
  * addresses that only sandboxes use (see `apps/api/src/http/local-browser-boundary.ts`).
4518
4609
  */
4519
4610
  export declare function localSandboxApiRouteAllowed(pathname: string): boolean;
4611
+ /**
4612
+ * Published Sites serve untrusted HTML, so their domain must not hold or sit
4613
+ * inside the console or API hosts: a Site could otherwise read or set their
4614
+ * cookies. A separate registrable domain is required (see
4615
+ * docs/published-sites.md); this catches the nesting a host check can see.
4616
+ */
4617
+ export declare function validateSitesDomain(settings: Pick<Settings, "sitesDomain" | "publicBaseUrl" | "webBaseUrl">): void;
4520
4618
  /** Validate one fully resolved, secret-bearing executable catalog. */
4521
4619
  export declare function validateModelCatalogSettings(settings: Settings, source?: NodeJS.ProcessEnv): ConfiguredModel[];
4522
4620
  /**
package/dist/index.js CHANGED
@@ -489,6 +489,7 @@ import {
489
489
  ReasoningEffort,
490
490
  FIRST_PARTY_MCP_TOOL_NAMES,
491
491
  FirstPartyMcpToolName,
492
+ normalizeSitesDomain,
492
493
  OpenGeniSlackBotDisplayName,
493
494
  SandboxBackend,
494
495
  SessionMcpApprovalPolicy,
@@ -1112,6 +1113,9 @@ var SettingsSchema = z5.object({
1112
1113
  // Versioned agent releases are immutable; changing this setting promotes or
1113
1114
  // rolls back the stable channel without moving or deleting a provider tag.
1114
1115
  agentStableVersion: z5.string().regex(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u).default("0.1.54"),
1116
+ // Optional pin for the desktop app served by /desktop/latest/*. When unset,
1117
+ // the newest desktop-v release on the agent release repository is served.
1118
+ desktopStableVersion: z5.string().regex(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u).optional(),
1115
1119
  // Optional independent beta-channel pointer. When unset, the beta update
1116
1120
  // manifest route is unavailable rather than silently serving stable.
1117
1121
  agentBetaVersion: z5.string().regex(/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u).optional(),
@@ -1519,6 +1523,11 @@ var SettingsSchema = z5.object({
1519
1523
  // emergency compatibility diagnosis.
1520
1524
  // OPENGENI_CODEX_TOOL_SEARCH_ENABLED
1521
1525
  codexToolSearchEnabled: EnvBoolean.default(true),
1526
+ // Carry Codex subscription model requests over the backend's Responses
1527
+ // WebSocket (one warm connection per conversation) instead of a new HTTP
1528
+ // request per step. Requests the socket cannot carry fall back to HTTP.
1529
+ // OPENGENI_CODEX_RESPONSES_WEBSOCKET_ENABLED
1530
+ codexResponsesWebSocketEnabled: EnvBoolean.default(true),
1522
1531
  // Provider-neutral progressive disclosure for direct OpenAI/Azure native
1523
1532
  // client search and ordinary-function generic dispatch. Kept separate from
1524
1533
  // the Codex rollout so an emergency Codex opt-out cannot disable every model.
@@ -2091,6 +2100,30 @@ var SettingsSchema = z5.object({
2091
2100
  documentEmbeddingApiKey: z5.string().optional(),
2092
2101
  documentEmbeddingBaseUrl: z5.string().url().optional(),
2093
2102
  documentEmbeddingBillingMode: z5.enum(["usage_only", "shadow", "credits"]).default("usage_only"),
2103
+ // Site SQL: optional per-Site Cloudflare storage (one SQLite Durable Object
2104
+ // per Site, docs/site-data.md). Off unless enabled here, the gateway's
2105
+ // internal origin is set and the published Sites gateway secret is
2106
+ // configured; the API signs its calls to the gateway with that secret.
2107
+ // Usage is recorded in the usage ledger only. Free-profile defaults are strict.
2108
+ sitesCloudflareStorageEnabled: EnvBoolean.default(false),
2109
+ sitesGatewayInternalOrigin: z5.string().url().refine((value) => {
2110
+ const url = new URL(value);
2111
+ if (url.pathname !== "/" || url.search || url.hash || url.username || url.password)
2112
+ return false;
2113
+ if (url.protocol === "https:") return true;
2114
+ return url.protocol === "http:" && ["127.0.0.1", "localhost", "[::1]"].includes(url.hostname);
2115
+ }, "must be an https origin (http only on loopback)").optional(),
2116
+ // Site SQL storage per Site; defaults to the 5 GiB hard ceiling.
2117
+ sitesSqlFreeStorageBytes: z5.coerce.number().int().positive().default(5 * 1024 * 1024 * 1024),
2118
+ // Optional per-Site monthly row quotas; unset means none (the platform
2119
+ // meters rows per workspace instead; rate and per-call caps still apply).
2120
+ sitesSqlFreeRowsReadPerMonth: z5.coerce.number().int().positive().optional(),
2121
+ sitesSqlFreeRowsWrittenPerMonth: z5.coerce.number().int().positive().optional(),
2122
+ sitesSqlFreeCallsPerMinutePerViewer: z5.coerce.number().int().positive().default(60),
2123
+ sitesSqlFreeCallsPerMinutePerSite: z5.coerce.number().int().positive().default(600),
2124
+ sitesSqlMaxRowsPerCall: z5.coerce.number().int().min(1).max(5e3).default(1e3),
2125
+ sitesSqlMaxResponseBytes: z5.coerce.number().int().min(1024).max(4 * 1024 * 1024).default(1024 * 1024),
2126
+ sitesSqlTimeoutMs: z5.coerce.number().int().min(1e3).max(6e4).default(15e3),
2094
2127
  // Site Data quotas and write rate limits. Usage is recorded in the
2095
2128
  // usage ledger only; shadow and paid modes are a later rollout step.
2096
2129
  siteDataRecordBytesPerSite: z5.coerce.number().int().positive().default(100 * 1024 * 1024),
@@ -2108,6 +2141,87 @@ var SettingsSchema = z5.object({
2108
2141
  // Schema-validation time all of a workspace's Sites may spend per minute.
2109
2142
  siteDataWorkspaceValidationMsPerMinute: z5.coerce.number().int().positive().default(2e4),
2110
2143
  siteDataMaxRecordsPerCollection: z5.coerce.number().int().positive().default(1e5),
2144
+ // Published Sites (docs/design/published-sites-2026-10-14.md). Publishing is
2145
+ // off unless sitesDomain names the Sites domain; the site-runtime API also
2146
+ // needs the gateway secret. Defaults are strict.
2147
+ sitesDomain: z5.string().trim().min(3).max(200).optional(),
2148
+ sitesGatewaySecret: z5.string().min(32).optional(),
2149
+ // Accepted during rotation only; remove once the gateway signs with the new secret.
2150
+ sitesGatewaySecretPrevious: z5.string().min(32).optional(),
2151
+ sitesPublicEnabled: EnvBoolean.default(true),
2152
+ sitesPublicAgentsEnabled: EnvBoolean.default(true),
2153
+ // Login-only deployments (staging): public means any signed-in user; no guests.
2154
+ sitesLoginOnly: EnvBoolean.default(false),
2155
+ sitesForceNoindex: EnvBoolean.default(false),
2156
+ // Defaults to abuse@<sites domain>.
2157
+ sitesAbuseEmail: z5.string().email().optional(),
2158
+ // Guests start embedded agents only after the gateway verified a bot challenge.
2159
+ sitesGuestAgentHumanCheck: EnvBoolean.default(false),
2160
+ // Rate brakes of every Site limit profile (all access modes).
2161
+ sitesFreeRequestsPerMinutePerVisitor: z5.coerce.number().int().positive().default(120),
2162
+ sitesFreeGuestWritesPerMinute: z5.coerce.number().int().nonnegative().default(30),
2163
+ // Deprecated (the former free profile): fallbacks for the public and guest
2164
+ // settings below when those are unset.
2165
+ sitesFreeConversationsPerVisitorPerDay: z5.coerce.number().int().nonnegative().optional(),
2166
+ sitesFreeConversationsPerSitePerDay: z5.coerce.number().int().nonnegative().optional(),
2167
+ sitesFreeTurnsPerConversation: z5.coerce.number().int().nonnegative().optional(),
2168
+ sitesFreeAgentMicrosPerConversation: z5.coerce.number().int().nonnegative().optional(),
2169
+ sitesFreeAgentMicrosPerVisitorPerDay: z5.coerce.number().int().nonnegative().optional(),
2170
+ sitesFreeAgentMicrosPerSitePerMonth: z5.coerce.number().int().nonnegative().optional(),
2171
+ // Standard model-spend limits (micro-USD) for people outside the workspace
2172
+ // (invited and public alike). Members are never limited by Site limits:
2173
+ // they use the workspace's normal session limits. Unset: the deprecated
2174
+ // free setting, else $10 per Site per month and no per-person limit.
2175
+ sitesAgentMicrosPerSitePerMonth: z5.coerce.number().int().nonnegative().optional(),
2176
+ sitesAgentMicrosPerPersonPerDay: z5.coerce.number().int().nonnegative().optional(),
2177
+ // Internal guards for anonymous public visitors (not shown to Site owners). Unset:
2178
+ // the deprecated free setting, else 20, 500, 50 and $1.
2179
+ sitesGuestConversationsPerVisitorPerDay: z5.coerce.number().int().nonnegative().optional(),
2180
+ sitesGuestConversationsPerSitePerDay: z5.coerce.number().int().nonnegative().optional(),
2181
+ sitesGuestTurnsPerConversation: z5.coerce.number().int().nonnegative().optional(),
2182
+ sitesGuestAgentMicrosPerConversation: z5.coerce.number().int().nonnegative().optional(),
2183
+ // What each agent turn of someone outside the workspace holds against the
2184
+ // Site's spend limits while it runs (micro-USD; actual spend replaces it
2185
+ // when settled), capped by the conversation's own cap and what is left.
2186
+ sitesAgentReservationMicrosPerTurn: z5.coerce.number().int().min(1e3).default(25e4),
2187
+ // The credits profile multiplies the standard spend caps and guest guards.
2188
+ sitesCreditsLimitMultiplier: z5.coerce.number().int().min(1).max(1e3).default(10),
2189
+ // Site platform usage (gateway requests, Site SQL rows and storage, Site
2190
+ // Data storage), metered apart from model spend. usage_only records it;
2191
+ // shadow computes the charge without charging; credits charges usage above
2192
+ // the per-workspace monthly allowance.
2193
+ sitesPlatformBillingMode: z5.enum(["usage_only", "shadow", "credits"]).default("usage_only"),
2194
+ // Credits mode: false refuses usage past the allowance instead of charging it.
2195
+ sitesPlatformOverageEnabled: EnvBoolean.default(true),
2196
+ sitesPlatformAllowanceRequests: z5.coerce.number().int().nonnegative().default(1e6),
2197
+ sitesPlatformAllowanceSqlRowsRead: z5.coerce.number().int().nonnegative().default(1e7),
2198
+ sitesPlatformAllowanceSqlRowsWritten: z5.coerce.number().int().nonnegative().default(1e5),
2199
+ sitesPlatformAllowanceStorageBytes: z5.coerce.number().int().nonnegative().default(1e9),
2200
+ // Unit prices in micro-USD: twice the Cloudflare list price (Workers
2201
+ // requests, Durable Object SQLite rows and storage), covering host lookups,
2202
+ // Durable Object requests and duration, and API work.
2203
+ sitesPlatformPriceMicrosPerMillionRequests: z5.coerce.number().int().nonnegative().default(6e5),
2204
+ sitesPlatformPriceMicrosPerMillionSqlRowsRead: z5.coerce.number().int().nonnegative().default(2e3),
2205
+ sitesPlatformPriceMicrosPerMillionSqlRowsWritten: z5.coerce.number().int().nonnegative().default(2e6),
2206
+ sitesPlatformPriceMicrosPerGbMonth: z5.coerce.number().int().nonnegative().default(4e5),
2207
+ // The Opengeni-wide monthly brake: estimated USD cost of all workspaces'
2208
+ // platform usage at the prices above. 0 turns the brake off.
2209
+ sitesPlatformMonthlyLimitUsd: z5.coerce.number().nonnegative().max(1e8).default(1e3),
2210
+ sitesPlatformAlertPercent: z5.coerce.number().int().min(1).max(100).default(80),
2211
+ sitesReportsPerMinutePerVisitor: z5.coerce.number().int().positive().default(5),
2212
+ sitesViewerSessionIdleSeconds: z5.coerce.number().int().min(60).default(12 * 60 * 60),
2213
+ sitesViewerSessionAbsoluteSeconds: z5.coerce.number().int().min(60).max(30 * 24 * 60 * 60).default(7 * 24 * 60 * 60),
2214
+ // A released hostname stays held for its workspace at least this long.
2215
+ sitesHostnameHoldDays: z5.coerce.number().int().min(30).default(30),
2216
+ // Optional Cloudflare edge sync: KV host map and cache purge. All unset: no-op.
2217
+ sitesCloudflareApiToken: z5.string().min(1).optional(),
2218
+ sitesCloudflareAccountId: z5.string().min(1).optional(),
2219
+ sitesCloudflareKvNamespaceId: z5.string().min(1).optional(),
2220
+ sitesCloudflareZoneId: z5.string().min(1).optional(),
2221
+ // KV expiry of host-map entries; bounds staleness if a sync write is missed.
2222
+ sitesHostMapTtlSeconds: z5.coerce.number().int().min(60).max(86400).default(300),
2223
+ // Google Web Risk scanning of URLs in Site HTML on publish; off without a key.
2224
+ sitesWebRiskApiKey: z5.string().min(1).optional(),
2111
2225
  // Explicit commercial cutover. Existing queued revisions remain unpriced;
2112
2226
  // only jobs created at or after this instant may enter the paid rail.
2113
2227
  documentEmbeddingCreditsActivatedAt: z5.iso.datetime().optional(),
@@ -4142,6 +4256,7 @@ function getSettings(source = process.env) {
4142
4256
  agentReleasesBaseUrl: optional("OPENGENI_AGENT_RELEASES_BASE_URL"),
4143
4257
  agentStableVersion: optional("OPENGENI_AGENT_STABLE_VERSION"),
4144
4258
  agentBetaVersion: optional("OPENGENI_AGENT_BETA_VERSION"),
4259
+ desktopStableVersion: optional("OPENGENI_DESKTOP_STABLE_VERSION"),
4145
4260
  agentAutoUpdate: optional("OPENGENI_AGENT_AUTO_UPDATE"),
4146
4261
  productAccessMode: optional("OPENGENI_PRODUCT_ACCESS_MODE"),
4147
4262
  billingMode: optional("OPENGENI_BILLING_MODE"),
@@ -4327,6 +4442,7 @@ function getSettings(source = process.env) {
4327
4442
  modelStreamProgressTimeoutMs: optional("OPENGENI_MODEL_STREAM_PROGRESS_TIMEOUT_MS"),
4328
4443
  codexConnectedAppsEnabled: optional("OPENGENI_CODEX_CONNECTED_APPS_ENABLED"),
4329
4444
  codexToolSearchEnabled: optional("OPENGENI_CODEX_TOOL_SEARCH_ENABLED"),
4445
+ codexResponsesWebSocketEnabled: optional("OPENGENI_CODEX_RESPONSES_WEBSOCKET_ENABLED"),
4330
4446
  lazyToolSearchEnabled: optional("OPENGENI_LAZY_TOOL_SEARCH_ENABLED"),
4331
4447
  codexFleetPolicyShadowEnabled: optional("OPENGENI_CODEX_FLEET_POLICY_SHADOW_ENABLED"),
4332
4448
  subscriptionCoreShadowEnabled: optional("OPENGENI_SUBSCRIPTION_CORE_SHADOW_ENABLED"),
@@ -4531,6 +4647,20 @@ function getSettings(source = process.env) {
4531
4647
  documentEmbeddingApiKey: optional("OPENGENI_DOCUMENT_EMBEDDING_API_KEY"),
4532
4648
  documentEmbeddingBaseUrl: optional("OPENGENI_DOCUMENT_EMBEDDING_BASE_URL"),
4533
4649
  documentEmbeddingBillingMode: optional("OPENGENI_DOCUMENT_EMBEDDING_BILLING_MODE"),
4650
+ sitesCloudflareStorageEnabled: optional("OPENGENI_SITES_CLOUDFLARE_STORAGE_ENABLED"),
4651
+ sitesGatewayInternalOrigin: optional("OPENGENI_SITES_GATEWAY_INTERNAL_ORIGIN"),
4652
+ sitesSqlFreeStorageBytes: optional("OPENGENI_SITES_SQL_FREE_STORAGE_BYTES"),
4653
+ sitesSqlFreeRowsReadPerMonth: optional("OPENGENI_SITES_SQL_FREE_ROWS_READ_PER_MONTH"),
4654
+ sitesSqlFreeRowsWrittenPerMonth: optional("OPENGENI_SITES_SQL_FREE_ROWS_WRITTEN_PER_MONTH"),
4655
+ sitesSqlFreeCallsPerMinutePerViewer: optional(
4656
+ "OPENGENI_SITES_SQL_FREE_CALLS_PER_MINUTE_PER_VIEWER"
4657
+ ),
4658
+ sitesSqlFreeCallsPerMinutePerSite: optional(
4659
+ "OPENGENI_SITES_SQL_FREE_CALLS_PER_MINUTE_PER_SITE"
4660
+ ),
4661
+ sitesSqlMaxRowsPerCall: optional("OPENGENI_SITES_SQL_MAX_ROWS_PER_CALL"),
4662
+ sitesSqlMaxResponseBytes: optional("OPENGENI_SITES_SQL_MAX_RESPONSE_BYTES"),
4663
+ sitesSqlTimeoutMs: optional("OPENGENI_SITES_SQL_TIMEOUT_MS"),
4534
4664
  siteDataRecordBytesPerSite: optional("OPENGENI_SITE_DATA_RECORD_BYTES_PER_SITE"),
4535
4665
  siteDataMaxRecordBytes: optional("OPENGENI_SITE_DATA_MAX_RECORD_BYTES"),
4536
4666
  siteDataMaxCollectionsPerSite: optional("OPENGENI_SITE_DATA_MAX_COLLECTIONS_PER_SITE"),
@@ -4546,6 +4676,83 @@ function getSettings(source = process.env) {
4546
4676
  "OPENGENI_SITE_DATA_WORKSPACE_VALIDATION_MS_PER_MINUTE"
4547
4677
  ),
4548
4678
  siteDataMaxRecordsPerCollection: optional("OPENGENI_SITE_DATA_MAX_RECORDS_PER_COLLECTION"),
4679
+ sitesDomain: optional("OPENGENI_SITES_DOMAIN"),
4680
+ sitesGatewaySecret: optional("OPENGENI_SITES_GATEWAY_SECRET"),
4681
+ sitesGatewaySecretPrevious: optional("OPENGENI_SITES_GATEWAY_SECRET_PREVIOUS"),
4682
+ sitesPublicEnabled: optional("OPENGENI_SITES_PUBLIC_ENABLED"),
4683
+ sitesPublicAgentsEnabled: optional("OPENGENI_SITES_PUBLIC_AGENTS_ENABLED"),
4684
+ sitesLoginOnly: optional("OPENGENI_SITES_LOGIN_ONLY"),
4685
+ sitesForceNoindex: optional("OPENGENI_SITES_FORCE_NOINDEX"),
4686
+ sitesAbuseEmail: optional("OPENGENI_SITES_ABUSE_EMAIL"),
4687
+ sitesGuestAgentHumanCheck: optional("OPENGENI_SITES_GUEST_AGENT_HUMAN_CHECK"),
4688
+ sitesFreeRequestsPerMinutePerVisitor: optional(
4689
+ "OPENGENI_SITES_FREE_REQUESTS_PER_MINUTE_PER_VISITOR"
4690
+ ),
4691
+ sitesFreeGuestWritesPerMinute: optional("OPENGENI_SITES_FREE_GUEST_WRITES_PER_MINUTE"),
4692
+ sitesFreeConversationsPerVisitorPerDay: optional(
4693
+ "OPENGENI_SITES_FREE_CONVERSATIONS_PER_VISITOR_PER_DAY"
4694
+ ),
4695
+ sitesFreeConversationsPerSitePerDay: optional(
4696
+ "OPENGENI_SITES_FREE_CONVERSATIONS_PER_SITE_PER_DAY"
4697
+ ),
4698
+ sitesFreeTurnsPerConversation: optional("OPENGENI_SITES_FREE_TURNS_PER_CONVERSATION"),
4699
+ sitesFreeAgentMicrosPerConversation: optional(
4700
+ "OPENGENI_SITES_FREE_AGENT_MICROS_PER_CONVERSATION"
4701
+ ),
4702
+ sitesFreeAgentMicrosPerVisitorPerDay: optional(
4703
+ "OPENGENI_SITES_FREE_AGENT_MICROS_PER_VISITOR_PER_DAY"
4704
+ ),
4705
+ sitesFreeAgentMicrosPerSitePerMonth: optional(
4706
+ "OPENGENI_SITES_FREE_AGENT_MICROS_PER_SITE_PER_MONTH"
4707
+ ),
4708
+ sitesCreditsLimitMultiplier: optional("OPENGENI_SITES_CREDITS_LIMIT_MULTIPLIER"),
4709
+ sitesAgentReservationMicrosPerTurn: optional(
4710
+ "OPENGENI_SITES_AGENT_RESERVATION_MICROS_PER_TURN"
4711
+ ),
4712
+ sitesAgentMicrosPerSitePerMonth: optional("OPENGENI_SITES_AGENT_MICROS_PER_SITE_PER_MONTH"),
4713
+ sitesAgentMicrosPerPersonPerDay: optional("OPENGENI_SITES_AGENT_MICROS_PER_PERSON_PER_DAY"),
4714
+ sitesGuestConversationsPerVisitorPerDay: optional(
4715
+ "OPENGENI_SITES_GUEST_CONVERSATIONS_PER_VISITOR_PER_DAY"
4716
+ ),
4717
+ sitesGuestConversationsPerSitePerDay: optional(
4718
+ "OPENGENI_SITES_GUEST_CONVERSATIONS_PER_SITE_PER_DAY"
4719
+ ),
4720
+ sitesGuestTurnsPerConversation: optional("OPENGENI_SITES_GUEST_TURNS_PER_CONVERSATION"),
4721
+ sitesGuestAgentMicrosPerConversation: optional(
4722
+ "OPENGENI_SITES_GUEST_AGENT_MICROS_PER_CONVERSATION"
4723
+ ),
4724
+ sitesPlatformBillingMode: optional("OPENGENI_SITES_PLATFORM_BILLING_MODE"),
4725
+ sitesPlatformOverageEnabled: optional("OPENGENI_SITES_PLATFORM_OVERAGE_ENABLED"),
4726
+ sitesPlatformAllowanceRequests: optional("OPENGENI_SITES_PLATFORM_ALLOWANCE_REQUESTS"),
4727
+ sitesPlatformAllowanceSqlRowsRead: optional("OPENGENI_SITES_PLATFORM_ALLOWANCE_SQL_ROWS_READ"),
4728
+ sitesPlatformAllowanceSqlRowsWritten: optional(
4729
+ "OPENGENI_SITES_PLATFORM_ALLOWANCE_SQL_ROWS_WRITTEN"
4730
+ ),
4731
+ sitesPlatformAllowanceStorageBytes: optional("OPENGENI_SITES_PLATFORM_ALLOWANCE_STORAGE_BYTES"),
4732
+ sitesPlatformPriceMicrosPerMillionRequests: optional(
4733
+ "OPENGENI_SITES_PLATFORM_PRICE_MICROS_PER_MILLION_REQUESTS"
4734
+ ),
4735
+ sitesPlatformPriceMicrosPerMillionSqlRowsRead: optional(
4736
+ "OPENGENI_SITES_PLATFORM_PRICE_MICROS_PER_MILLION_SQL_ROWS_READ"
4737
+ ),
4738
+ sitesPlatformPriceMicrosPerMillionSqlRowsWritten: optional(
4739
+ "OPENGENI_SITES_PLATFORM_PRICE_MICROS_PER_MILLION_SQL_ROWS_WRITTEN"
4740
+ ),
4741
+ sitesPlatformPriceMicrosPerGbMonth: optional(
4742
+ "OPENGENI_SITES_PLATFORM_PRICE_MICROS_PER_GB_MONTH"
4743
+ ),
4744
+ sitesPlatformMonthlyLimitUsd: optional("OPENGENI_SITES_PLATFORM_MONTHLY_LIMIT_USD"),
4745
+ sitesPlatformAlertPercent: optional("OPENGENI_SITES_PLATFORM_ALERT_PERCENT"),
4746
+ sitesReportsPerMinutePerVisitor: optional("OPENGENI_SITES_REPORTS_PER_MINUTE_PER_VISITOR"),
4747
+ sitesViewerSessionIdleSeconds: optional("OPENGENI_SITES_VIEWER_SESSION_IDLE_SECONDS"),
4748
+ sitesViewerSessionAbsoluteSeconds: optional("OPENGENI_SITES_VIEWER_SESSION_ABSOLUTE_SECONDS"),
4749
+ sitesHostnameHoldDays: optional("OPENGENI_SITES_HOSTNAME_HOLD_DAYS"),
4750
+ sitesCloudflareApiToken: optional("OPENGENI_SITES_CLOUDFLARE_API_TOKEN"),
4751
+ sitesCloudflareAccountId: optional("OPENGENI_SITES_CLOUDFLARE_ACCOUNT_ID"),
4752
+ sitesCloudflareKvNamespaceId: optional("OPENGENI_SITES_CLOUDFLARE_KV_NAMESPACE_ID"),
4753
+ sitesCloudflareZoneId: optional("OPENGENI_SITES_CLOUDFLARE_ZONE_ID"),
4754
+ sitesHostMapTtlSeconds: optional("OPENGENI_SITES_HOST_MAP_TTL_SECONDS"),
4755
+ sitesWebRiskApiKey: optional("OPENGENI_SITES_WEB_RISK_API_KEY"),
4549
4756
  documentEmbeddingCreditsActivatedAt: optional(
4550
4757
  "OPENGENI_DOCUMENT_EMBEDDING_CREDITS_ACTIVATED_AT"
4551
4758
  ),
@@ -7650,9 +7857,31 @@ var LOCAL_SANDBOX_API_ROUTES = [
7650
7857
  function localSandboxApiRouteAllowed(pathname) {
7651
7858
  return LOCAL_SANDBOX_API_ROUTES.some((route) => route.test(pathname));
7652
7859
  }
7860
+ function validateSitesDomain(settings) {
7861
+ if (settings.sitesDomain === void 0) return;
7862
+ let domain;
7863
+ try {
7864
+ domain = normalizeSitesDomain(settings.sitesDomain);
7865
+ } catch {
7866
+ throw new Error("OPENGENI_SITES_DOMAIN must be a domain name such as sites.example.com");
7867
+ }
7868
+ const hosts = [
7869
+ ["OPENGENI_PUBLIC_BASE_URL", settings.publicBaseUrl],
7870
+ ["OPENGENI_WEB_BASE_URL", settings.webBaseUrl]
7871
+ ];
7872
+ for (const [name, url] of hosts) {
7873
+ if (!url) continue;
7874
+ const host = new URL(url).hostname.toLowerCase().replace(/\.$/u, "");
7875
+ if (host === domain || host.endsWith(`.${domain}`) || domain.endsWith(`.${host}`))
7876
+ throw new Error(
7877
+ `OPENGENI_SITES_DOMAIN (${domain}) must be a separate domain from the console and API: ${name} uses ${host}`
7878
+ );
7879
+ }
7880
+ }
7653
7881
  function validateSettings(settings, source = process.env) {
7654
7882
  temporalConnectionOptions(settings);
7655
7883
  localAllowedOriginEntries(settings.localAllowedOrigins);
7884
+ validateSitesDomain(settings);
7656
7885
  if (settings.organizationUserSetupEmailTokenTransport === "query" && !settings.organizationUserSetupQueryEdgeSanitizationConfirmed) {
7657
7886
  throw new Error(
7658
7887
  "OPENGENI_ORGANIZATION_USER_SETUP_QUERY_EDGE_SANITIZATION_CONFIRMED=true is required when OPENGENI_ORGANIZATION_USER_SETUP_EMAIL_TOKEN_TRANSPORT=query"
@@ -8842,6 +9071,7 @@ export {
8842
9071
  unpricedVoiceInputProviders,
8843
9072
  usableJevApiKey,
8844
9073
  validateModelCatalogSettings,
9074
+ validateSitesDomain,
8845
9075
  voiceInputCreditBillingActive,
8846
9076
  voiceInputDeploymentConfigured,
8847
9077
  voiceInputModelReportsDurationOnly,