@defai.digital/automatosx 5.0.1

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +2877 -0
  2. package/CONTRIBUTING.md +357 -0
  3. package/FAQ.md +604 -0
  4. package/FIXES.md +277 -0
  5. package/LICENSE +190 -0
  6. package/README.md +603 -0
  7. package/REVIEW-REPORT.md +278 -0
  8. package/TROUBLESHOOTING.md +612 -0
  9. package/automatosx.config.json +219 -0
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.js +11806 -0
  12. package/dist/index.js.map +1 -0
  13. package/docs/README.md +227 -0
  14. package/docs/guide/core-concepts.md +568 -0
  15. package/docs/guide/installation.md +406 -0
  16. package/docs/guide/introduction.md +199 -0
  17. package/docs/guide/quick-start.md +387 -0
  18. package/docs/index.md +132 -0
  19. package/docs/reference/cli-commands.md +894 -0
  20. package/docs/tutorials/first-agent.md +691 -0
  21. package/docs/tutorials/memory-management.md +785 -0
  22. package/examples/AGENTS_INFO.md +293 -0
  23. package/examples/README.md +434 -0
  24. package/examples/abilities/best-practices.md +102 -0
  25. package/examples/abilities/code-generation.md +1035 -0
  26. package/examples/abilities/code-review.md +42 -0
  27. package/examples/abilities/content-creation.md +97 -0
  28. package/examples/abilities/debugging.md +43 -0
  29. package/examples/abilities/documentation.md +54 -0
  30. package/examples/abilities/error-analysis.md +107 -0
  31. package/examples/abilities/general-assistance.md +26 -0
  32. package/examples/abilities/our-architecture-decisions.md +242 -0
  33. package/examples/abilities/our-code-review-checklist.md +217 -0
  34. package/examples/abilities/our-coding-standards.md +389 -0
  35. package/examples/abilities/our-project-structure.md +502 -0
  36. package/examples/abilities/performance-analysis.md +56 -0
  37. package/examples/abilities/problem-solving.md +50 -0
  38. package/examples/abilities/refactoring.md +49 -0
  39. package/examples/abilities/security-audit.md +65 -0
  40. package/examples/abilities/task-planning.md +65 -0
  41. package/examples/abilities/technical-writing.md +77 -0
  42. package/examples/abilities/testing.md +47 -0
  43. package/examples/abilities/troubleshooting.md +80 -0
  44. package/examples/agents/assistant.yaml +45 -0
  45. package/examples/agents/backend.yaml +60 -0
  46. package/examples/agents/ceo.yaml +47 -0
  47. package/examples/agents/coder.yaml +388 -0
  48. package/examples/agents/cto.yaml +47 -0
  49. package/examples/agents/data.yaml +47 -0
  50. package/examples/agents/debugger.yaml +59 -0
  51. package/examples/agents/design.yaml +46 -0
  52. package/examples/agents/devops.yaml +47 -0
  53. package/examples/agents/frontend.yaml +61 -0
  54. package/examples/agents/product.yaml +47 -0
  55. package/examples/agents/quality.yaml +47 -0
  56. package/examples/agents/reviewer.yaml +49 -0
  57. package/examples/agents/security.yaml +47 -0
  58. package/examples/agents/writer.yaml +66 -0
  59. package/examples/claude/commands/ax:agent.md +37 -0
  60. package/examples/claude/commands/ax:clear.md +22 -0
  61. package/examples/claude/commands/ax:init.md +25 -0
  62. package/examples/claude/commands/ax:list.md +19 -0
  63. package/examples/claude/commands/ax:memory.md +25 -0
  64. package/examples/claude/commands/ax:status.md +24 -0
  65. package/examples/claude/commands/ax:update.md +28 -0
  66. package/examples/claude/mcp/automatosx.json +74 -0
  67. package/examples/templates/analyst.yaml +60 -0
  68. package/examples/templates/basic-agent.yaml +28 -0
  69. package/examples/templates/designer.yaml +69 -0
  70. package/examples/templates/developer.yaml +60 -0
  71. package/examples/templates/qa-specialist.yaml +71 -0
  72. package/examples/use-cases/01-web-app-development.md +374 -0
  73. package/package.json +86 -0
  74. package/scripts/check-release.js +128 -0
  75. package/scripts/real-provider-test.sh +357 -0
  76. package/scripts/smoke-test.sh +286 -0
  77. package/tsup.config.ts +16 -0
@@ -0,0 +1,612 @@
1
+ # Troubleshooting Guide
2
+
3
+ This guide helps you resolve common issues when using AutomatosX.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Installation Issues](#installation-issues)
8
+ - [Configuration Problems](#configuration-problems)
9
+ - [Memory System Issues](#memory-system-issues)
10
+ - [Provider Issues](#provider-issues)
11
+ - [Agent Execution Problems](#agent-execution-problems)
12
+ - [Performance Issues](#performance-issues)
13
+ - [Error Messages](#error-messages)
14
+
15
+ ---
16
+
17
+ ## Installation Issues
18
+
19
+ ### Error: Node version not supported
20
+
21
+ **Symptom**: Installation fails with error about Node.js version
22
+
23
+ **Solution**:
24
+
25
+ ```bash
26
+ # Check your Node version
27
+ node --version
28
+
29
+ # AutomatosX requires Node.js 20 or higher
30
+ # Install Node 20+ using nvm (recommended)
31
+ nvm install 20
32
+ nvm use 20
33
+
34
+ # Or use n
35
+ npm install -g n
36
+ n 20
37
+ ```
38
+
39
+ ### Error: SQLite compilation fails
40
+
41
+ **Symptom**: `better-sqlite3` or `sqlite-vec` fails to compile
42
+
43
+ **Solution**:
44
+
45
+ ```bash
46
+ # On macOS
47
+ xcode-select --install
48
+
49
+ # On Ubuntu/Debian
50
+ sudo apt-get install build-essential python3
51
+
52
+ # On Windows
53
+ # Install windows-build-tools
54
+ npm install --global windows-build-tools
55
+
56
+ # Try clean install
57
+ rm -rf node_modules package-lock.json
58
+ npm install
59
+ ```
60
+
61
+ ### Error: Permission denied during global install
62
+
63
+ **Symptom**: `EACCES: permission denied` when running `npm install -g`
64
+
65
+ **Solution**:
66
+
67
+ ```bash
68
+ # Option 1: Use npx (recommended)
69
+ npx automatosx --help
70
+
71
+ # Option 2: Fix npm permissions
72
+ mkdir ~/.npm-global
73
+ npm config set prefix '~/.npm-global'
74
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
75
+ source ~/.bashrc
76
+
77
+ # Then install again
78
+ npm install -g automatosx
79
+ ```
80
+
81
+ ---
82
+
83
+ ## Configuration Problems
84
+
85
+ ### Error: Config file not found
86
+
87
+ **Symptom**: `Configuration file not found`
88
+
89
+ **Solution**:
90
+
91
+ ```bash
92
+ # Initialize configuration in your project
93
+ automatosx init
94
+
95
+ # Or manually create config
96
+ mkdir -p .automatosx
97
+ cat > .automatosx/config.json << EOF
98
+ {
99
+ "$schema": "https://automatosx.dev/schema/config.json",
100
+ "version": "4.0.0",
101
+ "providers": {
102
+ "claude": {
103
+ "apiKey": "sk-ant-..."
104
+ }
105
+ }
106
+ }
107
+ EOF
108
+ ```
109
+
110
+ ### Error: Invalid API key
111
+
112
+ **Symptom**: `Invalid API key` or `401 Unauthorized`
113
+
114
+ **Solution**:
115
+
116
+ ```bash
117
+ # Check your API key is set
118
+ automatosx config --get providers.claude.apiKey
119
+
120
+ # Set API key via config
121
+ automatosx config --set providers.claude.apiKey --value "sk-ant-..."
122
+
123
+ # Or use environment variable
124
+ export ANTHROPIC_API_KEY="sk-ant-..."
125
+ export GOOGLE_API_KEY="your-key"
126
+ export OPENAI_API_KEY="sk-..."
127
+ ```
128
+
129
+ ### Config priority not working as expected
130
+
131
+ **Issue**: Config from wrong location is being used
132
+
133
+ **Explanation**: AutomatosX loads config in this priority order:
134
+
135
+ 1. `.automatosx/config.json` (project-specific)
136
+ 2. `automatosx.config.json` (project root)
137
+ 3. `~/.automatosx/config.json` (user global)
138
+
139
+ **Solution**:
140
+
141
+ ```bash
142
+ # Check which config file is being used
143
+ automatosx config
144
+
145
+ # Use --config flag to specify exact file
146
+ automatosx run assistant "hello" --config /path/to/config.json
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Memory System Issues
152
+
153
+ ### Database locked error
154
+
155
+ **Symptom**: `Error: database is locked`
156
+
157
+ **Solution**:
158
+
159
+ ```bash
160
+ # Check for other AutomatosX processes
161
+ ps aux | grep automatosx
162
+
163
+ # Kill hanging processes
164
+ pkill -f automatosx
165
+
166
+ # If problem persists, backup and recreate database
167
+ cp .automatosx/memory.db .automatosx/memory.db.backup
168
+ rm .automatosx/memory.db
169
+ automatosx memory list # Will recreate database
170
+ ```
171
+
172
+ ### Vector search returns no results
173
+
174
+ **Symptom**: Memory search returns empty results despite having data
175
+
176
+ **Solution**:
177
+
178
+ ```bash
179
+ # Check if memories exist
180
+ automatosx memory list
181
+
182
+ # Check embedding provider is configured
183
+ automatosx config --get providers.openai.embeddingApiKey
184
+
185
+ # Rebuild vector index
186
+ automatosx memory export --output backup.json
187
+ rm .automatosx/memory.db
188
+ automatosx memory import --input backup.json
189
+ ```
190
+
191
+ ### Memory export/import fails
192
+
193
+ **Symptom**: Export or import command fails with validation errors
194
+
195
+ **Solution**:
196
+
197
+ ```bash
198
+ # Export with validation disabled (not recommended)
199
+ automatosx memory export --output backup.json --no-validate
200
+
201
+ # Check export file format
202
+ cat backup.json | jq '.[0]'
203
+ # Should have: content, timestamp, metadata, embedding
204
+
205
+ # Import with validation to see specific errors
206
+ automatosx memory import --input backup.json --validate
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Provider Issues
212
+
213
+ ### Claude API errors
214
+
215
+ **Error**: `overloaded_error` or `rate_limit_error`
216
+
217
+ **Solution**:
218
+
219
+ ```bash
220
+ # Wait and retry (AutomatosX has built-in retry logic)
221
+ # Or reduce request rate by adjusting config
222
+
223
+ automatosx config --set providers.claude.maxRetries --value 5
224
+ automatosx config --set providers.claude.retryDelay --value 2000
225
+ ```
226
+
227
+ **Error**: `context_length_exceeded`
228
+
229
+ **Solution**:
230
+
231
+ ```bash
232
+ # Use a model with larger context window
233
+ automatosx config --set providers.claude.model --value claude-3-opus-20240229
234
+
235
+ # Or reduce input size
236
+ # - Truncate long files
237
+ # - Summarize previous conversation history
238
+ # - Use fewer examples in prompts
239
+ ```
240
+
241
+ ### Gemini API errors
242
+
243
+ **Error**: `RESOURCE_EXHAUSTED`
244
+
245
+ **Solution**:
246
+
247
+ ```bash
248
+ # Gemini has aggressive rate limits on free tier
249
+ # Use exponential backoff (already built in)
250
+ # Or upgrade to paid tier
251
+
252
+ # Switch to Claude as fallback
253
+ automatosx config --set providers.preferred --value claude
254
+ ```
255
+
256
+ ### Provider selection not working
257
+
258
+ **Symptom**: Wrong provider is being used
259
+
260
+ **Solution**:
261
+
262
+ ```bash
263
+ # Check provider configuration
264
+ automatosx config --list | grep -A 20 "Providers"
265
+
266
+ # Set preferred provider
267
+ automatosx config --set providers.preferred --value claude
268
+
269
+ # Or specify provider in command
270
+ automatosx run assistant "hello" --provider claude
271
+ ```
272
+
273
+ ---
274
+
275
+ ## Agent Execution Problems
276
+
277
+ ### Agent not found
278
+
279
+ **Symptom**: `Agent profile not found: <name>`
280
+
281
+ **Solution**:
282
+
283
+ ```bash
284
+ # List available agents
285
+ automatosx list agents
286
+
287
+ # Check agent paths configuration
288
+ automatosx config --get paths.agents
289
+
290
+ # Verify agent profile exists
291
+ ls -la .automatosx/agents/
292
+ ls -la ~/.automatosx/agents/
293
+
294
+ # Agent profile should be: <name>.yaml
295
+ cat .automatosx/agents/assistant.yaml
296
+ ```
297
+
298
+ ### Ability files not loaded
299
+
300
+ **Symptom**: Agent cannot find abilities
301
+
302
+ **Solution**:
303
+
304
+ ```bash
305
+ # List available abilities
306
+ automatosx list abilities
307
+
308
+ # Check abilities path
309
+ automatosx config --get paths.abilities
310
+
311
+ # Verify ability files exist (should be .md files)
312
+ ls -la .automatosx/abilities/
313
+ ```
314
+
315
+ ### Agent execution timeout
316
+
317
+ **Symptom**: `Error: Request timeout after 300000ms` or `Provider codex execution failed`
318
+
319
+ **Root Cause (v5.0.0 and earlier)**: Provider timeout (5 minutes) was shorter than agent timeout (15 minutes), causing premature failures.
320
+
321
+ **Solution**:
322
+
323
+ #### ✅ Recommended: Update to v5.0.1+
324
+
325
+ v5.0.1 fixes this issue by setting all provider timeouts to 15 minutes:
326
+
327
+ ```bash
328
+ # Update to latest version
329
+ npm install -g @defai.digital/automatosx@latest
330
+
331
+ # Verify the version
332
+ automatosx --version # Should be 5.0.1 or higher
333
+ ```
334
+
335
+ #### ⚙️ Manual Fix (if you can't update)
336
+
337
+ ```bash
338
+ # Set all provider timeouts to 15 minutes (900000ms)
339
+ automatosx config set providers.claude-code.timeout 900000
340
+ automatosx config set providers.gemini-cli.timeout 900000
341
+ automatosx config set providers.openai.timeout 900000
342
+
343
+ # Verify the changes
344
+ automatosx config show | grep -A2 "timeout"
345
+ # All provider timeouts should show 900000
346
+ ```
347
+
348
+ #### 📝 For very long-running tasks (30+ minutes)
349
+
350
+ ```bash
351
+ # Increase both agent and provider timeouts
352
+ automatosx config set execution.defaultTimeout 1800000 # 30 minutes
353
+ automatosx config set providers.claude-code.timeout 1800000
354
+ automatosx config set providers.gemini-cli.timeout 1800000
355
+ automatosx config set providers.openai.timeout 1800000
356
+ ```
357
+
358
+ **Verification**:
359
+
360
+ ```bash
361
+ # Run a complex task to test
362
+ automatosx run assistant "Perform comprehensive code review"
363
+ # Should no longer timeout prematurely
364
+ ```
365
+
366
+ ### Path resolution errors
367
+
368
+ **Symptom**: `Path outside project boundary` or `Invalid path`
369
+
370
+ **Solution**:
371
+
372
+ ```bash
373
+ # AutomatosX prevents path traversal for security
374
+ # Paths must be within project directory
375
+
376
+ # Check your project root
377
+ automatosx status
378
+
379
+ # Use absolute paths within project
380
+ automatosx run assistant "analyze /full/path/to/project/src/file.ts"
381
+
382
+ # Not allowed:
383
+ automatosx run assistant "analyze ../../etc/passwd" # ❌ Path traversal
384
+ ```
385
+
386
+ ---
387
+
388
+ ## Performance Issues
389
+
390
+ ### Slow startup time
391
+
392
+ **Issue**: CLI takes long to start
393
+
394
+ **Solution**:
395
+
396
+ ```bash
397
+ # Enable lazy loading (should be default)
398
+ automatosx config --set performance.lazyLoad --value true
399
+
400
+ # Warm cache for faster subsequent runs
401
+ automatosx status # This warms the cache
402
+
403
+ # Check if cache is working
404
+ automatosx config --get performance.cache.enabled
405
+ ```
406
+
407
+ ### High memory usage
408
+
409
+ **Issue**: AutomatosX uses too much RAM
410
+
411
+ **Solution**:
412
+
413
+ ```bash
414
+ # Reduce cache size
415
+ automatosx config --set performance.cache.maxSize --value 50
416
+
417
+ # Reduce memory entries limit
418
+ automatosx config --set memory.maxEntries --value 5000
419
+
420
+ # Clear old memories
421
+ automatosx memory list
422
+ # Delete old or unneeded memories manually
423
+ ```
424
+
425
+ ### Vector search is slow
426
+
427
+ **Issue**: Memory search takes too long
428
+
429
+ **Solution**:
430
+
431
+ ```bash
432
+ # Check database size
433
+ ls -lh .automatosx/memory.db
434
+
435
+ # Optimize database
436
+ sqlite3 .automatosx/memory.db "VACUUM; ANALYZE;"
437
+
438
+ # Reduce search results
439
+ automatosx memory search "query" --limit 10 # Default is 50
440
+
441
+ # Consider cleaning old memories
442
+ automatosx memory export --output backup.json
443
+ # Edit backup.json to remove old entries
444
+ rm .automatosx/memory.db
445
+ automatosx memory import --input backup.json
446
+ ```
447
+
448
+ ---
449
+
450
+ ## Error Messages
451
+
452
+ ### `ENOENT: no such file or directory`
453
+
454
+ **Cause**: Missing configuration or agent files
455
+
456
+ **Solution**: See [Agent not found](#agent-not-found) or [Config file not found](#error-config-file-not-found)
457
+
458
+ ### `SQLITE_CANTOPEN: unable to open database file`
459
+
460
+ **Cause**: Insufficient permissions or missing directory
461
+
462
+ **Solution**:
463
+
464
+ ```bash
465
+ # Check directory permissions
466
+ ls -la .automatosx
467
+
468
+ # Create directory with correct permissions
469
+ mkdir -p .automatosx
470
+ chmod 755 .automatosx
471
+
472
+ # Recreate database
473
+ rm .automatosx/memory.db
474
+ automatosx memory list
475
+ ```
476
+
477
+ ### `SyntaxError: Unexpected token`
478
+
479
+ **Cause**: Invalid JSON in config file
480
+
481
+ **Solution**:
482
+
483
+ ```bash
484
+ # Validate JSON syntax
485
+ cat .automatosx/config.json | jq .
486
+
487
+ # If invalid, reset to defaults
488
+ automatosx config --reset
489
+ ```
490
+
491
+ ### `Error: Cannot find module`
492
+
493
+ **Cause**: Dependencies not installed properly
494
+
495
+ **Solution**:
496
+
497
+ ```bash
498
+ # Reinstall dependencies
499
+ rm -rf node_modules package-lock.json
500
+ npm install
501
+
502
+ # For global installation
503
+ npm uninstall -g automatosx
504
+ npm install -g automatosx
505
+
506
+ # Or use npx
507
+ npx automatosx --help
508
+ ```
509
+
510
+ ### `Delegation cycle detected: agent -> agent -> agent`
511
+
512
+ **Symptom**: Error message showing delegation cycles like `quality -> frontend -> frontend`
513
+
514
+ **Cause (v5.0.0 and earlier)**: Delegation parser incorrectly parsed documentation examples, test code, or quoted text as actual delegation requests.
515
+
516
+ **Example of False Positive**:
517
+ ```
518
+ Agent response contains: '1. "@frontend Create login UI"' (example)
519
+ → Parsed as actual delegation ❌
520
+ → Caused delegation cycle
521
+ ```
522
+
523
+ **Solution**:
524
+
525
+ #### ✅ Update to v5.0.1+
526
+
527
+ v5.0.1 includes improved delegation parsing that skips:
528
+ - Quoted examples: `"@frontend Create UI"`
529
+ - Documentation markers: "Example:", "Supported syntaxes:"
530
+ - Numbered lists: `1. "...", 2. "..."`
531
+ - Test code: `it('...', async () => ...)`
532
+
533
+ ```bash
534
+ # Update to latest version
535
+ npm install -g @defai.digital/automatosx@latest
536
+
537
+ # Verify
538
+ automatosx --version # Should be 5.0.1 or higher
539
+ ```
540
+
541
+ #### ⚙️ Workaround (if you can't update)
542
+
543
+ Avoid including delegation syntax examples in your agent instructions or system prompts.
544
+
545
+ ### `fts5: syntax error near "."`
546
+
547
+ **Symptom**: Memory search fails with `Search failed: fts5: syntax error near "."` or similar errors for special characters
548
+
549
+ **Cause (v5.0.0 and earlier)**: FTS5 search was not sanitizing special characters properly (`.`, `%`, `()`, etc.)
550
+
551
+ **Solution**:
552
+
553
+ #### ✅ Update to v5.0.1+
554
+
555
+ v5.0.1 includes enhanced FTS5 sanitization for 15+ special characters:
556
+
557
+ ```bash
558
+ # Update to latest version
559
+ npm install -g @defai.digital/automatosx@latest
560
+
561
+ # Test with special characters
562
+ automatosx memory add "Config file: config.json (port: 3000)"
563
+ automatosx memory search "config.json" # Now works!
564
+ ```
565
+
566
+ #### ⚙️ Workaround (if you can't update)
567
+
568
+ Remove special characters from your search queries:
569
+
570
+ ```bash
571
+ # Instead of: "config.json settings"
572
+ automatosx memory search "config json settings"
573
+
574
+ # Instead of: "timeout (300ms)"
575
+ automatosx memory search "timeout 300ms"
576
+ ```
577
+
578
+ ---
579
+
580
+ ## Getting More Help
581
+
582
+ If your issue is not covered here:
583
+
584
+ 1. **Check Documentation**:
585
+ - [README.md](./README.md) - Getting started guide
586
+ - [FAQ.md](./FAQ.md) - Frequently asked questions
587
+ - [API Documentation](./docs/) - Detailed API reference
588
+
589
+ 2. **Search Issues**: Check [GitHub Issues](https://github.com/defai-digital/automatosx/issues)
590
+
591
+ 3. **Enable Debug Logging**:
592
+
593
+ ```bash
594
+ automatosx run assistant "hello" --debug
595
+ ```
596
+
597
+ 4. **Get System Info**:
598
+
599
+ ```bash
600
+ automatosx status
601
+ node --version
602
+ npm --version
603
+ ```
604
+
605
+ 5. **Report a Bug**: [Create an issue](https://github.com/defai-digital/automatosx/issues/new)
606
+ - Include debug output
607
+ - Include system info
608
+ - Describe steps to reproduce
609
+
610
+ 6. **Join Community**:
611
+ - Discord: [discord.gg/automatosx](https://discord.gg/automatosx)
612
+ - Discussions: [GitHub Discussions](https://github.com/defai-digital/automatosx/discussions)