feat(*): Agent工作流 - 完善审批、分镜协作与资源交互体验

This commit is contained in:
ddcat666
2026-10-11 22:23:11 +08:00
parent 435bc487cf
commit 298bee1fa9
38 changed files with 508 additions and 1263 deletions

View File

@@ -25,11 +25,35 @@ export type ExternalAssetSourceState = {
export function useExternalAssetSources(open: boolean): ExternalAssetSourceState {
const hydrated = usePluginStore((state) => state.hydrated);
const installations = usePluginStore((state) => state.installations);
const sources = useMemo(() => createHostedAssetSources(hydrated ? installations : []), [hydrated, installations]);
const needsEagle = open && hydrated && installations.some((installation) => installation.manifest.id === "eagle-asset-connector");
const [eagleLoaded, setEagleLoaded] = useState(false);
const [loadedSources, setLoadedSources] = useState<LoadedAssetSource[]>([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState("");
useEffect(() => {
if (!needsEagle) {
setEagleLoaded(true);
return;
}
let cancelled = false;
setEagleLoaded(false);
void import("@/lib/plugins/builtin/eagle")
.catch(() => undefined)
.finally(() => {
if (!cancelled) setEagleLoaded(true);
});
return () => {
cancelled = true;
};
}, [needsEagle]);
const sources = useMemo(() => {
if (!hydrated || (needsEagle && !eagleLoaded)) return [];
return createHostedAssetSources(installations);
}, [eagleLoaded, hydrated, installations, needsEagle]);
useEffect(() => {
const controller = new AbortController();
if (!open || !sources.length) {