Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 恢复 host-capability 插件在 @ 选择器中的处理

Shinkuf768c3a27004
diff --git a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx
index b9a49b4c36..49995145a0 100644
--- a/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx
+++ b/apps/desktop/src/renderer/components/new-chat/ChatInput.tsx
@@ -4394,7 +4394,8 @@ export function ChatInput({
const ghost = installedGhostsRef.current.find(
(candidate) => candidate.manifest.id === selectedItem.pluginId,
);
- if (!ghost?.enabled || !ghost.manifest.command) return;
+ if (!ghost?.enabled) return;
+
editor
.chain()
.focus()
@@ -4403,7 +4404,16 @@ export function ChatInput({
return true;
})
.run();
- placeGhostAtComposerStart(editor, ghost, installedGhostsRef.current);
+
+ if (ghost.manifest.command) {
+ placeGhostAtComposerStart(editor, ghost, installedGhostsRef.current);
+ } else {
+ const hostCap = hostCapabilityForGhost(ghost);
+ if (hostCap) {
+ placeHostCapabilityAtComposerStart(editor, ghost, installedGhostsRef.current);
+ }
+ }
+
closeAtPanel();
return;
}