Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions PLANNING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Plan Mode (Read-only)

# Plan Mode Policy

Plan mode is a special operating mode that allows research, analysis, and planning without making any changes to your system or codebase.

## What You Can Do
- Read files and examine code
- Search through the codebase
- Analyze project structure and dependencies
- Review documentation and external sources
- Propose strategies and implementation plans

## What You Cannot Do
- Edit files or apply patches
- Run bash commands that modify anything
- Create or delete files
- Make git commits or push branches
- Install packages or change configurations

## Workflow When Plan Mode Is Active
1) Research Phase: Gather necessary information using read-only tools
2) Plan Creation: Develop a clear, step-by-step implementation plan
3) Plan Presentation: Present the plan and ask for approval (use exit_plan_mode when ready)
4) User Approval: Wait for explicit approval
5) Execution Phase: Only after approval should changes be made

Note: If you detect the user wants to plan before executing, remain in plan mode and avoid making changes.
4 changes: 2 additions & 2 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function createWindow() {

mainWindow.webContents.on(
"did-fail-load",
(event, errorCode, errorDescription) => {
(_event, errorCode, errorDescription) => {
console.error("Failed to load:", errorCode, errorDescription);
},
);
Expand All @@ -57,7 +57,7 @@ async function createWindow() {
ipcMain.handle(
"find-similar-chunks",
async (
event,
_event,
queryText: string,
limit?: number,
distanceThreshold?: number,
Expand Down
37 changes: 1 addition & 36 deletions src/ui/components/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ const MODELS = {

type ModelType = (typeof MODELS)[keyof typeof MODELS];

interface ModelConfig {
id: ModelType;
name: string;
displayName: string;
}

const MODEL_CONFIGS: ModelConfig[] = [
{ id: MODELS.LLAMA2, name: "llama2", displayName: "Llama 2" },
{ id: MODELS.LLAMA3, name: "llama3.2:3b", displayName: "Llama 3" },
];

export default function Chat({ onSetupComplete }: ChatProps) {
const [messages, setMessages] = useState<Message[]>([]);
const [input, setInput] = useState("");
Expand All @@ -66,8 +55,7 @@ export default function Chat({ onSetupComplete }: ChatProps) {
running: false,
});
const [currentResponse, setCurrentResponse] = useState("");
const [showInstructions, setShowInstructions] = useState(false);
const [selectedModel, setSelectedModel] = useState<ModelType>(MODELS.LLAMA3);
const [selectedModel] = useState<ModelType>(MODELS.LLAMA3);
const [isStarting, setIsStarting] = useState(false);
const [showInfo, setShowInfo] = useState(false);
const noteReferences: Record<string, NoteReference> = {};
Expand Down Expand Up @@ -152,29 +140,6 @@ export default function Chat({ onSetupComplete }: ChatProps) {
}
};

const handlePullModel = async () => {
try {
setIsLoading(true);
await window.electron.pullOllamaModel(selectedModel);
setOllamaStatus({ running: true, modelAvailable: true });
} catch (error) {
console.error(`Failed to pull ${selectedModel} model:`, error);
setOllamaStatus((prev) => ({ ...prev, error: undefined }));
} finally {
setIsLoading(false);
}
};

useEffect(() => {
const handleToggleInstructions = () => setShowInstructions((prev) => !prev);
window.addEventListener("toggleInstructions", handleToggleInstructions);
return () =>
window.removeEventListener(
"toggleInstructions",
handleToggleInstructions
);
}, []);

const generateResponse = async (
prompt: string,
onProgress: (text: string) => void
Expand Down
2 changes: 0 additions & 2 deletions src/ui/components/SparkleIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from "react";

interface SparkleIconProps {
className?: string;
}
Expand Down
1 change: 0 additions & 1 deletion src/ui/components/Spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { motion } from "framer-motion";
import React from "react";

const Spinner = () => (
<motion.div
Expand Down