feat(*): 云端 Agent - 增强画布上下文读取并接入 Gemini 缓存
This commit is contained in:
@@ -468,6 +468,11 @@ function InfiniteCanvasPage() {
|
||||
const ids = nodeId ? [nodeId] : Array.from(selectedNodeIdsRef.current);
|
||||
const references = ids.map((id) => agentMentionReferences.find((reference) => reference.nodeId === id)).filter((reference): reference is CanvasResourceReference => Boolean(reference));
|
||||
if (!references.length) return;
|
||||
if (nodeId && !selectedNodeIdsRef.current.has(nodeId)) {
|
||||
const selection = new Set([nodeId]);
|
||||
selectedNodeIdsRef.current = selection;
|
||||
setSelectedNodeIds(selection);
|
||||
}
|
||||
setAgentPrefillPrompt(`${references.map(canvasResourceMentionToken).join(" ")} `);
|
||||
openAgent();
|
||||
setContextMenu(null);
|
||||
@@ -2822,7 +2827,7 @@ function InfiniteCanvasPage() {
|
||||
</div>
|
||||
|
||||
<div className={versions.open ? "hidden" : "contents"}>
|
||||
<CanvasCloudAgentPanel canvasId={projectId} domainProjectId={currentProject?.projectId} nodeCount={nodes.length} references={agentMentionReferences} prefillPrompt={agentPrefillPrompt} open={assistantOpen} onOpen={openAgent} onCollapse={closeAgent} onFocusNode={(nodeId) => {
|
||||
<CanvasCloudAgentPanel canvasId={projectId} domainProjectId={currentProject?.projectId} nodeCount={nodes.length} selectedNodeIds={Array.from(selectedNodeIds)} references={agentMentionReferences} prefillPrompt={agentPrefillPrompt} open={assistantOpen} onOpen={openAgent} onCollapse={closeAgent} onFocusNode={(nodeId) => {
|
||||
if (!nodesRef.current.some((node) => node.id === nodeId)) { message.info("该节点已删除或尚未同步到画布"); return; }
|
||||
focusCanvasNode(nodeId);
|
||||
}} />
|
||||
|
||||
Reference in New Issue
Block a user