@standardagents/builder 0.27.8 → 0.27.10
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/built-in-routes.js +56 -25
- package/dist/built-in-routes.js.map +1 -1
- package/dist/index.js +32 -22
- package/dist/index.js.map +1 -1
- package/dist/runtime.js +32 -22
- package/dist/runtime.js.map +1 -1
- package/package.json +5 -5
package/dist/runtime.js
CHANGED
|
@@ -837,30 +837,40 @@ function resolveDefinedProviderConfig(definition, env) {
|
|
|
837
837
|
missing.push(slot.defaultEnv);
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
840
|
+
const isConfigSource = (value) => !!value && typeof value === "object" && !Array.isArray(value) && (value.type === "env" || value.type === "const");
|
|
841
|
+
const resolveConfigValue = (value) => {
|
|
842
|
+
if (value === null || value === void 0) return void 0;
|
|
843
|
+
if (isConfigSource(value)) {
|
|
844
|
+
const source = value;
|
|
845
|
+
if (source.type === "const") return source.value;
|
|
846
|
+
envKeys.push(source.name);
|
|
847
|
+
variables.push({
|
|
848
|
+
name: source.name,
|
|
849
|
+
type: normalizeEnvType(source.valueType),
|
|
850
|
+
required: source.required !== false && source.default === void 0,
|
|
851
|
+
description: source.description ?? ""
|
|
852
|
+
});
|
|
853
|
+
const envValue = env[source.name];
|
|
854
|
+
if (envValue !== void 0 && envValue !== null && envValue !== "") {
|
|
855
|
+
return coerceProviderConfigValue(envValue, source.valueType);
|
|
856
|
+
}
|
|
857
|
+
if (source.default !== void 0) return source.default;
|
|
858
|
+
if (source.required !== false) missing.push(source.name);
|
|
859
|
+
return void 0;
|
|
860
860
|
}
|
|
861
|
-
if (
|
|
862
|
-
|
|
861
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
862
|
+
const out = {};
|
|
863
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
864
|
+
const resolved = resolveConfigValue(entry);
|
|
865
|
+
if (resolved !== void 0) out[key] = resolved;
|
|
866
|
+
}
|
|
867
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
863
868
|
}
|
|
869
|
+
return value;
|
|
870
|
+
};
|
|
871
|
+
for (const [slotName, source] of Object.entries(definition.config ?? {})) {
|
|
872
|
+
const resolved = resolveConfigValue(source);
|
|
873
|
+
if (resolved !== void 0) values[slotName] = resolved;
|
|
864
874
|
}
|
|
865
875
|
return {
|
|
866
876
|
providerConfig: values,
|