major apps and hooks refactor

This commit is contained in:
2026-02-21 21:24:31 +00:00
parent e275c0fea6
commit 9e9acd9631
125 changed files with 3840 additions and 3285 deletions
@@ -8,9 +8,8 @@ import { ArrowLeft, Pencil, Plus, Check, X, Trash2, Search, ChevronRight } from
import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog';
import { useClient } from 'hooks/useClient';
import { useVisiblePiModels } from '@/state/useModels';
import { Card } from '@/components/Card';
import { usePi, EmbeddableChat } from 'apps/Chat';
import { usePiChat, EmbeddableChat } from 'officerdev';
type CapabilitySummary = {
dirName: string;
name: string;
@@ -63,14 +62,13 @@ export const CapabilityChat = ({
description,
onResponseEnd,
}: CapabilityChatProps) => {
const piModels = useVisiblePiModels();
const seedFile = `${kind.toUpperCase()}.md`;
const promptFrontmatter = `<frontmatter>\ninput file: ${filePath}\n${seedFile}: ${filePath}\ndir: ${resourceDir}\n\nBe aware of any extra files alongside the same dir as the ${kind} file we're handling, for possible extra context. You can also, if pertinent, create scripts or other files that will help you in the future.\n</frontmatter>`;
const defaultInput = isNew
? description ?? `Help me create the content for this new ${kind} file`
: `Help me understand and improve this ${kind} file`;
const pi = usePi(undefined, undefined, { replaceUrl: false });
const pi = usePiChat(undefined, undefined, { replaceUrl: false });
const onResponseEndRef = useRef(onResponseEnd);
onResponseEndRef.current = onResponseEnd;
@@ -86,7 +84,6 @@ export const CapabilityChat = ({
return (
<EmbeddableChat
chat={pi}
availableModels={piModels}
defaultInput={defaultInput}
promptPrefix={promptFrontmatter}
className="h-full"