feat: wire agenda artifacts

This commit is contained in:
colinislit
2025-12-28 14:54:32 +01:00
parent 14a9d34337
commit 94aab93f1c
4 changed files with 194 additions and 8 deletions

View File

@@ -23,6 +23,7 @@ import { OfflineBanner } from './offline-banner';
import { ChatPanel } from '../chat/chat-panel';
import { ArtifactArea } from '../artifacts/artifact-area';
import { getArtifactTitle } from '../artifacts/artifact-container';
import { routeIntentToArtifact } from '@/lib/swift/action-parser';
export function CommandCenter() {
const { closeAllArtifacts, openArtifacts, openArtifact, pendingAction, setPendingAction } = useSwiftStore();
@@ -73,12 +74,28 @@ export function CommandCenter() {
title,
});
// Clear pending action after processing
setPendingAction(null);
return;
}
const routedArtifact = routeIntentToArtifact(
pendingAction.intent,
pendingAction.entities,
pendingAction.confidence
);
if (routedArtifact) {
console.log('[CommandCenter] Routing action to artifact:', routedArtifact.type);
openArtifact({
type: routedArtifact.type,
prefill: routedArtifact.prefill,
title: routedArtifact.title,
});
} else {
console.log('[CommandCenter] Action has no artifact, skipping');
setPendingAction(null);
}
setPendingAction(null);
}, [pendingAction, openArtifact, setPendingAction]);
return (