lwazi 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -0
- package/README.md +187 -0
- package/auto_prepend.php +567 -0
- package/bin/lwazi.js +302 -0
- package/bin/postinstall.js +30 -0
- package/composer.json +27 -0
- package/config/lwazi.php +36 -0
- package/install +238 -0
- package/install.bat +184 -0
- package/install.ps1 +221 -0
- package/lwazi-1.0.0.tgz +0 -0
- package/package.json +44 -0
- package/publish-npm.sh +106 -0
- package/resources/views/chat.blade.php +117 -0
- package/src/Console/AnalyzeProjectCommand.php +45 -0
- package/src/Console/LwaziIngestCommand.php +25 -0
- package/src/Console/SetupCommand.php +93 -0
- package/src/Facades/Lwazi.php +13 -0
- package/src/Http/Controllers/ChatController.php +46 -0
- package/src/Http/Middleware/InjectLwaziChat.php +47 -0
- package/src/Installer/ProjectAnalyzer.php +619 -0
- package/src/Providers/LwaziServiceProvider.php +65 -0
- package/src/Rag/RagService.php +226 -0
- package/src/Services/KnowledgeBaseGenerator.php +707 -0
- package/src/Services/LwaziAgent.php +877 -0
- package/src/Services/LwaziService.php +680 -0
- package/src/Services/NavigationTree.php +456 -0
- package/src/Support/ModelScanner.php +80 -0
- package/src/Tools/ToolRegistry.php +194 -0
- package/src/helpers.php +15 -0
- package/uninstall +156 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lwazi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
This package uses Ollama (https://ollama.com) which is licensed under the MIT License.
|
package/README.md
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Lwazi AI Assistant
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/lwazi-ai)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
**AI-powered assistant for Laravel applications.** Add an intelligent chat widget to your Laravel app with just one command.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 🤖 **AI-Powered Chat**: Integrates with Ollama for local AI conversations
|
|
11
|
+
- 🎨 **Customizable UI**: Modern chat widget with theme customization
|
|
12
|
+
- 🔍 **Smart Navigation**: AI understands your app structure and helps users navigate
|
|
13
|
+
- 📱 **Responsive Design**: Works on desktop and mobile
|
|
14
|
+
- ⚡ **Easy Installation**: One-command setup for Laravel projects
|
|
15
|
+
- 🔒 **Privacy-Focused**: Runs locally with Ollama, no external API calls
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Prerequisites
|
|
20
|
+
|
|
21
|
+
- **Laravel 10+** application
|
|
22
|
+
- **PHP 8.1+**
|
|
23
|
+
- **Node.js 14+** (for installation)
|
|
24
|
+
- **Ollama** running locally
|
|
25
|
+
|
|
26
|
+
### Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Install via npm
|
|
30
|
+
npm install lwazi-ai
|
|
31
|
+
|
|
32
|
+
# This will automatically run the post-install script
|
|
33
|
+
# Then complete the installation by running:
|
|
34
|
+
npx lwazi
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The installer will:
|
|
38
|
+
- Download the latest Lwazi package
|
|
39
|
+
- Configure your Laravel application
|
|
40
|
+
- Set up environment variables
|
|
41
|
+
- Publish necessary assets
|
|
42
|
+
- Generate your site's knowledge base
|
|
43
|
+
|
|
44
|
+
### Manual Installation
|
|
45
|
+
|
|
46
|
+
If you prefer manual installation:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Clone the repository
|
|
50
|
+
git clone https://github.com/nigelnkomo/lwazi.git
|
|
51
|
+
cd your-laravel-project
|
|
52
|
+
|
|
53
|
+
# Copy lwazi folder
|
|
54
|
+
cp -r /path/to/lwazi/lwazi ./
|
|
55
|
+
|
|
56
|
+
# Run installation script
|
|
57
|
+
./lwazi/install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
After installation, configure these environment variables in your `.env` file:
|
|
63
|
+
|
|
64
|
+
```env
|
|
65
|
+
# Lwazi AI Configuration
|
|
66
|
+
LWAZI_OLLAMA_URL=http://localhost:11434
|
|
67
|
+
LWAZI_MODEL=llama3.2:1b
|
|
68
|
+
LWAZI_API_URL=/lwazi
|
|
69
|
+
LWAZI_AUTO_INJECT=true
|
|
70
|
+
LWAZI_POSITION=bottom-right
|
|
71
|
+
LWAZI_THEME=blue
|
|
72
|
+
LWAZI_ACCENT="#007aff"
|
|
73
|
+
LWAZI_ACCENT_DARK="#0051d4"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
Once installed, Lwazi will automatically appear as a chat widget in your Laravel application. Users can:
|
|
79
|
+
|
|
80
|
+
- Ask questions about your website
|
|
81
|
+
- Get navigation help
|
|
82
|
+
- Interact with your content using AI
|
|
83
|
+
|
|
84
|
+
### Laravel Commands
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Re-analyze your application structure
|
|
88
|
+
php artisan lwazi:ingest
|
|
89
|
+
|
|
90
|
+
# Run setup wizard
|
|
91
|
+
php artisan lwazi:setup
|
|
92
|
+
|
|
93
|
+
# Clear Lwazi cache
|
|
94
|
+
php artisan lwazi:clear
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## How It Works
|
|
98
|
+
|
|
99
|
+
Lwazi analyzes your Laravel application to understand:
|
|
100
|
+
|
|
101
|
+
- **Routes & Navigation**: Maps your site's structure
|
|
102
|
+
- **Content & Pages**: Indexes your views and content
|
|
103
|
+
- **Database Schema**: Understands your data relationships
|
|
104
|
+
- **Configuration**: Learns about your app's setup
|
|
105
|
+
|
|
106
|
+
This knowledge allows the AI to provide contextual, helpful responses specific to your application.
|
|
107
|
+
|
|
108
|
+
## Customization
|
|
109
|
+
|
|
110
|
+
### Themes
|
|
111
|
+
|
|
112
|
+
Lwazi supports multiple themes and custom colors. Configure via environment variables or publish the config:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
php artisan vendor:publish --provider="Lwazi\Core\Providers\LwaziServiceProvider"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Advanced Configuration
|
|
119
|
+
|
|
120
|
+
Edit `config/lwazi.php` to customize:
|
|
121
|
+
- AI model settings
|
|
122
|
+
- Widget appearance
|
|
123
|
+
- Response behavior
|
|
124
|
+
- Security settings
|
|
125
|
+
|
|
126
|
+
## Requirements
|
|
127
|
+
|
|
128
|
+
- **Laravel**: 10.0, 11.0, or 12.0
|
|
129
|
+
- **PHP**: 8.1 or higher
|
|
130
|
+
- **Ollama**: Latest version
|
|
131
|
+
- **Node.js**: 14+ (for installation only)
|
|
132
|
+
|
|
133
|
+
## Supported AI Models
|
|
134
|
+
|
|
135
|
+
Lwazi works with any Ollama-compatible model:
|
|
136
|
+
|
|
137
|
+
- **Llama 3.2**: `llama3.2:1b`, `llama3.2:3b`
|
|
138
|
+
- **Llama 3**: `llama3:8b`, `llama3:70b`
|
|
139
|
+
- **Mistral**: `mistral:7b`
|
|
140
|
+
- **Phi-3**: `phi3:3.8b`
|
|
141
|
+
- **Gemma**: `gemma:2b`, `gemma:7b`
|
|
142
|
+
|
|
143
|
+
## Troubleshooting
|
|
144
|
+
|
|
145
|
+
### Common Issues
|
|
146
|
+
|
|
147
|
+
**"Ollama not available"**
|
|
148
|
+
- Ensure Ollama is running: `ollama serve`
|
|
149
|
+
- Check the URL in your `.env` file
|
|
150
|
+
|
|
151
|
+
**"Model not found"**
|
|
152
|
+
- Pull the model: `ollama pull llama3.2:1b`
|
|
153
|
+
- Update `LWAZI_MODEL` in your `.env`
|
|
154
|
+
|
|
155
|
+
**Widget not appearing**
|
|
156
|
+
- Clear Laravel caches: `php artisan config:clear && php artisan cache:clear`
|
|
157
|
+
- Check browser console for JavaScript errors
|
|
158
|
+
|
|
159
|
+
### Getting Help
|
|
160
|
+
|
|
161
|
+
- 📖 **Documentation**: [GitHub Wiki](https://github.com/nigelnkomo/lwazi/wiki)
|
|
162
|
+
- 🐛 **Issues**: [GitHub Issues](https://github.com/nigelnkomo/lwazi/issues)
|
|
163
|
+
- 💬 **Discussions**: [GitHub Discussions](https://github.com/nigelnkomo/lwazi/discussions)
|
|
164
|
+
|
|
165
|
+
## Contributing
|
|
166
|
+
|
|
167
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
168
|
+
|
|
169
|
+
1. Fork the repository
|
|
170
|
+
2. Create a feature branch
|
|
171
|
+
3. Make your changes
|
|
172
|
+
4. Add tests if applicable
|
|
173
|
+
5. Submit a pull request
|
|
174
|
+
|
|
175
|
+
## License
|
|
176
|
+
|
|
177
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
178
|
+
|
|
179
|
+
## Credits
|
|
180
|
+
|
|
181
|
+
- **Ollama**: For providing the local AI inference engine
|
|
182
|
+
- **Laravel**: The PHP framework that makes this possible
|
|
183
|
+
- **Open Source Community**: For the amazing tools and libraries
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
**Made with ❤️ for the Laravel community**
|