diff --git a/sundynix-desktop/frontend/src/App.tsx b/sundynix-desktop/frontend/src/App.tsx index df6c76b..c5eaf4e 100644 --- a/sundynix-desktop/frontend/src/App.tsx +++ b/sundynix-desktop/frontend/src/App.tsx @@ -124,7 +124,7 @@ export default function App() { {view === "home" ? ( ) : view === "studio" ? ( - + ) : view === "kb" ? ( ) : view === "report" ? ( diff --git a/sundynix-desktop/frontend/src/lib/api.ts b/sundynix-desktop/frontend/src/lib/api.ts index 909ffbe..e8ca819 100644 --- a/sundynix-desktop/frontend/src/lib/api.ts +++ b/sundynix-desktop/frontend/src/lib/api.ts @@ -126,6 +126,17 @@ export interface VaultDoc { content: string; } +// listChatModels: GET /api/v1/admin/models?kind=chat —— 已登记的对话模型名(供编排 Agent 节点选择)。 +export async function listChatModels(): Promise { + try { + const res = await fetch(`${GATEWAY}/api/v1/admin/models?kind=chat`); + const data = (await res.json()) as { models?: Array<{ model: string }> }; + return (data.models ?? []).map((m) => m.model); + } catch { + return []; + } +} + // listVault: GET /api/v1/kb/vault —— 某知识库的原始文档(Obsidian 式文库浏览)。 export async function listVault(id: Identity, kb: string): Promise { const res = await fetch(`${GATEWAY}/api/v1/kb/vault?kb=${encodeURIComponent(kb)}`, { headers: idHeaders(id) }); diff --git a/sundynix-desktop/frontend/src/studio/Inspector.tsx b/sundynix-desktop/frontend/src/studio/Inspector.tsx index fc5df2e..2763279 100644 --- a/sundynix-desktop/frontend/src/studio/Inspector.tsx +++ b/sundynix-desktop/frontend/src/studio/Inspector.tsx @@ -9,10 +9,12 @@ export function Inspector({ node, onChange, onDelete, + dynamicOptions, }: { node: Node | null; onChange: (id: string, patch: Record) => void; onDelete: (id: string) => void; + dynamicOptions?: Record; // 运行时选项(如 kb=真实知识库、model=已登记模型) }) { if (!node) { return ( @@ -48,11 +50,18 @@ export function Inspector({ {f.label} {f.required && *} {f.type === "select" ? ( - + (() => { + const dyn = dynamicOptions?.[f.key]; + const opts = dyn && dyn.length ? dyn : f.options ?? []; + return ( + + ); + })() ) : f.type === "textarea" ? (