@opengeni/config 0.7.22 → 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 +8 -0
- package/dist/index.js +32 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +52 -6
package/dist/index.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ 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>;
|
|
129
130
|
googleDriveClientId: z.ZodOptional<z.ZodString>;
|
|
130
131
|
googleDriveClientSecret: z.ZodOptional<z.ZodString>;
|
|
131
132
|
maxNestedAgentDepth: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
@@ -931,6 +932,13 @@ export declare const SANDBOX_REQUIRED_ENV: Record<z.infer<typeof SandboxBackend>
|
|
|
931
932
|
/** The required OPENGENI_* env var names for a backend (for the deployment manifest). */
|
|
932
933
|
export declare function requiredSandboxEnvForBackend(backend: z.infer<typeof SandboxBackend>): string[];
|
|
933
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;
|
|
934
942
|
/**
|
|
935
943
|
* The Modal sandbox idle timeout (seconds) the provider actually passes as
|
|
936
944
|
* idleTimeoutMs (sandbox-file-persistence). When the operator did not pin
|
package/dist/index.js
CHANGED
|
@@ -217,6 +217,7 @@ var SettingsSchema = z.object({
|
|
|
217
217
|
integrationsOauthClientsJson: z.string().default("{}"),
|
|
218
218
|
slackClientId: z.string().optional(),
|
|
219
219
|
slackClientSecret: z.string().optional(),
|
|
220
|
+
slackSigningSecret: z.string().optional(),
|
|
220
221
|
googleDriveClientId: z.string().optional(),
|
|
221
222
|
googleDriveClientSecret: z.string().optional(),
|
|
222
223
|
// Undefined is meaningful: the migration boundary persists the product
|
|
@@ -273,6 +274,9 @@ var SettingsSchema = z.object({
|
|
|
273
274
|
apiPort: z.coerce.number().int().positive().default(8e3),
|
|
274
275
|
workerHttpPort: z.coerce.number().int().positive().default(8001),
|
|
275
276
|
opengeniMcpUrl: z.string().url().optional(),
|
|
277
|
+
// Origins allowed to send browser cookies cross-origin. Other origins may
|
|
278
|
+
// call the public API with bearer credentials, but never receive credentialed
|
|
279
|
+
// CORS responses.
|
|
276
280
|
corsAllowOriginRegex: z.string().default(String.raw`^https?://(localhost|127\.0\.0\.1)(:\d+)?$`),
|
|
277
281
|
openaiProvider: z.enum(["openai", "azure"]).default("openai"),
|
|
278
282
|
openaiApiKey: z.string().optional(),
|
|
@@ -870,7 +874,11 @@ function resolveVoiceInputProviderRegistry(settings) {
|
|
|
870
874
|
}
|
|
871
875
|
if (id === "codex-subscription") {
|
|
872
876
|
if (!settings.codexSubscriptionEnabled) continue;
|
|
873
|
-
providers.push({
|
|
877
|
+
providers.push({
|
|
878
|
+
id: "codex-subscription",
|
|
879
|
+
kind: "codex-subscription",
|
|
880
|
+
experimental: true
|
|
881
|
+
});
|
|
874
882
|
}
|
|
875
883
|
}
|
|
876
884
|
return providers;
|
|
@@ -1235,6 +1243,7 @@ function getSettings() {
|
|
|
1235
1243
|
integrationsOauthClientsJson: optional("OPENGENI_INTEGRATIONS_OAUTH_CLIENTS_JSON"),
|
|
1236
1244
|
slackClientId: optional("OPENGENI_SLACK_CLIENT_ID"),
|
|
1237
1245
|
slackClientSecret: optional("OPENGENI_SLACK_CLIENT_SECRET"),
|
|
1246
|
+
slackSigningSecret: optional("OPENGENI_SLACK_SIGNING_SECRET"),
|
|
1238
1247
|
googleDriveClientId: optional("OPENGENI_GOOGLE_DRIVE_CLIENT_ID"),
|
|
1239
1248
|
googleDriveClientSecret: optional("OPENGENI_GOOGLE_DRIVE_CLIENT_SECRET"),
|
|
1240
1249
|
maxNestedAgentDepth: optional("OPENGENI_MAX_NESTED_AGENT_DEPTH"),
|
|
@@ -1460,6 +1469,12 @@ function getSettings() {
|
|
|
1460
1469
|
validateSettings(settings);
|
|
1461
1470
|
return settings;
|
|
1462
1471
|
}
|
|
1472
|
+
var LOCAL_FIRST_PARTY_DELEGATION_SECRET = "opengeni-local-first-party-delegation-secret-v1";
|
|
1473
|
+
function resolveFirstPartyDelegationSecret(settings) {
|
|
1474
|
+
const explicit = settings.delegationSecret?.trim();
|
|
1475
|
+
if (explicit) return explicit;
|
|
1476
|
+
return settings.productAccessMode === "local" && (settings.environment === "local" || settings.environment === "test") ? LOCAL_FIRST_PARTY_DELEGATION_SECRET : void 0;
|
|
1477
|
+
}
|
|
1463
1478
|
function effectiveModalIdleTimeoutSeconds(settings) {
|
|
1464
1479
|
return settings.modalIdleTimeoutSeconds ?? settings.modalTimeoutSeconds;
|
|
1465
1480
|
}
|
|
@@ -1913,7 +1928,10 @@ function withCodexCatalogProvider(settings) {
|
|
|
1913
1928
|
};
|
|
1914
1929
|
})
|
|
1915
1930
|
};
|
|
1916
|
-
return {
|
|
1931
|
+
return {
|
|
1932
|
+
...settings,
|
|
1933
|
+
modelProvidersJson: JSON.stringify([...providers, provider])
|
|
1934
|
+
};
|
|
1917
1935
|
}
|
|
1918
1936
|
function policyProviderIdForModel(settings, modelId) {
|
|
1919
1937
|
const canonicalModelId = canonicalizeConfiguredModelId(settings, modelId);
|
|
@@ -2048,7 +2066,9 @@ function configuredModels(settings) {
|
|
|
2048
2066
|
capabilities,
|
|
2049
2067
|
...pricingSchedules[model.id] === void 0 ? {} : { pricing: pricingSchedules[model.id] },
|
|
2050
2068
|
...model.contextWindowTokens === void 0 ? {} : { contextWindowTokens: model.contextWindowTokens },
|
|
2051
|
-
...model.effectiveContextWindowTokens === void 0 ? {} : {
|
|
2069
|
+
...model.effectiveContextWindowTokens === void 0 ? {} : {
|
|
2070
|
+
effectiveContextWindowTokens: model.effectiveContextWindowTokens
|
|
2071
|
+
},
|
|
2052
2072
|
...model.autoCompactTokenLimit === void 0 ? {} : { autoCompactTokenLimit: model.autoCompactTokenLimit },
|
|
2053
2073
|
...model.toolOutputTruncationTokens === void 0 ? {} : { toolOutputTruncationTokens: model.toolOutputTruncationTokens },
|
|
2054
2074
|
reasoningEffort: capabilities.reasoning.runnable,
|
|
@@ -2497,7 +2517,9 @@ function parseMcpServers(raw) {
|
|
|
2497
2517
|
return parsed;
|
|
2498
2518
|
} catch (error) {
|
|
2499
2519
|
const message = error instanceof Error ? error.message : String(error);
|
|
2500
|
-
throw new Error(`OPENGENI_MCP_SERVERS must be a JSON array: ${message}`, {
|
|
2520
|
+
throw new Error(`OPENGENI_MCP_SERVERS must be a JSON array: ${message}`, {
|
|
2521
|
+
cause: error
|
|
2522
|
+
});
|
|
2501
2523
|
}
|
|
2502
2524
|
}
|
|
2503
2525
|
function parseModelPricingJson(raw) {
|
|
@@ -2809,6 +2831,11 @@ function validateSettings(settings) {
|
|
|
2809
2831
|
);
|
|
2810
2832
|
}
|
|
2811
2833
|
if (settings.slackClientId) {
|
|
2834
|
+
if (!settings.slackSigningSecret) {
|
|
2835
|
+
throw new Error(
|
|
2836
|
+
"OPENGENI_SLACK_SIGNING_SECRET is required when the OpenGeni Slack app is configured"
|
|
2837
|
+
);
|
|
2838
|
+
}
|
|
2812
2839
|
if (!settings.publicBaseUrl) {
|
|
2813
2840
|
throw new Error(
|
|
2814
2841
|
"OPENGENI_PUBLIC_BASE_URL is required when the OpenGeni Slack app is configured"
|
|
@@ -3191,6 +3218,7 @@ export {
|
|
|
3191
3218
|
productLabelForModelId,
|
|
3192
3219
|
requiredSandboxEnvForBackend,
|
|
3193
3220
|
resolveEnrollmentSigningSecret,
|
|
3221
|
+
resolveFirstPartyDelegationSecret,
|
|
3194
3222
|
resolveModelProvider,
|
|
3195
3223
|
resolveNatsCalloutConfig,
|
|
3196
3224
|
resolveNatsControlPlaneAuth,
|