lwazi 1.16.0 → 1.16.2

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/bin/uninstall.js CHANGED
@@ -100,6 +100,13 @@ function manualCleanup() {
100
100
  console.log(colors.green('✓') + ' Removed lwazi directory');
101
101
  }
102
102
 
103
+ // Remove storage/lwazi directory
104
+ const storageLwazi = path.join(projectRoot, 'storage', 'lwazi');
105
+ if (fs.existsSync(storageLwazi)) {
106
+ fs.rmSync(storageLwazi, { recursive: true, force: true });
107
+ console.log(colors.green('✓') + ' Removed storage/lwazi directory');
108
+ }
109
+
103
110
  // Remove from composer.json
104
111
  const composerJson = path.join(projectRoot, 'composer.json');
105
112
  if (fs.existsSync(composerJson)) {
package/bin/update.js CHANGED
@@ -125,6 +125,15 @@ try {
125
125
  }
126
126
 
127
127
  console.log("\nLwazi updated successfully!");
128
- console.log("\nCLI Tools:");
129
- console.log(" - php lwazi/bin/crawl.php <url> # Crawl a website");
130
- console.log(" - php lwazi/bin/analyze.php # Re-analyze project");
128
+ console.log("\n========================================");
129
+ console.log(" Available Commands");
130
+ console.log("========================================");
131
+ console.log("\n1. Crawl your website (builds page map):");
132
+ console.log(" php lwazi/bin/crawl.php # Interactive mode");
133
+ console.log(" php lwazi/bin/crawl.php -u http://localhost:8000");
134
+ console.log(" php lwazi/bin/crawl.php --url http://localhost --help");
135
+ console.log("\n2. Re-analyze project (updates routes/models):");
136
+ console.log(" php lwazi/bin/analyze.php");
137
+ console.log("\n3. Crawl with login (for authenticated pages):");
138
+ console.log(" php lwazi/bin/crawl.php -u http://localhost -l /login -e user@email.com -p password");
139
+ console.log("\n========================================");
package/install CHANGED
@@ -214,9 +214,22 @@ if [ "$COMPOSER_USED" = true ]; then
214
214
  fi
215
215
 
216
216
  echo ""
217
- echo "CLI Tools:"
218
- echo " - php lwazi/bin/crawl.php <url> # Crawl a website"
219
- echo " - php lwazi/bin/analyze.php # Re-analyze project"
217
+ echo "========================================"
218
+ echo " Available Commands"
219
+ echo "========================================"
220
+ echo ""
221
+ echo "1. Crawl your website (builds page map):"
222
+ echo " php lwazi/bin/crawl.php # Interactive mode"
223
+ echo " php lwazi/bin/crawl.php -u http://localhost:8000"
224
+ echo " php lwazi/bin/crawl.php --url http://localhost --help"
225
+ echo ""
226
+ echo "2. Re-analyze project (updates routes/models):"
227
+ echo " php lwazi/bin/analyze.php"
228
+ echo ""
229
+ echo "3. Crawl with login (for authenticated pages):"
230
+ echo " php lwazi/bin/crawl.php -u http://localhost -l /login -e user@email.com -p password"
231
+ echo ""
232
+ echo "========================================"
220
233
  echo ""
221
234
  echo "Configuration:"
222
235
  echo " - Model: $MODEL"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lwazi",
3
- "version": "1.16.0",
3
+ "version": "1.16.2",
4
4
  "description": "Lwazi is an AI assistant for Laravel. Install with one command to add an AI assistant to your Laravel app.",
5
5
  "main": "bin/lwazi.js",
6
6
  "bin": {
package/uninstall CHANGED
@@ -98,44 +98,48 @@ if [ -f "$PROJECT_DIR/artisan" ]; then
98
98
  echo "Cleared caches"
99
99
  fi
100
100
 
101
- # Remove composer integration if it was used
102
- if [ "$COMPOSER_USED" = true ]; then
103
- echo "Cleaning up composer integration..."
104
- php -r '
105
- $file = "composer.json";
106
- if (file_exists($file)) {
107
- $json = json_decode(file_get_contents($file), true);
108
- $changed = false;
109
-
110
- if (isset($json["require"]["lwazi/core"])) {
111
- unset($json["require"]["lwazi/core"]);
101
+ # Always clean up composer.json (lwazi might have added it even if mode wasn't saved)
102
+ echo "Cleaning up composer.json..."
103
+ php -r '
104
+ $file = "composer.json";
105
+ if (file_exists($file)) {
106
+ $json = json_decode(file_get_contents($file), true);
107
+ $changed = false;
108
+
109
+ if (isset($json["require"]["lwazi/core"])) {
110
+ unset($json["require"]["lwazi/core"]);
111
+ $changed = true;
112
+ }
113
+
114
+ if (isset($json["repositories"]) && is_array($json["repositories"])) {
115
+ $originalCount = count($json["repositories"]);
116
+ $json["repositories"] = array_filter($json["repositories"], function($repo) {
117
+ return !isset($repo["url"]) || $repo["url"] !== "lwazi";
118
+ });
119
+ if (count($json["repositories"]) !== $originalCount) {
112
120
  $changed = true;
113
121
  }
114
-
115
- if (isset($json["repositories"])) {
116
- $original = $json["repositories"];
117
- $json["repositories"] = array_filter($json["repositories"], function($repo) {
118
- return !isset($repo["url"]) || $repo["url"] !== "lwazi";
119
- });
120
- if (count($json["repositories"]) !== count($original)) {
121
- $changed = true;
122
- }
123
- if (empty($json["repositories"])) {
124
- unset($json["repositories"]);
125
- }
126
- }
127
-
128
- if ($changed) {
129
- file_put_contents($file, json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
130
- echo "Removed lwazi from composer.json\n";
122
+ if (empty($json["repositories"])) {
123
+ unset($json["repositories"]);
131
124
  }
132
125
  }
133
- '
134
126
 
135
- # Run composer update to remove package
136
- if command -v composer &> /dev/null; then
137
- composer dump-autoload 2>/dev/null
138
- fi
127
+ // Remove minimum-stability if it was added for lwazi
128
+ if (isset($json["minimum-stability"]) && isset($json["prefer-stable"])) {
129
+ // Keep them if other packages need them
130
+ }
131
+
132
+ if ($changed) {
133
+ file_put_contents($file, json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
134
+ echo "Removed lwazi from composer.json\n";
135
+ }
136
+ }
137
+ '
138
+
139
+ # Remove storage/lwazi directory
140
+ if [ -d "$PROJECT_DIR/storage/lwazi" ]; then
141
+ rm -rf "$PROJECT_DIR/storage/lwazi"
142
+ echo "Removed storage/lwazi directory"
139
143
  fi
140
144
 
141
145
  echo ""