@standardagents/builder 0.27.8 → 0.27.9
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 +42 -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/index.js
CHANGED
|
@@ -846,30 +846,40 @@ function resolveDefinedProviderConfig(definition, env) {
|
|
|
846
846
|
missing.push(slot.defaultEnv);
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
849
|
+
const isConfigSource = (value) => !!value && typeof value === "object" && !Array.isArray(value) && (value.type === "env" || value.type === "const");
|
|
850
|
+
const resolveConfigValue = (value) => {
|
|
851
|
+
if (value === null || value === void 0) return void 0;
|
|
852
|
+
if (isConfigSource(value)) {
|
|
853
|
+
const source = value;
|
|
854
|
+
if (source.type === "const") return source.value;
|
|
855
|
+
envKeys.push(source.name);
|
|
856
|
+
variables.push({
|
|
857
|
+
name: source.name,
|
|
858
|
+
type: normalizeEnvType(source.valueType),
|
|
859
|
+
required: source.required !== false && source.default === void 0,
|
|
860
|
+
description: source.description ?? ""
|
|
861
|
+
});
|
|
862
|
+
const envValue = env[source.name];
|
|
863
|
+
if (envValue !== void 0 && envValue !== null && envValue !== "") {
|
|
864
|
+
return coerceProviderConfigValue(envValue, source.valueType);
|
|
865
|
+
}
|
|
866
|
+
if (source.default !== void 0) return source.default;
|
|
867
|
+
if (source.required !== false) missing.push(source.name);
|
|
868
|
+
return void 0;
|
|
869
869
|
}
|
|
870
|
-
if (
|
|
871
|
-
|
|
870
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
871
|
+
const out = {};
|
|
872
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
873
|
+
const resolved = resolveConfigValue(entry);
|
|
874
|
+
if (resolved !== void 0) out[key] = resolved;
|
|
875
|
+
}
|
|
876
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
872
877
|
}
|
|
878
|
+
return value;
|
|
879
|
+
};
|
|
880
|
+
for (const [slotName, source] of Object.entries(definition.config ?? {})) {
|
|
881
|
+
const resolved = resolveConfigValue(source);
|
|
882
|
+
if (resolved !== void 0) values[slotName] = resolved;
|
|
873
883
|
}
|
|
874
884
|
return {
|
|
875
885
|
providerConfig: values,
|