Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ai-project-prompter
Advanced tools
A React component for exploring project files and crafting AI prompts with their contents
A React component for exploring your project files and crafting AI prompts with their contents.
npm install ai-project-prompter
import { ProjectPrompter } from 'ai-project-prompter';
const files = [
{
id: 'src',
type: 'folder',
name: 'src',
path: '/src',
children: [
{
id: 'app',
type: 'file',
name: 'App.tsx',
path: '/src/App.tsx',
metadata: {
size: 1234,
modified: new Date(),
type: 'typescript',
content: '// Your file content here'
}
}
]
}
];
function App() {
return (
<ProjectPrompter
files={files}
onFileSelect={(file) => console.log('Selected:', file)}
onPromptChange={(content) => console.log('Prompt:', content)}
aiProvider="openai"
/>
);
}
Prop | Type | Description |
---|---|---|
files | FileNode[] | The project file system structure to display |
className? | string | Optional class name for the container |
onFileSelect? | (file: FileNode) => void | Optional callback when a file is selected |
onPromptChange? | (content: string) => void | Optional callback when prompt content changes |
initialPrompt? | string | Initial prompt content |
showPromptPanel? | boolean | Whether to show the prompt panel by default |
aiProvider? | 'openai' | 'anthropic' | 'custom' | Optional AI provider for prompt formatting |
interface FileNode {
id: string;
type: 'file' | 'folder';
name: string;
path: string;
children?: FileNode[];
metadata?: {
size: number;
modified: Date;
type: string;
content?: string;
};
}
You can provide your own file system adapter to customize how files are read:
import { setFileSystemAdapter } from 'ai-project-prompter';
class CustomAdapter implements FileSystemAdapter {
async readDirectory(path: string): Promise<FileNode[]> {
// Your custom implementation
return [];
}
}
setFileSystemAdapter(new CustomAdapter());
# Install dependencies
npm install
# Start development server
npm run dev
# Run tests
npm test
# Build for production
npm run build
MIT © Federico Del Gaudio
FAQs
A React component for exploring project files and crafting AI prompts with their contents
The npm package ai-project-prompter receives a total of 179 weekly downloads. As such, ai-project-prompter popularity was classified as not popular.
We found that ai-project-prompter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.