Skip to content

CanvasAnvil is an open source AI diagram maker and flowchart generator - an infinite-canvas diagram editor and self-hosted drawio alternative that writes editable .drawio files. Text to diagram, then fix nodes, layout and labels in place. Also AI presentations, interior design CAD/BOM, posters and infographics.

refactor(client): give every workspace the same shape and drop the Next.js port

codingFeng1015d9bdf2c46b2
diff --git a/client/app/App.tsx b/client/app/App.tsx
index e3692c8..82f0a45 100644
--- a/client/app/App.tsx
+++ b/client/app/App.tsx
@@ -4,7 +4,7 @@ import { Toaster } from "sonner";
import { BrandIcon } from "@/app/BrandIcon";
import { ErrorBoundary } from "@/app/ErrorBoundary";
import { DEFAULT_WORKSPACE, WORKSPACES, isWorkspaceId, type WorkspaceId } from "@/app/workspaces";
-import { SettingsDialog } from "@/components/SettingsDialog";
+import { SettingsDialog } from "@/app/SettingsDialog";
import { LandingPage } from "@/pages/LandingPage";
import { cn } from "@/shared/lib/utils";
import { t, useUiLanguage } from "@/shared/i18n";
diff --git a/client/components/SettingsDialog.tsx b/client/app/SettingsDialog.tsx
similarity index 100%
rename from client/components/SettingsDialog.tsx
rename to client/app/SettingsDialog.tsx
diff --git a/client/app/workspaces.ts b/client/app/workspaces.ts
index e61765e..f2ae5ff 100644
--- a/client/app/workspaces.ts
+++ b/client/app/workspaces.ts
@@ -29,7 +29,7 @@ export const WORKSPACES: WorkspaceDescriptor[] = [
labelKey: "nav.flow",
icon: Layers,
Component: lazy(() =>
- import("@/workspaces/flow/FlowWorkspaceShell").then((m) => ({ default: m.FlowWorkspaceShell })),
+ import("@/workspaces/flow/FlowWorkspace").then((m) => ({ default: m.FlowWorkspace })),
),
},
{
@@ -37,7 +37,7 @@ export const WORKSPACES: WorkspaceDescriptor[] = [
labelKey: "nav.cad",
icon: FileCode,
Component: lazy(() =>
- import("@/workspaces/cad/CadWorkspaceShell").then((m) => ({ default: m.CadWorkspaceShell })),
+ import("@/workspaces/cad/CadWorkspace").then((m) => ({ default: m.CadWorkspace })),
),
},
{
@@ -45,7 +45,7 @@ export const WORKSPACES: WorkspaceDescriptor[] = [
labelKey: "nav.ppt",
icon: Presentation,
Component: lazy(() =>
- import("@/workspaces/ppt/PptWorkspaceShell").then((m) => ({ default: m.PptWorkspaceShell })),
+ import("@/workspaces/ppt/PptWorkspace").then((m) => ({ default: m.PptWorkspace })),
),
},
];
diff --git a/client/features/ppt-editor/adapters/fromCanvasAnvil.ts b/client/features/ppt-editor/adapters/fromCanvasAnvil.ts
index 752c653..7911a5e 100644
--- a/client/features/ppt-editor/adapters/fromCanvasAnvil.ts
+++ b/client/features/ppt-editor/adapters/fromCanvasAnvil.ts
@@ -3,7 +3,7 @@ import {
textBlocksToPptElements,
type PptElement,
type PptTextBlock,
-} from "@/lib/ppt-service";
+} from "@/workspaces/ppt/lib/ppt-service";
import type {
CanvasAnvilRenderLayerLike,
CanvasAnvilSlideLike,
diff --git a/client/features/ppt-editor/adapters/toCanvasAnvil.ts b/client/features/ppt-editor/adapters/toCanvasAnvil.ts
index b9c924c..e33a226 100644
--- a/client/features/ppt-editor/adapters/toCanvasAnvil.ts
+++ b/client/features/ppt-editor/adapters/toCanvasAnvil.ts
@@ -9,7 +9,7 @@ import {
type PptTableElement,
type PptTextBlock,
type PptVideoElement,
-} from "@/lib/ppt-service";
+} from "@/workspaces/ppt/lib/ppt-service";
import type { CanvasAnvilRenderLayerLike, EditorExportPayload, EditorSlide, EditorTextElement } from "@/features/ppt-editor/types";
export const editorTextElementsToTextBlocks = (elements: EditorTextElement[]): PptTextBlock[] =>
diff --git a/client/features/ppt-editor/components/PptEditorBridge.tsx b/client/features/ppt-editor/components/PptEditorBridge.tsx
index 3d7d438..523e94c 100644
--- a/client/features/ppt-editor/components/PptEditorBridge.tsx
+++ b/client/features/ppt-editor/components/PptEditorBridge.tsx
@@ -1,6 +1,6 @@
import type React from "react";
import { AudioLines, PlayCircle, Sigma } from "lucide-react";
-import { PPT_REFERENCE_SLIDE_HEIGHT, PPT_REFERENCE_SLIDE_WIDTH } from "@/lib/ppt-service";
+import { PPT_REFERENCE_SLIDE_HEIGHT, PPT_REFERENCE_SLIDE_WIDTH } from "@/workspaces/ppt/lib/ppt-service";
import { cn } from "@/shared/lib/utils";
import { buildEditorShapePath } from "@/features/ppt-editor/shape-config";
import type {
diff --git a/client/features/ppt-editor/components/PptReviewBridge.tsx b/client/features/ppt-editor/components/PptReviewBridge.tsx
index 98307ac..22321d6 100644
--- a/client/features/ppt-editor/components/PptReviewBridge.tsx
+++ b/client/features/ppt-editor/components/PptReviewBridge.tsx
@@ -2,7 +2,7 @@ import type React from "react";
import { FileSearch, FileText, Loader2, Play, Trash2 } from "lucide-react";
import { Button } from "@/shared/ui/button";
import { Textarea } from "@/shared/ui/textarea";
-import type { PptTextBlock } from "@/lib/ppt-service";
+import type { PptTextBlock } from "@/workspaces/ppt/lib/ppt-service";
export type ReviewDraftRect = {
startX: number;
diff --git a/client/features/ppt-editor/types.ts b/client/features/ppt-editor/types.ts
index 3291722..3a454bd 100644
--- a/client/features/ppt-editor/types.ts
+++ b/client/features/ppt-editor/types.ts
@@ -1,4 +1,4 @@
-import type { PptElement, PptPage, PptTextBlock } from "@/lib/ppt-service";
+import type { PptElement, PptPage, PptTextBlock } from "@/workspaces/ppt/lib/ppt-service";
import type { EditorShapeType } from "@/features/ppt-editor/shape-config";
export type EditorElementType = "text" | "image" | "shape" | "table" | "chart" | "formula" | "video" | "audio";
diff --git a/client/lib/system-prompts.ts b/client/lib/system-prompts.ts
deleted file mode 100644
index 803f1d2..0000000
--- a/client/lib/system-prompts.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import drawioPrompt from "@prompts/flow/system.md?raw";
-import cadPrompt from "@prompts/cad/system.md?raw";
-import pptOutlinePrompt from "@prompts/ppt/outline.md?raw";
-import pptOutlineEditPrompt from "@prompts/ppt/outline-edit.md?raw";
-import pptSlidesGeneratePrompt from "@prompts/ppt/slides-generate.md?raw";
-import pptSlidesEditPrompt from "@prompts/ppt/system.md?raw";
-
-export const DRAWIO_SYSTEM_PROMPT = drawioPrompt;
-export const CAD_SYSTEM_PROMPT = cadPrompt;
-export const PPT_OUTLINE_SYSTEM_PROMPT = pptOutlinePrompt;
-export const PPT_OUTLINE_EDIT_SYSTEM_PROMPT = pptOutlineEditPrompt;
-export const PPT_SLIDES_GENERATE_SYSTEM_PROMPT = pptSlidesGeneratePrompt;
-export const PPT_SLIDES_EDIT_SYSTEM_PROMPT = pptSlidesEditPrompt;
diff --git a/client/workspaces/flow/next/shims/next-image.tsx b/client/shared/ui/image.tsx
similarity index 71%
rename from client/workspaces/flow/next/shims/next-image.tsx
rename to client/shared/ui/image.tsx
index e9fc4d9..d031d5f 100644
--- a/client/workspaces/flow/next/shims/next-image.tsx
+++ b/client/shared/ui/image.tsx
@@ -1,5 +1,11 @@
import React from "react";
+/**
+ * A plain <img> that also understands `fill`, meaning "cover the positioned
+ * parent". Kept as a component because several callers rely on that one
+ * behaviour; the rest of the props pass straight through.
+ */
+
type ImageProps = React.ImgHTMLAttributes<HTMLImageElement> & {
src: string;
alt: string;
diff --git a/client/workspaces/cad/CadWorkspaceShell.tsx b/client/workspaces/cad/CadWorkspace.tsx
similarity index 99%
rename from client/workspaces/cad/CadWorkspaceShell.tsx
rename to client/workspaces/cad/CadWorkspace.tsx
index 8942f82..60f6c0e 100644
--- a/client/workspaces/cad/CadWorkspaceShell.tsx
+++ b/client/workspaces/cad/CadWorkspace.tsx
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from "react";
import { toast } from "sonner";
import { cn } from "@/shared/lib/utils";
import { t, useUiLanguage } from "@/shared/i18n";
-import { getCadRenderFallbackTitle } from "@/lib/cad-render-titles";
+import { getCadRenderFallbackTitle } from "@/workspaces/cad/lib/render-titles";
import { CAD_ANALYSIS_IMAGES_KEY, CAD_RENDERS_KEY, cadStore } from "@/workspaces/cad/storage";
import {
ResizableHandle,
@@ -10,10 +10,10 @@ import {
ResizablePanelGroup,
type PanelImperativeHandle,
} from "@/shared/ui/resizable";
-import { CAD_SYSTEM_PROMPT } from "@/lib/system-prompts";
+import { CAD_SYSTEM_PROMPT } from "@/workspaces/cad/lib/prompts";
import type { ChatMessage } from "@/ai/client";
import { generateImage } from "@/ai/client";
-import { CadWorkspace } from "@/workspaces/cad/workspace/CadWorkspace";
+import { CadCanvas } from "@/workspaces/cad/canvas/CadCanvas";
import { ChatPanel as CadChatPanel } from "@/workspaces/cad/chat/ChatPanel";
type Attachment = {
@@ -234,7 +234,7 @@ const toPersistableRenderUrl = async (url: string) => {
return raw;
};
-export function CadWorkspaceShell() {
+export function CadWorkspace() {
const uiLang = useUiLanguage();
const tr = (zh: string, en: string) => (uiLang === "zh" ? zh : en);
const initialCadState = (() => {
@@ -1020,7 +1020,7 @@ export function CadWorkspaceShell() {
className={cn("transition-[flex-grow,flex-basis] duration-300 ease-in-out will-change-[flex-grow,flex-basis]")}
>
<div className="h-full w-full relative bg-muted/20">
- <CadWorkspace
+ <CadCanvas
key={`cad-ws-${cadResetTick}-${cadApplyTick}`}
svg2d={cad2dSvg}
onSvgChange={(nextSvg) => {
diff --git a/client/workspaces/cad/workspace/CadWorkspace.tsx b/client/workspaces/cad/canvas/CadCanvas.tsx
similarity index 99%
rename from client/workspaces/cad/workspace/CadWorkspace.tsx
rename to client/workspaces/cad/canvas/CadCanvas.tsx
index 5011419..a3343b3 100644
--- a/client/workspaces/cad/workspace/CadWorkspace.tsx
+++ b/client/workspaces/cad/canvas/CadCanvas.tsx
@@ -10,9 +10,9 @@ import { Button } from "@/shared/ui/button";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/ui/dialog";
import { useUiLanguage } from "@/shared/i18n";
import { toast } from "sonner";
-import { getCadRenderSlotTitles } from "@/lib/cad-render-titles";
+import { getCadRenderSlotTitles } from "@/workspaces/cad/lib/render-titles";
-interface CadWorkspaceProps {
+interface CadCanvasProps {
onAddToChat?: (code: string) => void;
onSvgChange?: (svg: string) => void;
svg2d?: string;
@@ -128,7 +128,7 @@ const isEffectivelyEmptySvg = (text: string) => {
}
};
-export function CadWorkspace({
+export function CadCanvas({
onAddToChat,
onSvgChange,
svg2d,
@@ -139,7 +139,7 @@ export function CadWorkspace({
imagesLoading = false,
bom,
focusPanel,
-}: CadWorkspaceProps) {
+}: CadCanvasProps) {
const [svgContent, setSvgContent] = useState<string | null>(null);
const [isSvgEditorReady, setIsSvgEditorReady] = useState(false);
const [viewMode, setViewMode] = useState<ViewMode>("2d");
diff --git a/client/workspaces/cad/chat/ChatPanel.tsx b/client/workspaces/cad/chat/ChatPanel.tsx
index 1193615..81217b6 100644
--- a/client/workspaces/cad/chat/ChatPanel.tsx
+++ b/client/workspaces/cad/chat/ChatPanel.tsx
@@ -2,7 +2,7 @@ import { useState, useRef, useEffect } from 'react';
import { PanelRightClose, PanelRightOpen } from 'lucide-react';
import { cn } from '@/shared/lib/utils';
import { streamChatMessage, generateChatMessage, ChatMessage, getAIConfig } from '@/ai/client';
-import { DRAWIO_SYSTEM_PROMPT } from '@/lib/system-prompts';
+
import { ButtonWithTooltip } from '@/shared/chat';
import { ChatInput } from '@/shared/chat';
import { ChatMessageDisplay, UIMessage } from '@/workspaces/cad/chat/ChatMessageDisplay';
@@ -15,14 +15,14 @@ import {
buildCadImagesMasterMessages,
buildCadImagesSheetMessages,
buildCadTasksSystemContent,
-} from '@/lib/cad-tasks';
+} from '@/workspaces/cad/lib/tasks';
import {
CAD_PLAN_AGENT_PROMPT,
CAD_SVG_AGENT_ROUTER_PROMPT,
CAD_SVG_FLOW_PATCH_AGENT_PROMPT,
CAD_SVG_FLOW_REPLACE_AGENT_PROMPT,
-} from '@/lib/cad-agents';
-import { getCadRenderFallbackTitle, getCadRenderSlotTitles } from "@/lib/cad-render-titles";
+} from '@/workspaces/cad/lib/agents';
+import { getCadRenderFallbackTitle, getCadRenderSlotTitles } from "@/workspaces/cad/lib/render-titles";
import { t, useUiLanguage } from "@/shared/i18n";
import { toast } from "sonner";
import {
@@ -50,7 +50,7 @@ interface ChatPanelProps {
attachments?: Attachment[];
onRemoveAttachment?: (id: string) => void;
onCodeAction?: (code: string, type: 'flow' | 'cad' | 'ppt') => MaybePromise<void | CodeActionResult>;
- systemPrompt?: string;
+ systemPrompt: string;
initialMessages?: ChatMessage[];
onMessagesChange?: (messages: ChatMessage[]) => void;
chatModel?: string;
@@ -86,7 +86,7 @@ export function ChatPanel({
attachments = [],
onRemoveAttachment,
onCodeAction,
- systemPrompt = DRAWIO_SYSTEM_PROMPT,
+ systemPrompt,
initialMessages = [],
onMessagesChange,
chatModel,
diff --git a/client/lib/cad-agents.ts b/client/workspaces/cad/lib/agents.ts
similarity index 100%
rename from client/lib/cad-agents.ts
rename to client/workspaces/cad/lib/agents.ts
diff --git a/client/workspaces/cad/lib/prompts.ts b/client/workspaces/cad/lib/prompts.ts
new file mode 100644
index 0000000..95808c7
--- /dev/null
+++ b/client/workspaces/cad/lib/prompts.ts
@@ -0,0 +1,4 @@
+import cadSystemPrompt from "@prompts/cad/system.md?raw";
+
+/** The CAD agent's system prompt, authored as markdown under resources/prompts. */
+export const CAD_SYSTEM_PROMPT = cadSystemPrompt;
diff --git a/client/lib/cad-render-titles.ts b/client/workspaces/cad/lib/render-titles.ts
similarity index 100%
rename from client/lib/cad-render-titles.ts
rename to client/workspaces/cad/lib/render-titles.ts
diff --git a/client/lib/cad-tasks.ts b/client/workspaces/cad/lib/tasks.ts
similarity index 100%
rename from client/lib/cad-tasks.ts
rename to client/workspaces/cad/lib/tasks.ts
diff --git a/client/workspaces/flow/next/page.tsx b/client/workspaces/flow/FlowWorkspace.tsx
similarity index 93%
rename from client/workspaces/flow/next/page.tsx
rename to client/workspaces/flow/FlowWorkspace.tsx
index fbc4a5e..08e54af 100644
--- a/client/workspaces/flow/next/page.tsx
+++ b/client/workspaces/flow/FlowWorkspace.tsx
@@ -1,15 +1,14 @@
-"use client"
import { useEffect, useRef, useState } from "react"
import { DrawIoEmbed } from "react-drawio"
-import ChatPanel from "@/workspaces/flow/next/components/chat-panel"
-import { STORAGE_CLOSE_PROTECTION_KEY } from "@/workspaces/flow/next/components/settings-dialog"
+import ChatPanel from "@/workspaces/flow/chat/ChatPanel"
+import { STORAGE_CLOSE_PROTECTION_KEY } from "@/workspaces/flow/chat/settings-dialog"
import {
ResizableHandle,
ResizablePanel,
ResizablePanelGroup,
type PanelImperativeHandle,
} from "@/shared/ui/resizable"
-import { useDiagram } from "@/workspaces/flow/next/contexts/diagram-context"
+import { DiagramProvider, useDiagram } from "@/workspaces/flow/state/diagram-context"
const drawioBaseUrl =
(typeof import.meta !== "undefined" &&
@@ -18,7 +17,7 @@ const drawioBaseUrl =
? String(import.meta.env.VITE_DRAWIO_BASE_URL)
: "") || "https://embed.diagrams.net"
-export default function Home() {
+function FlowCanvas() {
const { drawioRef, handleDiagramExport, onDrawioLoad, resetDrawioReady } =
useDiagram()
const [isMobile, setIsMobile] = useState(false)
@@ -203,3 +202,17 @@ export default function Home() {
</div>
)
}
+
+/**
+ * The Flow workspace: a draw.io canvas beside its chat panel.
+ *
+ * The diagram context wraps the pair because both halves read and write
+ * the same XML — the chat panel proposes edits, the canvas applies them.
+ */
+export function FlowWorkspace() {
+ return (
+ <DiagramProvider>
+ <FlowCanvas />
+ </DiagramProvider>
+ );
+}
diff --git a/client/workspaces/flow/FlowWorkspaceShell.tsx b/client/workspaces/flow/FlowWorkspaceShell.tsx
deleted file mode 100644
index 220b385..0000000
--- a/client/workspaces/flow/FlowWorkspaceShell.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { NextFlowWorkspace } from "@/workspaces/flow/next/NextFlowWorkspace";
-
-export function FlowWorkspaceShell() {
- return <NextFlowWorkspace />;
-}
diff --git a/client/workspaces/flow/next/components/chat-input.tsx b/client/workspaces/flow/chat/ChatInput.tsx
similarity index 97%
rename from client/workspaces/flow/next/components/chat-input.tsx
rename to client/workspaces/flow/chat/ChatInput.tsx
index ee68b3d..5a8a363 100644
--- a/client/workspaces/flow/next/components/chat-input.tsx
+++ b/client/workspaces/flow/chat/ChatInput.tsx
@@ -14,14 +14,14 @@ import type React from "react"
import { useCallback, useEffect, useRef, useState } from "react"
import { toast } from "sonner"
import { ButtonWithTooltip } from "@/shared/chat"
-import { ErrorToast } from "@/workspaces/flow/next/components/error-toast"
+import { ErrorToast } from "@/workspaces/flow/chat/error-toast"
import { GlobalConstraintsDialog } from "@/shared/chat"
-import { FLOW_GLOBAL_CONSTRAINTS_KEY } from "@/workspaces/flow/next/lib/flow-storage-keys"
-import { HistoryDialog } from "@/workspaces/flow/next/components/history-dialog"
+import { STORAGE_KEYS } from "@/workspaces/flow/lib/storage";
+import { HistoryDialog } from "@/workspaces/flow/chat/history-dialog"
import { ResetWarningModal } from "@/shared/chat"
import { Textarea } from "@/shared/ui/textarea"
-import { useDiagram } from "@/workspaces/flow/next/contexts/diagram-context"
-import { useFlowT } from "@/workspaces/flow/next/lib/translations"
+import { useDiagram } from "@/workspaces/flow/state/diagram-context"
+import { useFlowT } from "@/workspaces/flow/lib/translations"
import { isPdfFile, isTextFile } from "@/shared/files"
import { FilePreviewList } from "@/shared/chat"
@@ -409,7 +409,7 @@ export function ChatInput({
open={showConstraintsDialog}
onOpenChange={setShowConstraintsDialog}
workspaceId="flow"
- storageKey={FLOW_GLOBAL_CONSTRAINTS_KEY}
+ storageKey={STORAGE_KEYS.globalConstraints}
/>
<HistoryDialog
diff --git a/client/workspaces/flow/next/components/chat-message-display.tsx b/client/workspaces/flow/chat/ChatMessageDisplay.tsx
similarity index 99%
rename from client/workspaces/flow/next/components/chat-message-display.tsx
rename to client/workspaces/flow/chat/ChatMessageDisplay.tsx
index cd721bc..bc02da6 100644
--- a/client/workspaces/flow/next/components/chat-message-display.tsx
+++ b/client/workspaces/flow/chat/ChatMessageDisplay.tsx
@@ -32,7 +32,7 @@ import {
RotateCcw,
X,
} from "lucide-react"
-import Image from "@/workspaces/flow/next/shims/next-image"
+import Image from "@/shared/ui/image"
import type { MutableRefObject } from "react"
import { Fragment, useCallback, useEffect, useRef, useState } from "react"
import ReactMarkdown from "react-markdown"
@@ -42,13 +42,13 @@ import {
ReasoningTrigger,
} from "@/shared/chat"
import { ScrollArea } from "@/shared/ui/scroll-area"
-import { useFlowT } from "@/workspaces/flow/next/lib/translations"
+import { useFlowT } from "@/workspaces/flow/lib/translations"
import {
applyDiagramOperations,
isMxCellXmlComplete,
type DiagramOperation,
-} from "@/workspaces/flow/next/lib/diagram-operations"
-import { convertToLegalXml, replaceNodes, validateMxCellStructure } from "@/workspaces/flow/next/lib/drawio-xml"
+} from "@/workspaces/flow/lib/diagram-operations"
+import { convertToLegalXml, replaceNodes, validateMxCellStructure } from "@/workspaces/flow/lib/drawio-xml"
import { CodeBlock } from "./code-block"
// Tool part interface for type safety
@@ -89,7 +89,7 @@ function OperationsDisplay({ operations }: { operations: DiagramOperation[] }) {
)
}
-import { useDiagram } from "@/workspaces/flow/next/contexts/diagram-context"
+import { useDiagram } from "@/workspaces/flow/state/diagram-context"
// Helper to split text content into regular text and file sections (PDF or text files)
interface TextSection {
diff --git a/client/workspaces/flow/next/components/chat-panel.tsx b/client/workspaces/flow/chat/ChatPanel.tsx
similarity index 98%
rename from client/workspaces/flow/next/components/chat-panel.tsx
rename to client/workspaces/flow/chat/ChatPanel.tsx
index 7c8b638..39b4895 100644
--- a/client/workspaces/flow/next/components/chat-panel.tsx
+++ b/client/workspaces/flow/chat/ChatPanel.tsx
@@ -9,11 +9,11 @@ import type React from "react"
import { useCallback, useEffect, useRef, useState } from "react"
import { Toaster, toast } from "sonner"
import { ButtonWithTooltip } from "@/shared/chat"
-import { ChatInput } from "@/workspaces/flow/next/components/chat-input"
-import { FLOW_GLOBAL_CONSTRAINTS_KEY } from "@/workspaces/flow/next/lib/flow-storage-keys"
-import { useDiagram } from "@/workspaces/flow/next/contexts/diagram-context"
-import { useFlowT } from "@/workspaces/flow/next/lib/translations"
-import { getAIConfig } from "@/workspaces/flow/next/lib/ai-config"
+import { ChatInput } from "@/workspaces/flow/chat/ChatInput"
+import { STORAGE_KEYS } from "@/workspaces/flow/lib/storage";
+import { useDiagram } from "@/workspaces/flow/state/diagram-context"
+import { useFlowT } from "@/workspaces/flow/lib/translations"
+import { getAIConfig } from "@/workspaces/flow/lib/ai-config"
import {
extractPdfText,
extractWordText,
@@ -23,10 +23,10 @@ import {
isTextFile,
} from "@/shared/files"
import { type FileData, useFileProcessor } from "@/shared/files/use-file-processor"
-import { useQuotaManager } from "@/workspaces/flow/next/lib/use-quota-manager"
-import { applyDiagramOperations, isMxCellXmlComplete, type DiagramOperation } from "@/workspaces/flow/next/lib/diagram-operations"
-import { formatXML, validateAndFixXml, wrapWithMxFile } from "@/workspaces/flow/next/lib/drawio-xml"
-import { ChatMessageDisplay } from "./chat-message-display"
+import { useQuotaManager } from "@/workspaces/flow/lib/use-quota-manager"
+import { applyDiagramOperations, isMxCellXmlComplete, type DiagramOperation } from "@/workspaces/flow/lib/diagram-operations"
+import { formatXML, validateAndFixXml, wrapWithMxFile } from "@/workspaces/flow/lib/drawio-xml"
+import { ChatMessageDisplay } from "./ChatMessageDisplay"
// localStorage keys for persistence
const STORAGE_MESSAGES_KEY = "next-ai-draw-io-messages"
@@ -975,7 +975,7 @@ Please fix the XML issues. Ensure cell_id values exist in the current XML and th
const { accessCode, ai } = getAIConfig()
const modelToUse = String(ai.textModel || defaultModel || "").trim()
const imageModelToUse = String(ai.imageModel || "").trim()
- const globalConstraints = localStorage.getItem(FLOW_GLOBAL_CONSTRAINTS_KEY) || ""
+ const globalConstraints = localStorage.getItem(STORAGE_KEYS.globalConstraints) || ""
// Safe parts access
const safeParts = Array.isArray(parts) ? parts : []
diff --git a/client/workspaces/flow/next/components/code-block.tsx b/client/workspaces/flow/chat/code-block.tsx
similarity index 100%
rename from client/workspaces/flow/next/components/code-block.tsx
rename to client/workspaces/flow/chat/code-block.tsx
diff --git a/client/workspaces/flow/next/components/error-toast.tsx b/client/workspaces/flow/chat/error-toast.tsx
similarity index 100%
rename from client/workspaces/flow/next/components/error-toast.tsx
rename to client/workspaces/flow/chat/error-toast.tsx
diff --git a/client/workspaces/flow/next/components/history-dialog.tsx b/client/workspaces/flow/chat/history-dialog.tsx
similarity index 95%
rename from client/workspaces/flow/next/components/history-dialog.tsx
rename to client/workspaces/flow/chat/history-dialog.tsx
index 23e8405..dcdc859 100644
--- a/client/workspaces/flow/next/components/history-dialog.tsx
+++ b/client/workspaces/flow/chat/history-dialog.tsx
@@ -1,6 +1,6 @@
"use client"
-import Image from "@/workspaces/flow/next/shims/next-image"
+import Image from "@/shared/ui/image"
import { useState } from "react"
import { Button } from "@/shared/ui/button"
import {
@@ -10,8 +10,8 @@ import {
DialogHeader,
DialogTitle,
} from "@/shared/ui/dialog"
-import { useDiagram } from "@/workspaces/flow/next/contexts/diagram-context"
-import { useFlowT } from "@/workspaces/flow/next/lib/translations"
+import { useDiagram } from "@/workspaces/flow/state/diagram-context"
+import { useFlowT } from "@/workspaces/flow/lib/translations"
interface HistoryDialogProps {
showHistory: boolean
diff --git a/client/workspaces/flow/next/components/quota-limit-toast.tsx b/client/workspaces/flow/chat/quota-limit-toast.tsx
similarity index 97%
rename from client/workspaces/flow/next/components/quota-limit-toast.tsx
rename to client/workspaces/flow/chat/quota-limit-toast.tsx
index 1b9b75c..31d5bc1 100644
--- a/client/workspaces/flow/next/components/quota-limit-toast.tsx
+++ b/client/workspaces/flow/chat/quota-limit-toast.tsx
@@ -1,7 +1,7 @@
"use client"
import { FaCoffee } from "react-icons/fa"
-import { useFlowT } from "@/workspaces/flow/next/lib/translations"
+import { useFlowT } from "@/workspaces/flow/lib/translations"
interface QuotaLimitToastProps {
limit: number
diff --git a/client/workspaces/flow/next/components/save-dialog.tsx b/client/workspaces/flow/chat/save-dialog.tsx
similarity index 98%
rename from client/workspaces/flow/next/components/save-dialog.tsx
rename to client/workspaces/flow/chat/save-dialog.tsx
index 3e9697d..ffe5a51 100644
--- a/client/workspaces/flow/next/components/save-dialog.tsx
+++ b/client/workspaces/flow/chat/save-dialog.tsx
@@ -17,7 +17,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/shared/ui/select"
-import { useFlowT } from "@/workspaces/flow/next/lib/translations"
+import { useFlowT } from "@/workspaces/flow/lib/translations"
export type ExportFormat = "drawio" | "png" | "svg"
diff --git a/client/workspaces/flow/next/components/settings-dialog.tsx b/client/workspaces/flow/chat/settings-dialog.tsx
similarity index 99%
rename from client/workspaces/flow/next/components/settings-dialog.tsx
rename to client/workspaces/flow/chat/settings-dialog.tsx
index f29b6c6..398cb9c 100644
--- a/client/workspaces/flow/next/components/settings-dialog.tsx
+++ b/client/workspaces/flow/chat/settings-dialog.tsx
@@ -14,7 +14,7 @@ import {
import { Input } from "@/shared/ui/input"
import { Label } from "@/shared/ui/label"
import { Switch } from "@/shared/ui/switch"
-import { useFlowT } from "@/workspaces/flow/next/lib/translations"
+import { useFlowT } from "@/workspaces/flow/lib/translations"
interface SettingsDialogProps {
open: boolean
diff --git a/client/workspaces/flow/next/lib/ai-config.ts b/client/workspaces/flow/lib/ai-config.ts
similarity index 91%
rename from client/workspaces/flow/next/lib/ai-config.ts
rename to client/workspaces/flow/lib/ai-config.ts
index 166d9ca..620b8b8 100644
--- a/client/workspaces/flow/next/lib/ai-config.ts
+++ b/client/workspaces/flow/lib/ai-config.ts
@@ -1,4 +1,4 @@
-import { STORAGE_KEYS } from "@/workspaces/flow/next/lib/storage"
+import { STORAGE_KEYS } from "@/workspaces/flow/lib/storage"
import { DEFAULT_AI_CONFIG } from "@contracts/ai";
import { getAIConfig as getWorkspaceAIConfig } from "@/ai/storage";
import type { AIConfig } from "@contracts/ai"
diff --git a/client/workspaces/flow/next/lib/diagram-operations.ts b/client/workspaces/flow/lib/diagram-operations.ts
similarity index 100%
rename from client/workspaces/flow/next/lib/diagram-operations.ts
rename to client/workspaces/flow/lib/diagram-operations.ts
diff --git a/client/workspaces/flow/next/lib/drawio-xml.ts b/client/workspaces/flow/lib/drawio-xml.ts
similarity index 100%
rename from client/workspaces/flow/next/lib/drawio-xml.ts
rename to client/workspaces/flow/lib/drawio-xml.ts
diff --git a/client/workspaces/flow/next/lib/storage.ts b/client/workspaces/flow/lib/storage.ts
similarity index 74%
rename from client/workspaces/flow/next/lib/storage.ts
rename to client/workspaces/flow/lib/storage.ts
index f717718..afd025d 100644
--- a/client/workspaces/flow/next/lib/storage.ts
+++ b/client/workspaces/flow/lib/storage.ts
@@ -1,5 +1,10 @@
-// Centralized localStorage keys
-// Consolidates all storage keys from chat-panel.tsx and settings-dialog.tsx
+/**
+ * Every localStorage key the Flow workspace uses.
+ *
+ * The names keep their original "next-ai-draw-io-" prefix from before this
+ * workspace was folded into CanvasAnvil: renaming one would orphan whatever a
+ * user had saved under it.
+ */
export const STORAGE_KEYS = {
// Chat data
@@ -17,6 +22,7 @@ export const STORAGE_KEYS = {
tpmMinute: "next-ai-draw-io-tpm-minute",
// Settings
+ globalConstraints: "next-ai-draw-io-global-constraints",
accessCode: "next-ai-draw-io-access-code",
closeProtection: "next-ai-draw-io-close-protection",
accessCodeRequired: "next-ai-draw-io-access-code-required",
diff --git a/client/workspaces/flow/next/lib/translations.ts b/client/workspaces/flow/lib/translations.ts
similarity index 100%
rename from client/workspaces/flow/next/lib/translations.ts
rename to client/workspaces/flow/lib/translations.ts
diff --git a/client/workspaces/flow/next/lib/use-quota-manager.tsx b/client/workspaces/flow/lib/use-quota-manager.tsx
similarity index 98%
rename from client/workspaces/flow/next/lib/use-quota-manager.tsx
rename to client/workspaces/flow/lib/use-quota-manager.tsx
index 823892c..202765f 100644
--- a/client/workspaces/flow/next/lib/use-quota-manager.tsx
+++ b/client/workspaces/flow/lib/use-quota-manager.tsx
@@ -2,8 +2,8 @@
import { useCallback, useMemo } from "react"
import { toast } from "sonner"
-import { QuotaLimitToast } from "@/workspaces/flow/next/components/quota-limit-toast"
-import { STORAGE_KEYS } from "@/workspaces/flow/next/lib/storage"
+import { QuotaLimitToast } from "@/workspaces/flow/chat/quota-limit-toast"
+import { STORAGE_KEYS } from "@/workspaces/flow/lib/storage"
export interface QuotaConfig {
dailyRequestLimit: number
diff --git a/client/workspaces/flow/next/NextFlowWorkspace.tsx b/client/workspaces/flow/next/NextFlowWorkspace.tsx
deleted file mode 100644
index 36f8e6d..0000000
--- a/client/workspaces/flow/next/NextFlowWorkspace.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import FlowPage from "@/workspaces/flow/next/page";
-import { DiagramProvider } from "@/workspaces/flow/next/contexts/diagram-context";
-
-export function NextFlowWorkspace() {
- return (
- <DiagramProvider>
- <FlowPage />
- </DiagramProvider>
- );
-}
diff --git a/client/workspaces/flow/next/lib/flow-storage-keys.ts b/client/workspaces/flow/next/lib/flow-storage-keys.ts
deleted file mode 100644
index 69225b4..0000000
--- a/client/workspaces/flow/next/lib/flow-storage-keys.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * localStorage keys the Flow workspace shipped with. They keep their original
- * names so existing users do not silently lose what they saved.
- */
-export const FLOW_GLOBAL_CONSTRAINTS_KEY = "next-ai-draw-io-global-constraints"
diff --git a/client/workspaces/flow/next/contexts/diagram-context.tsx b/client/workspaces/flow/state/diagram-context.tsx
similarity index 98%
rename from client/workspaces/flow/next/contexts/diagram-context.tsx
rename to client/workspaces/flow/state/diagram-context.tsx
index 9acb2d0..3055ebb 100644
--- a/client/workspaces/flow/next/contexts/diagram-context.tsx
+++ b/client/workspaces/flow/state/diagram-context.tsx
@@ -3,9 +3,9 @@
import type React from "react"
import { createContext, useContext, useRef, useState } from "react"
import type { DrawIoEmbedRef } from "react-drawio"
-import { STORAGE_DIAGRAM_XML_KEY } from "@/workspaces/flow/next/components/chat-panel"
-import type { ExportFormat } from "@/workspaces/flow/next/components/save-dialog"
-import { extractDiagramXML, validateMxCellStructure } from "@/workspaces/flow/next/lib/drawio-xml"
+import { STORAGE_DIAGRAM_XML_KEY } from "@/workspaces/flow/chat/ChatPanel"
+import type { ExportFormat } from "@/workspaces/flow/chat/save-dialog"
+import { extractDiagramXML, validateMxCellStructure } from "@/workspaces/flow/lib/drawio-xml"
interface DiagramContextType {
chartXML: string
diff --git a/client/workspaces/ppt/PptWorkspaceShell.tsx b/client/workspaces/ppt/PptWorkspace.tsx
similarity index 97%
rename from client/workspaces/ppt/PptWorkspaceShell.tsx
rename to client/workspaces/ppt/PptWorkspace.tsx
index a2140eb..f6cf796 100644
--- a/client/workspaces/ppt/PptWorkspaceShell.tsx
+++ b/client/workspaces/ppt/PptWorkspace.tsx
@@ -7,13 +7,10 @@ import {
ResizablePanelGroup,
type PanelImperativeHandle,
} from "@/shared/ui/resizable";
-import {
- PPT_OUTLINE_EDIT_SYSTEM_PROMPT,
- PPT_SLIDES_EDIT_SYSTEM_PROMPT,
-} from "@/lib/system-prompts";
+import { PPT_OUTLINE_EDIT_SYSTEM_PROMPT, PPT_SLIDES_EDIT_SYSTEM_PROMPT } from "@/workspaces/ppt/lib/prompts";
import { PPT_STATE_KEY, PPT_WORKSPACE_STORAGE_KEY, pptStore } from "@/workspaces/ppt/storage";
import type { ChatMessage } from "@/ai/client";
-import { PptWorkspace } from "@/workspaces/ppt/workspace/PptWorkspace";
+import { PptCanvas } from "@/workspaces/ppt/canvas/PptCanvas";
import { ChatPanel as PptChatPanel } from "@/workspaces/ppt/chat/ChatPanel";
import type { HistoryItem } from "@/shared/chat";
@@ -30,7 +27,7 @@ const PPT_RETURN_STAGE_STORAGE_KEY = "CanvasAnvil-ppt-return-stage-v1";
const PPT_HISTORY_STORAGE_KEY = "CanvasAnvil-history-ppt-v1";
const PPT_CHAT_STORAGE_KEY = "chat_history_v2_ppt";
-export function PptWorkspaceShell() {
+export function PptWorkspace() {
const uiLang = useUiLanguage();
const didMountRef = useRef(false);
const [attachments, setAttachments] = useState<Attachment[]>([]);
@@ -272,7 +269,7 @@ export function PptWorkspaceShell() {
className={cn("transition-[flex-grow,flex-basis] duration-300 ease-in-out will-change-[flex-grow,flex-basis]")}
>
<div className="h-full w-full relative bg-muted/20">
- <PptWorkspace
+ <PptCanvas
key={`ppt-${pptResetTick}`}
onAddToChat={handleAddToChat}
onPptReadyChange={setPptReady}
diff --git a/client/workspaces/ppt/workspace/PptWorkspace.tsx b/client/workspaces/ppt/canvas/PptCanvas.tsx
similarity index 99%
rename from client/workspaces/ppt/workspace/PptWorkspace.tsx
rename to client/workspaces/ppt/canvas/PptCanvas.tsx
index 3d22cc3..ed4a437 100644
--- a/client/workspaces/ppt/workspace/PptWorkspace.tsx
+++ b/client/workspaces/ppt/canvas/PptCanvas.tsx
@@ -8,8 +8,8 @@ import {
type SlideEditRoutingItem,
PPT_REFERENCE_SLIDE_HEIGHT,
PPT_REFERENCE_SLIDE_WIDTH,
-} from '@/lib/ppt-service';
-import { getTemplateGenerationPrompt } from '@/lib/ppt-prompts';
+} from '@/workspaces/ppt/lib/ppt-service';
+import { getTemplateGenerationPrompt } from '@/workspaces/ppt/lib/ppt-prompts';
import { PPT_STATE_KEY, PPT_TEMPLATE_LIBRARY_KEY, PPT_WORKSPACE_STORAGE_KEY, pptStore } from "@/workspaces/ppt/storage";
import {
Loader2,
@@ -52,7 +52,7 @@ import {
REVIEW_BOX_COLOR,
REVIEW_BOX_SELECTED_COLOR,
SYNTHETIC_PRIMARY_VERSION_PREFIX,
-} from "@/workspaces/ppt/workspace/constants";
+} from "@/workspaces/ppt/canvas/constants";
import {
deriveTextElementsFromBlocks,
hasRenderableTextBlocks,
@@ -61,7 +61,7 @@ import {
normalizeLocalizedSlideTitle,
parseSlideNo,
stripLeadingBullet,
-} from "@/workspaces/ppt/workspace/slide-content";
+} from "@/workspaces/ppt/canvas/slide-content";
import {
filterRecordByAllowedKeys,
migrateLegacyTextlessVersions,
@@ -77,7 +77,7 @@ import {
readLegacyHiddenPresetTemplateIds,
readLegacyUploadedTemplates,
shouldInlinePersistImageUrl,
-} from "@/workspaces/ppt/workspace/persisted-state";
+} from "@/workspaces/ppt/canvas/persisted-state";
import type {
CreationMode,
CreationStep,
@@ -94,9 +94,9 @@ import type {
SlideRenderLayer,
TemplateItem,
UploadTemplate,
-} from "@/workspaces/ppt/workspace/types";
+} from "@/workspaces/ppt/canvas/types";
-interface PptWorkspaceProps {
+interface PptCanvasProps {
data?: PptData;
onAddToChat?: (json: string, name: string) => void;
onPptReadyChange?: (ready: boolean) => void;
@@ -108,7 +108,7 @@ interface PptWorkspaceProps {
onResetWorkspace?: () => void;
}
-export function PptWorkspace({
+export function PptCanvas({
data,
onAddToChat,
onPptReadyChange,
@@ -118,7 +118,7 @@ export function PptWorkspace({
incomingEdit,
onIncomingEditHandled,
onResetWorkspace
-}: PptWorkspaceProps) {
+}: PptCanvasProps) {
const uiLang = useUiLanguage();
const tr = (zh: string, en: string) => (uiLang === "zh" ? zh : en);
const initialPptStateRef = useRef<any>(undefined);
diff --git a/client/workspaces/ppt/workspace/constants.ts b/client/workspaces/ppt/canvas/constants.ts
similarity index 95%
rename from client/workspaces/ppt/workspace/constants.ts
rename to client/workspaces/ppt/canvas/constants.ts
index 712fe4d..c056959 100644
--- a/client/workspaces/ppt/workspace/constants.ts
+++ b/client/workspaces/ppt/canvas/constants.ts
@@ -1,4 +1,4 @@
-import type { PresetTemplate } from "@/workspaces/ppt/workspace/types";
+import type { PresetTemplate } from "@/workspaces/ppt/canvas/types";
/** Marks a version synthesised from a slide that had no explicit version yet. */
export const SYNTHETIC_PRIMARY_VERSION_PREFIX = "synthetic-primary:";
diff --git a/client/workspaces/ppt/workspace/persisted-state.ts b/client/workspaces/ppt/canvas/persisted-state.ts
similarity index 98%
rename from client/workspaces/ppt/workspace/persisted-state.ts
rename to client/workspaces/ppt/canvas/persisted-state.ts
index 2755d64..b1aced2 100644
--- a/client/workspaces/ppt/workspace/persisted-state.ts
+++ b/client/workspaces/ppt/canvas/persisted-state.ts
@@ -1,12 +1,12 @@
-import { PPT_TEMPLATE_HIDDEN_PRESETS_KEY, PPT_TEMPLATE_UPLOADS_KEY } from "@/workspaces/ppt/workspace/constants";
-import { deriveTextElementsFromBlocks, hasRenderableTextBlocks } from "@/workspaces/ppt/workspace/slide-content";
+import { PPT_TEMPLATE_HIDDEN_PRESETS_KEY, PPT_TEMPLATE_UPLOADS_KEY } from "@/workspaces/ppt/canvas/constants";
+import { deriveTextElementsFromBlocks, hasRenderableTextBlocks } from "@/workspaces/ppt/canvas/slide-content";
import type {
SlideData,
SlideImageVersion,
SlideMaterialImage,
SlideRenderLayer,
UploadTemplate,
-} from "@/workspaces/ppt/workspace/types";
+} from "@/workspaces/ppt/canvas/types";
/**
* Reading the workspace back from storage.
diff --git a/client/workspaces/ppt/workspace/slide-content.ts b/client/workspaces/ppt/canvas/slide-content.ts
similarity index 96%
rename from client/workspaces/ppt/workspace/slide-content.ts
rename to client/workspaces/ppt/canvas/slide-content.ts
index 02a2b02..bfe1241 100644
--- a/client/workspaces/ppt/workspace/slide-content.ts
+++ b/client/workspaces/ppt/canvas/slide-content.ts
@@ -1,5 +1,5 @@
-import { textBlocksToPptElements, type PptElement, type PptTextBlock } from "@/lib/ppt-service";
-import type { SlideRenderLayer } from "@/workspaces/ppt/workspace/types";
+import { textBlocksToPptElements, type PptElement, type PptTextBlock } from "@/workspaces/ppt/lib/ppt-service";
+import type { SlideRenderLayer } from "@/workspaces/ppt/canvas/types";
/** Text-shape helpers: bullets, layout hints, and slide-title normalisation. */
diff --git a/client/workspaces/ppt/workspace/types.ts b/client/workspaces/ppt/canvas/types.ts
similarity index 96%
rename from client/workspaces/ppt/workspace/types.ts
rename to client/workspaces/ppt/canvas/types.ts
index eb6fe2d..35b47f3 100644
--- a/client/workspaces/ppt/workspace/types.ts
+++ b/client/workspaces/ppt/canvas/types.ts
@@ -1,4 +1,4 @@
-import type { PptElement, PptTextBlock } from "@/lib/ppt-service";
+import type { PptElement, PptTextBlock } from "@/workspaces/ppt/lib/ppt-service";
/** The PPT workspace's own model of a deck, its slides, and their versions. */
diff --git a/client/workspaces/ppt/chat/ChatPanel.tsx b/client/workspaces/ppt/chat/ChatPanel.tsx
index ba69e69..557f3f4 100644
--- a/client/workspaces/ppt/chat/ChatPanel.tsx
+++ b/client/workspaces/ppt/chat/ChatPanel.tsx
@@ -2,7 +2,7 @@ import { useState, useRef, useEffect } from 'react';
import { PanelRightClose, PanelRightOpen } from 'lucide-react';
import { cn } from '@/shared/lib/utils';
import { streamChatMessage, generatePptProxyChatMessage, ChatMessage, getAIConfig } from '@/ai/client';
-import { DRAWIO_SYSTEM_PROMPT } from '@/lib/system-prompts';
+
import { ButtonWithTooltip } from '@/shared/chat';
import { ChatInput } from '@/shared/chat';
import { chatStorageKey, loadChatHistory, saveChatHistory } from '@/shared/chat/chat-storage';
@@ -32,7 +32,7 @@ interface ChatPanelProps {
pptDraftSlides?: Array<{ id: string; slideId: string; title: string; json: string; kind: "outline" | "slide_image"; imageUrl?: string }>;
onClearPptDraftSlides?: () => void;
onCodeAction?: (code: string, type: 'flow' | 'cad' | 'ppt') => MaybePromise<void | CodeActionResult>;
- systemPrompt?: string;
+ systemPrompt: string;
initialMessages?: ChatMessage[];
onMessagesChange?: (messages: ChatMessage[]) => void;
chatModel?: string;
@@ -68,7 +68,7 @@ export function ChatPanel({
pptDraftSlides = [],
onClearPptDraftSlides,
onCodeAction,
- systemPrompt = DRAWIO_SYSTEM_PROMPT,
+ systemPrompt,
initialMessages = [],
onMessagesChange,
chatModel,
diff --git a/client/lib/ppt-prompts.ts b/client/workspaces/ppt/lib/ppt-prompts.ts
similarity index 100%
rename from client/lib/ppt-prompts.ts
rename to client/workspaces/ppt/lib/ppt-prompts.ts
diff --git a/client/lib/ppt-service.ts b/client/workspaces/ppt/lib/ppt-service.ts
similarity index 100%
rename from client/lib/ppt-service.ts
rename to client/workspaces/ppt/lib/ppt-service.ts
diff --git a/client/workspaces/ppt/lib/prompts.ts b/client/workspaces/ppt/lib/prompts.ts
new file mode 100644
index 0000000..a6abea2
--- /dev/null
+++ b/client/workspaces/ppt/lib/prompts.ts
@@ -0,0 +1,9 @@
+import outlineEditPrompt from "@prompts/ppt/outline-edit.md?raw";
+import slidesEditPrompt from "@prompts/ppt/system.md?raw";
+
+/**
+ * The two prompts the PPT chat panel switches between: one for editing the
+ * outline, one for editing generated slides.
+ */
+export const PPT_OUTLINE_EDIT_SYSTEM_PROMPT = outlineEditPrompt;
+export const PPT_SLIDES_EDIT_SYSTEM_PROMPT = slidesEditPrompt;
diff --git a/client/lib/risen-prompt.ts b/client/workspaces/ppt/lib/risen-prompt.ts
similarity index 100%
rename from client/lib/risen-prompt.ts
rename to client/workspaces/ppt/lib/risen-prompt.ts