fix: Codex 自动压缩不触发 —— 接管时链接模型目录(绝对路径)进 config.toml (hot 1.5.83)

This commit is contained in:
mac
2026-08-16 12:45:32 +08:00
parent e9a261482c
commit 1b687c01e9
50 changed files with 10885 additions and 1161 deletions
+33
View File
@@ -0,0 +1,33 @@
(function initCanvasInputs(root) {
function uniqueNonEmpty(values) {
const seen = new Set();
return (Array.isArray(values) ? values : []).filter((value) => {
const normalized = typeof value === "string" ? value.trim() : "";
if (!normalized || seen.has(normalized)) return false;
seen.add(normalized);
return true;
});
}
function collectUpstreamOutputs(node, readNodeOutput) {
const out = { text: "", image: "", images: [] };
if (!node || !node.inputs || typeof readNodeOutput !== "function") return out;
for (const key of Object.keys(node.inputs)) {
const connections = (node.inputs[key] && node.inputs[key].connections) || [];
for (const connection of connections) {
const source = readNodeOutput(connection.node) || {};
if (source.text && !out.text) out.text = String(source.text).trim();
if (source.image) out.images.push(source.image);
}
}
out.images = uniqueNonEmpty(out.images);
out.image = out.images[0] || "";
return out;
}
const api = { uniqueNonEmpty, collectUpstreamOutputs };
if (typeof module !== "undefined" && module.exports) module.exports = api;
root.CanvasInputs = api;
})(typeof window !== "undefined" ? window : globalThis);