feat(*): 插件中心与模型协议 - 完善声明式协议运行时并增加功能开放控制
This commit is contained in:
1 parent
7cc6021f6e
commit
919037e5d9
106 files changed
+8816
-499
No files matched your search
@@ -16,8 +16,11 @@ export function compactCanvasState(state: CanvasSnapshot | null) {
|
||||
|
||||
export function compactNode(node: CanvasNode) {
|
||||
const metadata = { ...(node.metadata || {}) };
|
||||
if (typeof metadata.content === "string" && metadata.content.length > 240) metadata.content = `${metadata.content.slice(0, 120)}...`;
|
||||
return { id: node.id, type: node.type, title: node.title, position: node.position, width: node.width, height: node.height, metadata };
|
||||
for (const key of ["url", "dataUrl", "previewUrl", "coverUrl"]) delete metadata[key];
|
||||
for (const key of ["content", "prompt", "composerContent", "errorDetails"]) {
|
||||
if (typeof metadata[key] === "string" && metadata[key].length > 360) metadata[key] = `${metadata[key].slice(0, 340)}...`;
|
||||
}
|
||||
return { id: node.id, type: node.type, title: node.title, position: node.position, width: node.width, height: node.height, parentId: node.parentId, metadata };
|
||||
}
|
||||
|
||||
export function nextCanvasX(state: CanvasSnapshot | null) {
|
||||
|
||||
Reference in new issue
Block a user