sim-setup 1.0.71-preview.395.1 → 1.0.71-preview.396.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.js +293 -82
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1391,10 +1391,7 @@ var init_env_capabilities = __esm(() => {
|
|
|
1391
1391
|
message: SANDBOX_RELEASE_GENERATION_ERROR
|
|
1392
1392
|
}
|
|
1393
1393
|
})),
|
|
1394
|
-
optionalFields: [
|
|
1395
|
-
envField("NEXT_PUBLIC_E2B_ENABLED"),
|
|
1396
|
-
envField("NEXT_PUBLIC_SANDBOXES_ENABLED")
|
|
1397
|
-
]
|
|
1394
|
+
optionalFields: [envField("NEXT_PUBLIC_E2B_ENABLED")]
|
|
1398
1395
|
},
|
|
1399
1396
|
{
|
|
1400
1397
|
id: "daytona",
|
|
@@ -1409,10 +1406,7 @@ var init_env_capabilities = __esm(() => {
|
|
|
1409
1406
|
message: IMMUTABLE_DAYTONA_SNAPSHOT_REF_ERROR
|
|
1410
1407
|
}
|
|
1411
1408
|
})),
|
|
1412
|
-
optionalFields: [
|
|
1413
|
-
envField("NEXT_PUBLIC_E2B_ENABLED"),
|
|
1414
|
-
envField("NEXT_PUBLIC_SANDBOXES_ENABLED")
|
|
1415
|
-
]
|
|
1409
|
+
optionalFields: [envField("NEXT_PUBLIC_E2B_ENABLED")]
|
|
1416
1410
|
}
|
|
1417
1411
|
]
|
|
1418
1412
|
});
|
|
@@ -1670,7 +1664,6 @@ var init_env_capabilities = __esm(() => {
|
|
|
1670
1664
|
"EMAIL_VERIFICATION_ENABLED",
|
|
1671
1665
|
"NEXT_PUBLIC_CHAT_DISABLED",
|
|
1672
1666
|
"NEXT_PUBLIC_E2B_ENABLED",
|
|
1673
|
-
"NEXT_PUBLIC_SANDBOXES_ENABLED",
|
|
1674
1667
|
"SIM_AGENT_API_URL",
|
|
1675
1668
|
...Object.values(LLM_KEY_POOLS).flatMap((pool) => [
|
|
1676
1669
|
...pool.keys,
|
|
@@ -2454,8 +2447,7 @@ var init_capability_config = __esm(() => {
|
|
|
2454
2447
|
label: "Disabled",
|
|
2455
2448
|
hint: "local JavaScript execution only",
|
|
2456
2449
|
env: {
|
|
2457
|
-
NEXT_PUBLIC_E2B_ENABLED: "false"
|
|
2458
|
-
NEXT_PUBLIC_SANDBOXES_ENABLED: "false"
|
|
2450
|
+
NEXT_PUBLIC_E2B_ENABLED: "false"
|
|
2459
2451
|
},
|
|
2460
2452
|
currentWhen: {
|
|
2461
2453
|
kind: "all",
|
|
@@ -2477,8 +2469,7 @@ var init_capability_config = __esm(() => {
|
|
|
2477
2469
|
e2b: {
|
|
2478
2470
|
hint: "dedicated Function code and CLI sandboxes",
|
|
2479
2471
|
env: {
|
|
2480
|
-
NEXT_PUBLIC_E2B_ENABLED: "true"
|
|
2481
|
-
NEXT_PUBLIC_SANDBOXES_ENABLED: "true"
|
|
2472
|
+
NEXT_PUBLIC_E2B_ENABLED: "true"
|
|
2482
2473
|
},
|
|
2483
2474
|
prompts: [
|
|
2484
2475
|
{ type: "field", key: "E2B_API_KEY", input: "secret", required: true },
|
|
@@ -2504,8 +2495,7 @@ var init_capability_config = __esm(() => {
|
|
|
2504
2495
|
daytona: {
|
|
2505
2496
|
hint: "dedicated Function code and CLI sandboxes",
|
|
2506
2497
|
env: {
|
|
2507
|
-
NEXT_PUBLIC_E2B_ENABLED: "false"
|
|
2508
|
-
NEXT_PUBLIC_SANDBOXES_ENABLED: "true"
|
|
2498
|
+
NEXT_PUBLIC_E2B_ENABLED: "false"
|
|
2509
2499
|
},
|
|
2510
2500
|
prompts: [
|
|
2511
2501
|
{
|
|
@@ -3100,10 +3090,6 @@ function inspectSandbox(values) {
|
|
|
3100
3090
|
if (isTruthyEnvCapabilityValue(values, "E2B_ENABLED") !== isTruthyEnvCapabilityValue(values, "NEXT_PUBLIC_E2B_ENABLED")) {
|
|
3101
3091
|
coherenceProblems.push("E2B_ENABLED and NEXT_PUBLIC_E2B_ENABLED disagree");
|
|
3102
3092
|
}
|
|
3103
|
-
const remoteAvailable = providerId !== null && providerId !== "disabled";
|
|
3104
|
-
if (remoteAvailable !== isTruthyEnvCapabilityValue(values, "NEXT_PUBLIC_SANDBOXES_ENABLED")) {
|
|
3105
|
-
coherenceProblems.push("remote sandbox availability and NEXT_PUBLIC_SANDBOXES_ENABLED disagree");
|
|
3106
|
-
}
|
|
3107
3093
|
if (coherenceProblems.length > 0) {
|
|
3108
3094
|
return {
|
|
3109
3095
|
...featureMetadata("sandbox"),
|
|
@@ -3304,6 +3290,103 @@ var init_capability_status = __esm(() => {
|
|
|
3304
3290
|
};
|
|
3305
3291
|
});
|
|
3306
3292
|
|
|
3293
|
+
// ../deployment-config/src/registration.ts
|
|
3294
|
+
function modeFromAxes({ signup, emailAuth }) {
|
|
3295
|
+
if (!emailAuth)
|
|
3296
|
+
return signup === "closed" ? "closed-no-email" : "no-email";
|
|
3297
|
+
return signup;
|
|
3298
|
+
}
|
|
3299
|
+
function mostRestrictive(a, b) {
|
|
3300
|
+
return {
|
|
3301
|
+
signup: SIGNUP_LEVELS[Math.max(SIGNUP_LEVELS.indexOf(a.signup), SIGNUP_LEVELS.indexOf(b.signup))],
|
|
3302
|
+
emailAuth: a.emailAuth && b.emailAuth
|
|
3303
|
+
};
|
|
3304
|
+
}
|
|
3305
|
+
function normalize(value) {
|
|
3306
|
+
return value?.trim().toLowerCase() || undefined;
|
|
3307
|
+
}
|
|
3308
|
+
function isOn(value) {
|
|
3309
|
+
const normalized = normalize(value);
|
|
3310
|
+
return normalized === "true" || normalized === "1";
|
|
3311
|
+
}
|
|
3312
|
+
function isOff(value) {
|
|
3313
|
+
const normalized = normalize(value);
|
|
3314
|
+
return normalized === "false" || normalized === "0";
|
|
3315
|
+
}
|
|
3316
|
+
function isRegistrationMode(value) {
|
|
3317
|
+
return typeof value === "string" && REGISTRATION_MODES.includes(value);
|
|
3318
|
+
}
|
|
3319
|
+
function resolveRegistrationMode(read) {
|
|
3320
|
+
const warnings = [];
|
|
3321
|
+
const legacy = (key) => read(DEPRECATED_REGISTRATION_ENV_VARS[key]);
|
|
3322
|
+
const rawMode = read(REGISTRATION_MODE_ENV_VAR)?.trim() || undefined;
|
|
3323
|
+
const normalizedMode = normalize(rawMode);
|
|
3324
|
+
let configured;
|
|
3325
|
+
if (rawMode !== undefined) {
|
|
3326
|
+
if (isRegistrationMode(normalizedMode)) {
|
|
3327
|
+
configured = normalizedMode;
|
|
3328
|
+
} else {
|
|
3329
|
+
configured = "closed";
|
|
3330
|
+
warnings.push({
|
|
3331
|
+
code: "invalid-mode",
|
|
3332
|
+
severity: "error",
|
|
3333
|
+
message: "REGISTRATION_MODE is not a recognized value, so self-serve registration is closed until it is corrected. Existing accounts can still sign in.",
|
|
3334
|
+
details: { value: rawMode, allowed: REGISTRATION_MODES }
|
|
3335
|
+
});
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
const setLegacy = Object.keys(DEPRECATED_REGISTRATION_ENV_VARS).filter((key) => normalize(legacy(key)) !== undefined).map((key) => DEPRECATED_REGISTRATION_ENV_VARS[key]);
|
|
3339
|
+
const legacyAxes = {
|
|
3340
|
+
signup: isOn(legacy("disableRegistration")) ? "closed" : isOn(legacy("disableEmailSignup")) ? "no-email-signup" : "open",
|
|
3341
|
+
emailAuth: !isOff(legacy("emailPasswordSignupEnabled")) && !isOff(legacy("publicEmailPasswordSignupEnabled"))
|
|
3342
|
+
};
|
|
3343
|
+
const legacyMode = modeFromAxes(legacyAxes);
|
|
3344
|
+
if (setLegacy.length > 0) {
|
|
3345
|
+
warnings.push({
|
|
3346
|
+
code: "deprecated-variables",
|
|
3347
|
+
severity: "warn",
|
|
3348
|
+
message: "Deprecated registration variables are set. Replace them with REGISTRATION_MODE; they still apply until removed.",
|
|
3349
|
+
details: { variables: setLegacy, equivalentMode: legacyMode }
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
if (configured === undefined)
|
|
3353
|
+
return { mode: legacyMode, warnings };
|
|
3354
|
+
const resolved = modeFromAxes(mostRestrictive(MODE_AXES[configured], legacyAxes));
|
|
3355
|
+
if (resolved !== configured) {
|
|
3356
|
+
warnings.push({
|
|
3357
|
+
code: "conflict",
|
|
3358
|
+
severity: "warn",
|
|
3359
|
+
message: "Deprecated registration variables are more restrictive than REGISTRATION_MODE, so the most restrictive combination applies.",
|
|
3360
|
+
details: { configured, legacy: legacyMode, resolved }
|
|
3361
|
+
});
|
|
3362
|
+
}
|
|
3363
|
+
return { mode: resolved, warnings };
|
|
3364
|
+
}
|
|
3365
|
+
var REGISTRATION_MODE_ENV_VAR = "REGISTRATION_MODE", REGISTRATION_MODES, DEPRECATED_REGISTRATION_ENV_VARS, SIGNUP_LEVELS, MODE_AXES;
|
|
3366
|
+
var init_registration = __esm(() => {
|
|
3367
|
+
REGISTRATION_MODES = [
|
|
3368
|
+
"open",
|
|
3369
|
+
"no-email-signup",
|
|
3370
|
+
"closed",
|
|
3371
|
+
"no-email",
|
|
3372
|
+
"closed-no-email"
|
|
3373
|
+
];
|
|
3374
|
+
DEPRECATED_REGISTRATION_ENV_VARS = {
|
|
3375
|
+
disableRegistration: "DISABLE_REGISTRATION",
|
|
3376
|
+
disableEmailSignup: "DISABLE_EMAIL_SIGNUP",
|
|
3377
|
+
emailPasswordSignupEnabled: "EMAIL_PASSWORD_SIGNUP_ENABLED",
|
|
3378
|
+
publicEmailPasswordSignupEnabled: "NEXT_PUBLIC_EMAIL_PASSWORD_SIGNUP_ENABLED"
|
|
3379
|
+
};
|
|
3380
|
+
SIGNUP_LEVELS = ["open", "no-email-signup", "closed"];
|
|
3381
|
+
MODE_AXES = {
|
|
3382
|
+
open: { signup: "open", emailAuth: true },
|
|
3383
|
+
"no-email-signup": { signup: "no-email-signup", emailAuth: true },
|
|
3384
|
+
closed: { signup: "closed", emailAuth: true },
|
|
3385
|
+
"no-email": { signup: "open", emailAuth: false },
|
|
3386
|
+
"closed-no-email": { signup: "closed", emailAuth: false }
|
|
3387
|
+
};
|
|
3388
|
+
});
|
|
3389
|
+
|
|
3307
3390
|
// ../utils/src/random.ts
|
|
3308
3391
|
function generateRandomBytes(length) {
|
|
3309
3392
|
return crypto.getRandomValues(new Uint8Array(length));
|
|
@@ -5892,53 +5975,157 @@ var init_probes = __esm(() => {
|
|
|
5892
5975
|
init_env_files();
|
|
5893
5976
|
});
|
|
5894
5977
|
|
|
5978
|
+
// ../deployment-config/src/enterprise-features.ts
|
|
5979
|
+
function defineEnterpriseFeatures(features) {
|
|
5980
|
+
return features;
|
|
5981
|
+
}
|
|
5982
|
+
var ENTERPRISE_FEATURES, ENTERPRISE_MASTER_ENV_VAR = "ENTERPRISE_ENABLED", ENTERPRISE_FEATURE_KEYS;
|
|
5983
|
+
var init_enterprise_features = __esm(() => {
|
|
5984
|
+
ENTERPRISE_FEATURES = defineEnterpriseFeatures({
|
|
5985
|
+
accessControl: {
|
|
5986
|
+
envVar: "ACCESS_CONTROL_ENABLED",
|
|
5987
|
+
selfHostedDefault: false,
|
|
5988
|
+
implies: ["organizations"],
|
|
5989
|
+
label: "Access control",
|
|
5990
|
+
hint: "permission groups (implies organizations)",
|
|
5991
|
+
setupUnlock: true
|
|
5992
|
+
},
|
|
5993
|
+
organizations: {
|
|
5994
|
+
envVar: "ORGANIZATIONS_ENABLED",
|
|
5995
|
+
selfHostedDefault: false,
|
|
5996
|
+
onWithBilling: true,
|
|
5997
|
+
label: "Organizations",
|
|
5998
|
+
hint: "multi-workspace orgs",
|
|
5999
|
+
setupUnlock: true
|
|
6000
|
+
},
|
|
6001
|
+
auditLogs: {
|
|
6002
|
+
envVar: "AUDIT_LOGS_ENABLED",
|
|
6003
|
+
selfHostedDefault: false,
|
|
6004
|
+
label: "Audit logs",
|
|
6005
|
+
setupUnlock: true
|
|
6006
|
+
},
|
|
6007
|
+
customBlocks: {
|
|
6008
|
+
envVar: "CUSTOM_BLOCKS_ENABLED",
|
|
6009
|
+
selfHostedDefault: false,
|
|
6010
|
+
label: "Custom blocks",
|
|
6011
|
+
hint: "reusable org-wide blocks",
|
|
6012
|
+
setupUnlock: true
|
|
6013
|
+
},
|
|
6014
|
+
dataRetention: {
|
|
6015
|
+
envVar: "DATA_RETENTION_ENABLED",
|
|
6016
|
+
selfHostedDefault: false,
|
|
6017
|
+
label: "Data retention",
|
|
6018
|
+
hint: "deletes expired data",
|
|
6019
|
+
setupUnlock: true
|
|
6020
|
+
},
|
|
6021
|
+
sessionPolicies: {
|
|
6022
|
+
envVar: "SESSION_POLICIES_ENABLED",
|
|
6023
|
+
selfHostedDefault: true,
|
|
6024
|
+
label: "Session policies",
|
|
6025
|
+
hint: "session lifetime caps",
|
|
6026
|
+
setupUnlock: true
|
|
6027
|
+
},
|
|
6028
|
+
dataDrains: {
|
|
6029
|
+
envVar: "DATA_DRAINS_ENABLED",
|
|
6030
|
+
selfHostedDefault: false,
|
|
6031
|
+
label: "Data drains",
|
|
6032
|
+
hint: "export streams",
|
|
6033
|
+
setupUnlock: true
|
|
6034
|
+
},
|
|
6035
|
+
forking: {
|
|
6036
|
+
envVar: "FORKING_ENABLED",
|
|
6037
|
+
selfHostedDefault: false,
|
|
6038
|
+
label: "Workflow forking",
|
|
6039
|
+
setupUnlock: true
|
|
6040
|
+
},
|
|
6041
|
+
inbox: {
|
|
6042
|
+
envVar: "INBOX_ENABLED",
|
|
6043
|
+
selfHostedDefault: true,
|
|
6044
|
+
label: "Inbox",
|
|
6045
|
+
setupUnlock: true
|
|
6046
|
+
},
|
|
6047
|
+
usageMonitoring: {
|
|
6048
|
+
envVar: "USAGE_MONITORING_ENABLED",
|
|
6049
|
+
selfHostedDefault: false,
|
|
6050
|
+
label: "Usage monitoring",
|
|
6051
|
+
hint: "org-wide credit usage",
|
|
6052
|
+
setupUnlock: true
|
|
6053
|
+
},
|
|
6054
|
+
sso: {
|
|
6055
|
+
envVar: "SSO_ENABLED",
|
|
6056
|
+
selfHostedDefault: false,
|
|
6057
|
+
label: "Single sign-on",
|
|
6058
|
+
hint: "SAML and OIDC",
|
|
6059
|
+
setupUnlock: false
|
|
6060
|
+
},
|
|
6061
|
+
scim: {
|
|
6062
|
+
envVar: "SCIM_ENABLED",
|
|
6063
|
+
selfHostedDefault: false,
|
|
6064
|
+
hostedDefault: true,
|
|
6065
|
+
label: "Directory provisioning",
|
|
6066
|
+
hint: "SCIM; needs single sign-on",
|
|
6067
|
+
setupUnlock: false
|
|
6068
|
+
},
|
|
6069
|
+
sandboxes: {
|
|
6070
|
+
envVar: "SANDBOXES_ENABLED",
|
|
6071
|
+
selfHostedDefault: false,
|
|
6072
|
+
label: "Custom sandboxes",
|
|
6073
|
+
hint: "needs a remote sandbox provider",
|
|
6074
|
+
setupUnlock: false
|
|
6075
|
+
},
|
|
6076
|
+
credentialGroups: {
|
|
6077
|
+
envVar: "CREDENTIAL_GROUPS",
|
|
6078
|
+
selfHostedDefault: false,
|
|
6079
|
+
label: "Credential groups",
|
|
6080
|
+
hint: "managed connected accounts",
|
|
6081
|
+
setupUnlock: false
|
|
6082
|
+
}
|
|
6083
|
+
});
|
|
6084
|
+
ENTERPRISE_FEATURE_KEYS = Object.keys(ENTERPRISE_FEATURES);
|
|
6085
|
+
});
|
|
6086
|
+
|
|
5895
6087
|
// src/twins.ts
|
|
5896
|
-
var FLAG_TWINS, SELF_HOST_UNLOCKS, LOGIN_PROVIDERS;
|
|
6088
|
+
var FLAG_TWINS, FORMERLY_TWINNED_FEATURES, INERT_BROWSER_FLAGS, SELF_HOST_UNLOCKS, LOGIN_PROVIDERS;
|
|
5897
6089
|
var init_twins = __esm(() => {
|
|
6090
|
+
init_enterprise_features();
|
|
5898
6091
|
FLAG_TWINS = [
|
|
5899
6092
|
{ server: "BILLING_ENABLED", client: "NEXT_PUBLIC_BILLING_ENABLED" },
|
|
5900
|
-
{ server: "ENTERPRISE_ENABLED", client: "NEXT_PUBLIC_ENTERPRISE_ENABLED" },
|
|
5901
|
-
{ server: "ACCESS_CONTROL_ENABLED", client: "NEXT_PUBLIC_ACCESS_CONTROL_ENABLED" },
|
|
5902
|
-
{ server: "ORGANIZATIONS_ENABLED", client: "NEXT_PUBLIC_ORGANIZATIONS_ENABLED" },
|
|
5903
|
-
{ server: "AUDIT_LOGS_ENABLED", client: "NEXT_PUBLIC_AUDIT_LOGS_ENABLED" },
|
|
5904
|
-
{ server: "CUSTOM_BLOCKS_ENABLED", client: "NEXT_PUBLIC_CUSTOM_BLOCKS_ENABLED" },
|
|
5905
|
-
{ server: "DATA_RETENTION_ENABLED", client: "NEXT_PUBLIC_DATA_RETENTION_ENABLED" },
|
|
5906
|
-
{ server: "SESSION_POLICIES_ENABLED", client: "NEXT_PUBLIC_SESSION_POLICIES_ENABLED" },
|
|
5907
|
-
{ server: "DATA_DRAINS_ENABLED", client: "NEXT_PUBLIC_DATA_DRAINS_ENABLED" },
|
|
5908
|
-
{ server: "FORKING_ENABLED", client: "NEXT_PUBLIC_FORKING_ENABLED" },
|
|
5909
|
-
{ server: "INBOX_ENABLED", client: "NEXT_PUBLIC_INBOX_ENABLED" },
|
|
5910
6093
|
{ server: "DISABLE_INVITATIONS", client: "NEXT_PUBLIC_DISABLE_INVITATIONS" },
|
|
5911
6094
|
{ server: "DISABLE_PUBLIC_API", client: "NEXT_PUBLIC_DISABLE_PUBLIC_API" },
|
|
5912
|
-
{ server: "SSO_ENABLED", client: "NEXT_PUBLIC_SSO_ENABLED" },
|
|
5913
|
-
{ server: "USAGE_MONITORING_ENABLED", client: "NEXT_PUBLIC_USAGE_MONITORING_ENABLED" },
|
|
5914
|
-
{ server: "EMAIL_PASSWORD_SIGNUP_ENABLED", client: "NEXT_PUBLIC_EMAIL_PASSWORD_SIGNUP_ENABLED" },
|
|
5915
6095
|
{ server: "E2B_ENABLED", client: "NEXT_PUBLIC_E2B_ENABLED" },
|
|
5916
6096
|
{ server: "SLACK_EXTENDED_SCOPES", client: "NEXT_PUBLIC_SLACK_EXTENDED_SCOPES" }
|
|
5917
6097
|
];
|
|
6098
|
+
FORMERLY_TWINNED_FEATURES = [
|
|
6099
|
+
"sso",
|
|
6100
|
+
"scim",
|
|
6101
|
+
"accessControl",
|
|
6102
|
+
"auditLogs",
|
|
6103
|
+
"customBlocks",
|
|
6104
|
+
"usageMonitoring",
|
|
6105
|
+
"dataRetention",
|
|
6106
|
+
"dataDrains",
|
|
6107
|
+
"sessionPolicies",
|
|
6108
|
+
"forking",
|
|
6109
|
+
"organizations",
|
|
6110
|
+
"inbox"
|
|
6111
|
+
];
|
|
6112
|
+
INERT_BROWSER_FLAGS = [
|
|
6113
|
+
...[
|
|
6114
|
+
ENTERPRISE_MASTER_ENV_VAR,
|
|
6115
|
+
...FORMERLY_TWINNED_FEATURES.map((key) => ENTERPRISE_FEATURES[key].envVar)
|
|
6116
|
+
].map((server) => ({ server, client: `NEXT_PUBLIC_${server}` })),
|
|
6117
|
+
{ client: "NEXT_PUBLIC_SANDBOXES_ENABLED" }
|
|
6118
|
+
];
|
|
5918
6119
|
SELF_HOST_UNLOCKS = [
|
|
5919
6120
|
{
|
|
5920
|
-
server:
|
|
6121
|
+
server: ENTERPRISE_MASTER_ENV_VAR,
|
|
5921
6122
|
label: "All enterprise features",
|
|
5922
6123
|
hint: "enables everything below"
|
|
5923
6124
|
},
|
|
5924
|
-
{
|
|
5925
|
-
|
|
5926
|
-
label: "
|
|
5927
|
-
|
|
5928
|
-
},
|
|
5929
|
-
{ server: "ORGANIZATIONS_ENABLED", label: "Organizations", hint: "multi-workspace orgs" },
|
|
5930
|
-
{ server: "AUDIT_LOGS_ENABLED", label: "Audit logs", hint: "" },
|
|
5931
|
-
{ server: "CUSTOM_BLOCKS_ENABLED", label: "Custom blocks", hint: "reusable org-wide blocks" },
|
|
5932
|
-
{ server: "DATA_RETENTION_ENABLED", label: "Data retention", hint: "deletes expired data" },
|
|
5933
|
-
{ server: "SESSION_POLICIES_ENABLED", label: "Session policies", hint: "session lifetime caps" },
|
|
5934
|
-
{ server: "DATA_DRAINS_ENABLED", label: "Data drains", hint: "export streams" },
|
|
5935
|
-
{ server: "FORKING_ENABLED", label: "Workflow forking", hint: "" },
|
|
5936
|
-
{ server: "INBOX_ENABLED", label: "Inbox", hint: "" },
|
|
5937
|
-
{
|
|
5938
|
-
server: "USAGE_MONITORING_ENABLED",
|
|
5939
|
-
label: "Usage monitoring",
|
|
5940
|
-
hint: "org-wide credit usage"
|
|
5941
|
-
}
|
|
6125
|
+
...ENTERPRISE_FEATURE_KEYS.filter((key) => ENTERPRISE_FEATURES[key].setupUnlock).map((key) => {
|
|
6126
|
+
const feature = ENTERPRISE_FEATURES[key];
|
|
6127
|
+
return { server: feature.envVar, label: feature.label, hint: feature.hint ?? "" };
|
|
6128
|
+
})
|
|
5942
6129
|
];
|
|
5943
6130
|
LOGIN_PROVIDERS = [
|
|
5944
6131
|
{ id: "google", label: "Google", idKey: "GOOGLE_CLIENT_ID", secretKey: "GOOGLE_CLIENT_SECRET" },
|
|
@@ -6250,26 +6437,17 @@ function checkCoherence(ctx) {
|
|
|
6250
6437
|
autofix: () => writeEnvValues(sim.target, { [missingSide]: value })
|
|
6251
6438
|
});
|
|
6252
6439
|
}
|
|
6253
|
-
|
|
6254
|
-
const
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
findings.push({
|
|
6260
|
-
group: "coherence",
|
|
6261
|
-
status: "fail",
|
|
6262
|
-
message: "remote sandboxes are configured but NEXT_PUBLIC_SANDBOXES_ENABLED is unset — the Function block will hide its language and sandbox controls",
|
|
6263
|
-
fix: "doctor --fix sets NEXT_PUBLIC_SANDBOXES_ENABLED=true",
|
|
6264
|
-
autofix: () => writeEnvValues(sim.target, { NEXT_PUBLIC_SANDBOXES_ENABLED: "true" })
|
|
6265
|
-
});
|
|
6266
|
-
} else if (!remoteSandboxAvailable && publicSandboxEnabled) {
|
|
6440
|
+
findings.push(...checkRegistrationMode(sim));
|
|
6441
|
+
for (const { server, client } of INERT_BROWSER_FLAGS) {
|
|
6442
|
+
const clientValue = sim.vars.get(client);
|
|
6443
|
+
if (clientValue === undefined)
|
|
6444
|
+
continue;
|
|
6445
|
+
const needsServer = server !== undefined && isTruthy(clientValue) && sim.vars.get(server) === undefined;
|
|
6267
6446
|
findings.push({
|
|
6268
6447
|
group: "coherence",
|
|
6269
|
-
status: "
|
|
6270
|
-
message:
|
|
6271
|
-
fix:
|
|
6272
|
-
autofix: () => writeEnvValues(sim.target, { NEXT_PUBLIC_SANDBOXES_ENABLED: "false" })
|
|
6448
|
+
status: "warn",
|
|
6449
|
+
message: `${client} is set but no longer does anything — the browser reads this from the server`,
|
|
6450
|
+
fix: needsServer ? `set ${server}=${clientValue} and remove ${client}` : `remove ${client}`
|
|
6273
6451
|
});
|
|
6274
6452
|
}
|
|
6275
6453
|
const disableAuth = sim.vars.get("DISABLE_AUTH");
|
|
@@ -6374,6 +6552,36 @@ function checkCoherence(ctx) {
|
|
|
6374
6552
|
}
|
|
6375
6553
|
return findings;
|
|
6376
6554
|
}
|
|
6555
|
+
function checkRegistrationMode(sim) {
|
|
6556
|
+
const { mode, warnings } = resolveRegistrationMode((name) => sim.vars.get(name));
|
|
6557
|
+
const findings = [];
|
|
6558
|
+
for (const warning of warnings) {
|
|
6559
|
+
if (warning.code === "invalid-mode") {
|
|
6560
|
+
findings.push({
|
|
6561
|
+
group: "coherence",
|
|
6562
|
+
status: "fail",
|
|
6563
|
+
message: `REGISTRATION_MODE="${warning.details.value}" is not a recognized value — the app closes self-serve registration until it is corrected`,
|
|
6564
|
+
fix: `set REGISTRATION_MODE to one of ${REGISTRATION_MODES.join(", ")}`
|
|
6565
|
+
});
|
|
6566
|
+
} else if (warning.code === "deprecated-variables") {
|
|
6567
|
+
const names = warning.details.variables.join(", ");
|
|
6568
|
+
findings.push({
|
|
6569
|
+
group: "coherence",
|
|
6570
|
+
status: "warn",
|
|
6571
|
+
message: `deprecated registration variables are set (${names}) — REGISTRATION_MODE replaces them`,
|
|
6572
|
+
fix: `set REGISTRATION_MODE=${mode} and remove ${names}`
|
|
6573
|
+
});
|
|
6574
|
+
} else {
|
|
6575
|
+
findings.push({
|
|
6576
|
+
group: "coherence",
|
|
6577
|
+
status: "warn",
|
|
6578
|
+
message: `REGISTRATION_MODE=${warning.details.configured} resolves to ${mode} because deprecated registration variables are more restrictive`,
|
|
6579
|
+
fix: `set REGISTRATION_MODE=${mode} and remove the deprecated variables, or remove them to keep ${warning.details.configured}`
|
|
6580
|
+
});
|
|
6581
|
+
}
|
|
6582
|
+
}
|
|
6583
|
+
return findings;
|
|
6584
|
+
}
|
|
6377
6585
|
async function checkDatabase(sim) {
|
|
6378
6586
|
const findings = [];
|
|
6379
6587
|
const dsn = sim.vars.get("DATABASE_URL");
|
|
@@ -6525,6 +6733,7 @@ async function runChecks(ctx, groups) {
|
|
|
6525
6733
|
var REQUIRED_APP_KEYS, REQUIRED_KEYS, MIN_32_KEYS, URL_KEYS;
|
|
6526
6734
|
var init_checks = __esm(() => {
|
|
6527
6735
|
init_env_capabilities();
|
|
6736
|
+
init_registration();
|
|
6528
6737
|
init_capability_config();
|
|
6529
6738
|
init_detect();
|
|
6530
6739
|
init_env_files();
|
|
@@ -11277,24 +11486,26 @@ async function promptUnlocks(vars) {
|
|
|
11277
11486
|
if (selected.length === 0)
|
|
11278
11487
|
return {};
|
|
11279
11488
|
const flags = new Set(selected);
|
|
11280
|
-
if (flags.has(
|
|
11489
|
+
if (flags.has(ENTERPRISE_MASTER_ENV_VAR)) {
|
|
11281
11490
|
log2.info(theme.muted("The enterprise switch covers every feature below — pick individual ones only to override it."));
|
|
11282
11491
|
}
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11492
|
+
for (const key of ENTERPRISE_FEATURE_KEYS) {
|
|
11493
|
+
const feature = ENTERPRISE_FEATURES[key];
|
|
11494
|
+
if (!flags.has(feature.envVar))
|
|
11495
|
+
continue;
|
|
11496
|
+
for (const implied of feature.implies ?? []) {
|
|
11497
|
+
const required = ENTERPRISE_FEATURES[implied];
|
|
11498
|
+
if (flags.has(required.envVar))
|
|
11499
|
+
continue;
|
|
11500
|
+
flags.add(required.envVar);
|
|
11501
|
+
log2.info(theme.muted(`${feature.label} requires ${required.label.toLowerCase()} — enabling both.`));
|
|
11502
|
+
}
|
|
11293
11503
|
}
|
|
11294
|
-
return
|
|
11504
|
+
return Object.fromEntries([...flags].map((server) => [server, "true"]));
|
|
11295
11505
|
}
|
|
11296
11506
|
var DEFAULT_CLI_AUTH_ORIGIN = "https://www.sim.ai", PROVIDER_CONSOLES;
|
|
11297
11507
|
var init_steps = __esm(() => {
|
|
11508
|
+
init_enterprise_features();
|
|
11298
11509
|
init_egress();
|
|
11299
11510
|
init_errors();
|
|
11300
11511
|
init_capability_config();
|