Skip to content
Merged
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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ A tool for quickly assembling Large Language Model (LLM) prompts from a local fi
- **Meta Prompt Management**: Store and retrieve partial prompts (meta prompts) in a dedicated directory.
- **AI-Powered Features**: Smart file selection and prompt refinement using LLMs (requires OpenRouter API key).
- **Task Management**: Integrated Kanban board, To-Do list, and User Story management.
- **Actor Definition**: Define and manage project actors, with AI-assisted suggestions.
- **Copy to Clipboard**: Gather your meta prompt, main instructions, project tree, and selected file contents in one click.
- **Cross-Platform**: Built with Electron for Linux, macOS, and Windows compatibility.

Expand Down Expand Up @@ -189,7 +188,7 @@ A summary of passed/failed tests will be printed.

- **`tree-sitter` compilation errors on `npm install`**: This is almost always due to a missing C/C++ build toolchain. Please follow the instructions in the [Prerequisites](#prerequisites) section for your operating system.
- **`EBADENGINE` or Node Version Errors**: You are running an unsupported version of Node.js. Please use `nvm` or install Node.js v20+.
- **Port Conflicts**: If default ports (3010, 5010) are in use, modify `ports.ini` and ensure your start scripts or manual commands reflect these changes.
- **Port Conflicts**: If default ports (3010, 5010) are in use, modify `ports.ini` and ensure the commands you use (e.g., `npm run electron:dev`, custom backend starts) pass the updated values along.
- **CSS/JS Not Loading in Packaged App**: This is often due to incorrect asset paths. The current `next.config.js` with `assetPrefix: './'` should handle this for the `file://` protocol.

---
Expand Down
108 changes: 0 additions & 108 deletions agents.md

This file was deleted.

63 changes: 35 additions & 28 deletions components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
// components/ErrorBoundary.tsx
// Minor change: Using alias path
import React from "react";
import type { ReactNode } from "react";
import { AlertCircle } from "lucide-react";
import { Button } from "@/components/ui/button"; // Using alias
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; // Using alias
import {
ErrorBoundary as ReactErrorBoundary,
type FallbackProps,
} from "react-error-boundary";

import { Button } from "@/components/ui/button";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";

/**
* A reusable error boundary using react‑error‑boundary.
* Keeps the rest of the app alive and offers a quick reload.
*/
export default function ErrorBoundary({ children }: { children: React.ReactNode }) {
const { ErrorBoundary } = require("react-error-boundary");
interface Props {
readonly children: ReactNode;
}

function Fallback({ error, resetErrorBoundary }: FallbackProps) {
return (
<div className="flex flex-col items-center p-6">
<Alert variant="destructive" className="max-w-lg">
<AlertCircle className="h-4 w-4" />
<AlertTitle>Something went wrong</AlertTitle>
<AlertDescription className="break-all">
{error.message}
</AlertDescription>
<Button
className="mt-3"
variant="outline"
onClick={resetErrorBoundary}
>
Reload section
</Button>
</Alert>
</div>
);
}

export default function ErrorBoundary({ children }: Props) {
return (
<ErrorBoundary
fallbackRender={({ error, resetErrorBoundary }) => (
<div className="p-6 flex flex-col items-center">
<Alert variant="destructive" className="max-w-lg">
<AlertCircle className="h-4 w-4" />
<AlertTitle>Something went wrong</AlertTitle>
<AlertDescription className="break-all">
{error.message}
</AlertDescription>
<Button
className="mt-3"
variant="outline"
onClick={resetErrorBoundary}
>
Reload section
</Button>
</Alert>
</div>
)}
>
{children}
</ErrorBoundary>
<ReactErrorBoundary fallbackRender={Fallback}>{children}</ReactErrorBoundary>
);
}
}
11 changes: 0 additions & 11 deletions docs/api_ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,3 @@ All responses follow the envelope
| POST | `/api/user-stories/{id}/tasks?projectPath=<dir>` | Add a single task to a story. Body → `{ "taskId": 1 }` |
| DELETE | `/api/user-stories/{id}/tasks/{taskId}?projectPath=<dir>` | Remove a single task from a story |
```

## 10 · Actor Management
| Method | Path | Notes |
| ------ | ---- | ----- |
| GET | `/api/actors?projectPath=<dir>` | List actors |
| POST | `/api/actors?projectPath=<dir>` | Create a new actor |
| GET | `/api/actors/{id}?projectPath=<dir>` | Get a specific actor |
| PUT | `/api/actors/{id}?projectPath=<dir>` | Update an actor |
| DELETE | `/api/actors/{id}?projectPath=<dir>` | Delete an actor |
| POST | `/api/actors/suggest?projectPath=<dir>` | Suggest an actor from description. Body → `{ "description": "..." }` |
| POST | `/api/actors/generate` | Generate actors from project context. Body → `{ "baseDir": "<path>", "treePaths": ["..."] }` |
8 changes: 3 additions & 5 deletions docs/project-structure-detailed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,9 @@ This project is a full-stack web application designed to help users generate Lar

## Configuration and Scripts

* **`.env.local`**: Stores the backend API URL (`NEXT_PUBLIC_API_URL`) for the frontend. Read by `next.config.js` and `start.js`.
* **`ports.ini`**: Custom configuration file defining frontend and backend ports. Read by `start.js` and `autotest.js`.
* **`start.js`**: Orchestration script to find free ports based on `ports.ini`, ensure the Python venv exists and dependencies are installed, write the correct API URL to `.env.local`, and start both the Flask backend and Next.js frontend development servers concurrently.
* **`start.bat` / `start.sh`**: Simple wrappers to execute `node start.js`.
* **`.env.local`**: Stores the backend API URL (`NEXT_PUBLIC_API_URL`) for the frontend. Read by `next.config.js` and the Electron launch scripts.
* **`ports.ini`**: Custom configuration file defining frontend and backend ports. Read by `autotest.js`.
* **`postinstall.js`**: Runs automatically after `npm install`. Attempts to find Python, create the venv, and install Python dependencies.
* **`autotest.js`**: Script to run integration tests against the running frontend and backend APIs, checking key endpoints. Reads ports from `ports.ini`.
* **`next.config.js`**: Configures Next.js build behavior, ESLint/TypeScript settings, environment variables, and API rewrites (though direct API calls using `NEXT_PUBLIC_API_URL` seem to be the primary method).
* **`ignoreDirs.txt`**: Contains default patterns/directories excluded by the `ProjectService` when building the file tree globally.
* **`ignoreDirs.txt`**: Contains default patterns/directories excluded by the `ProjectService` when building the file tree globally.
8 changes: 2 additions & 6 deletions lib/hooks/useHomePageLogic.original.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
import { useExclusionService } from "@/services/exclusionServiceHooks";
import { useTodoService } from "@/services/todoServiceHooks";
import { useAutoSelectService } from "@/services/autoSelectServiceHooks";
import { useActorWizardService } from "@/services/actorWizardServiceHooks";

import {
applyExtensionFilter,
Expand Down Expand Up @@ -66,11 +65,10 @@ import {
const { fetchGlobalExclusions, fetchLocalExclusions } = useExclusionService();
const { loadTodos } = useTodoService();
const { autoSelect, isSelecting } = useAutoSelectService();
const { generateActors, isGenerating } = useActorWizardService();

// --- Refs & Local UI State ---
const treeRef = useRef<FileTreeViewHandle>(null);
const [activeTab, setActiveTab] = useState<"files" | "options" | "tasks" | "actors">(
const [activeTab, setActiveTab] = useState<"files" | "options" | "tasks">(
"files",
);
// showSettings and setShowSettings are removed, managed by useAppStore
Expand Down Expand Up @@ -205,8 +203,6 @@ import {
// Setters & Handlers
handlePathSelected,
autoSelect,
generateActors,
isGeneratingActors: isGenerating,
openSettingsModal, // Expose store action
saveApiKey,
setApiKeyDraft,
Expand All @@ -220,4 +216,4 @@ import {
treeRef,
fileTree,
};
}
}
8 changes: 2 additions & 6 deletions lib/hooks/useHomePageLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
import { useExclusionService } from "@/services/exclusionServiceHooks";
import { useTodoService } from "@/services/todoServiceHooks";
import { useAutoSelectService } from "@/services/autoSelectServiceHooks";
import { useActorWizardService } from "@/services/actorWizardServiceHooks";

import {
applyExtensionFilter,
Expand Down Expand Up @@ -66,11 +65,10 @@ import {
const { fetchGlobalExclusions, fetchLocalExclusions } = useExclusionService();
const { loadTodos } = useTodoService();
const { autoSelect, isSelecting } = useAutoSelectService();
const { generateActors, isGenerating } = useActorWizardService();

// --- Refs & Local UI State ---
const treeRef = useRef<FileTreeViewHandle>(null);
const [activeTab, setActiveTab] = useState<"files" | "options" | "tasks" | "actors">(
const [activeTab, setActiveTab] = useState<"files" | "options" | "tasks">(
"files",
);
// showSettings and setShowSettings are removed, managed by useAppStore
Expand Down Expand Up @@ -205,8 +203,6 @@ import {
// Setters & Handlers
handlePathSelected,
autoSelect,
generateActors,
isGeneratingActors: isGenerating,
openSettingsModal, // Expose store action
saveApiKey,
setApiKeyDraft,
Expand All @@ -220,4 +216,4 @@ import {
treeRef,
fileTree,
};
}
}
4 changes: 1 addition & 3 deletions lib/hooks/useRefactoredHomePageLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ export function useRefactoredHomePageLogic() {
// Actions from various hooks
handlePathSelected: projectLogic.handlePathSelected,
autoSelect: serviceActions.autoSelect,
generateActors: serviceActions.generateActors,
isGeneratingActors: serviceActions.isGeneratingActors,
openSettingsModal: uiState.openSettingsModal,
saveApiKey: serviceActions.saveApiKey,
setApiKeyDraft,
Expand All @@ -71,4 +69,4 @@ export function useRefactoredHomePageLogic() {
// Refs
treeRef: uiState.treeRef,
};
}
}
6 changes: 1 addition & 5 deletions lib/hooks/useServiceActions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// lib/hooks/useServiceActions.ts
import { useCallback } from "react";
import { useAutoSelectService } from "@/services/autoSelectServiceHooks";
import { useActorWizardService } from "@/services/actorWizardServiceHooks";
import { useSettingsStore } from "@/stores/useSettingStore";
import { useAppStore } from "@/stores/useAppStore";

Expand All @@ -17,7 +16,6 @@ export function useServiceActions(apiKeyDraft: string) {

// Services
const { autoSelect, isSelecting } = useAutoSelectService();
const { generateActors, isGenerating } = useActorWizardService();

// API key management
const saveApiKey = useCallback(() => {
Expand All @@ -34,11 +32,9 @@ export function useServiceActions(apiKeyDraft: string) {
return {
// Service states
isSelecting,
isGeneratingActors: isGenerating,

// Service actions
autoSelect,
generateActors,
saveApiKey,
};
}
}
6 changes: 3 additions & 3 deletions lib/hooks/useUIState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { FileTreeViewHandle } from "@/views/FileTreeView";
*/
export function useUIState() {
// Local UI state
const [activeTab, setActiveTab] = useState<"files" | "options" | "tasks" | "actors">("files");
const [activeTab, setActiveTab] = useState<"files" | "options" | "tasks">("files");

// Refs
const treeRef = useRef<FileTreeViewHandle>(null);
Expand All @@ -24,7 +24,7 @@ export function useUIState() {

// Derived UI state
const hasContent = useMemo(
() => metaPrompt.trim() || mainInstructions.trim(),
() => Boolean(metaPrompt.trim() || mainInstructions.trim()),
[metaPrompt, mainInstructions],
);

Expand All @@ -39,4 +39,4 @@ export function useUIState() {
openSettingsModal,
closeSettingsModal,
};
}
}
1 change: 1 addition & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
"dev": "kill-port 3010 && next dev -p 3010 -H 127.0.0.1",
"build": "npx --yes node@20 ./node_modules/next/dist/bin/next build",
"export": "npm run build",
"start": "echo \"For Electron app, use 'npm run electron:prod:local' or run the packaged application. 'npm start' (next start) is not used with 'output: export'. To serve static 'out' folder, use 'npx serve out -p 3010'\"",
"start": "echo \"For Electron app, use 'npm run electron:prod:local' or run the packaged application. 'npm start' (next start) is not used with 'output: export'. To serve a static export, use 'npm run electron:prod:local'.\"",
"lint": "next lint",
"backend": "python_backend/venv/bin/python python_backend/app.py",
"backend:prod": "python_backend/venv/bin/python -m gunicorn -w 2 -b 127.0.0.1:5010 --chdir python_backend app:app",
"start:dev": "node start.js",
"start:all": "node start.js",
"postinstall": "node scripts/postinstall.js",
"electron:dev": "concurrently --kill-others \"npm run dev\" \"npm run backend\" \"wait-on tcp:5010 tcp:3010 && node scripts/run-electron.js\"",
"electron:prod:local": "npm run build && cross-env APP_ENV=production concurrently --kill-others \"python_backend/venv/bin/python -m gunicorn -w 2 -b 127.0.0.1:5010 --chdir python_backend app:app\" \"node scripts/run-electron.js\"",
Expand Down
Loading
Loading