@defai.digital/automatosx 8.0.7 → 8.0.8

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 (52) hide show
  1. package/README.md +81 -13
  2. package/automatosx/tmp/cli-accessibility-analysis.md +341 -0
  3. package/automatosx/tmp/subdependency-cleanup-report.md +268 -0
  4. package/automatosx/tmp/tree-sitter-removal-evaluation.md +504 -0
  5. package/automatosx/tmp/v8.0.6-release-success.md +286 -0
  6. package/automatosx/tmp/v8.0.8-cli-linking-complete.md +490 -0
  7. package/package.json +5 -1
  8. package/packages/rescript-core/lib/bs/.bsdeps +23 -23
  9. package/packages/rescript-core/lib/bs/.compiler.log +82 -82
  10. package/packages/rescript-core/lib/bs/.ninja_log +205 -205
  11. package/packages/rescript-core/lib/bs/src/Hello.cmt +0 -0
  12. package/packages/rescript-core/lib/bs/src/Index.cmt +0 -0
  13. package/packages/rescript-core/lib/bs/src/concurrency/ConcurrencySafety.cmt +0 -0
  14. package/packages/rescript-core/lib/bs/src/domain/DomainValidation.cmt +0 -0
  15. package/packages/rescript-core/lib/bs/src/error/ErrorHandling.cmt +0 -0
  16. package/packages/rescript-core/lib/bs/src/events/EventBus.cmt +0 -0
  17. package/packages/rescript-core/lib/bs/src/math/SafeMath.cmt +0 -0
  18. package/packages/rescript-core/lib/bs/src/memory/HybridSearchCore.cmt +0 -0
  19. package/packages/rescript-core/lib/bs/src/memory/HybridSearchTypes.cmt +0 -0
  20. package/packages/rescript-core/lib/bs/src/memory/MemoryStateMachine.cmt +0 -0
  21. package/packages/rescript-core/lib/bs/src/memory/MessageTransform.cmt +0 -0
  22. package/packages/rescript-core/lib/bs/src/memory/StatsAggregation.cmt +0 -0
  23. package/packages/rescript-core/lib/bs/src/memory/Timestamp.cmt +0 -0
  24. package/packages/rescript-core/lib/bs/src/providers/ProviderStateMachine.cmt +0 -0
  25. package/packages/rescript-core/lib/bs/src/resource/ResourceManagement.cmt +0 -0
  26. package/packages/rescript-core/lib/bs/src/retry/RetryFallback.cmt +0 -0
  27. package/packages/rescript-core/lib/bs/src/retry/RetryOrchestrator.cmt +0 -0
  28. package/packages/rescript-core/lib/bs/src/rules/PolicyDSL.cmt +0 -0
  29. package/packages/rescript-core/lib/bs/src/rules/RuleAST.cmt +0 -0
  30. package/packages/rescript-core/lib/bs/src/rules/RuleEngine.cmt +0 -0
  31. package/packages/rescript-core/lib/bs/src/rules/RuleParser.cmt +0 -0
  32. package/packages/rescript-core/lib/bs/src/runtime/EffectRuntime.cmt +0 -0
  33. package/packages/rescript-core/lib/bs/src/runtime/EventDispatcher.cmt +0 -0
  34. package/packages/rescript-core/lib/bs/src/runtime/Guards.cmt +0 -0
  35. package/packages/rescript-core/lib/bs/src/runtime/StateMachineV2.cmt +0 -0
  36. package/packages/rescript-core/lib/bs/src/runtime/TaskStateMachine.cmt +0 -0
  37. package/packages/rescript-core/lib/bs/src/runtime/TransitionValidator.cmt +0 -0
  38. package/packages/rescript-core/lib/bs/src/security/CancellationLimiter.cmt +0 -0
  39. package/packages/rescript-core/lib/bs/src/security/DependencyValidator.cmt +0 -0
  40. package/packages/rescript-core/lib/bs/src/security/EventAuth.cmt +0 -0
  41. package/packages/rescript-core/lib/bs/src/security/GuardIsolation.cmt +0 -0
  42. package/packages/rescript-core/lib/bs/src/security/ManifestValidator.cmt +0 -0
  43. package/packages/rescript-core/lib/bs/src/security/MetadataValidator.cmt +0 -0
  44. package/packages/rescript-core/lib/bs/src/state/StateMachine.cmt +0 -0
  45. package/packages/rescript-core/lib/bs/src/state/StateManagement.cmt +0 -0
  46. package/packages/rescript-core/lib/bs/src/types/TypeSafety.cmt +0 -0
  47. package/packages/rescript-core/lib/bs/src/validation/ValidationRules.cmt +0 -0
  48. package/packages/rescript-core/lib/bs/src/workflow/TaskPlanner.cmt +0 -0
  49. package/packages/rescript-core/lib/bs/src/workflow/WorkflowOrchestrator.cmt +0 -0
  50. package/packages/rescript-core/lib/bs/src/workflow/WorkflowStateMachine.cmt +0 -0
  51. package/packages/rescript-core/lib/bs/src/workflow/WorkflowTypes.cmt +0 -0
  52. package/scripts/link-binary.js +53 -0
package/README.md CHANGED
@@ -11,9 +11,9 @@
11
11
  [![Languages](https://img.shields.io/badge/languages-45-blue)](./src/parser)
12
12
  [![Agents](https://img.shields.io/badge/agents-21-purple)](./src/agents)
13
13
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
14
- [![Version](https://img.shields.io/badge/version-8.0.0-blue.svg)](package.json)
14
+ [![Version](https://img.shields.io/badge/version-8.0.8-blue.svg)](package.json)
15
15
 
16
- **🎉 v8.0.0 - Production Ready with Full Feature Parity**
16
+ **🎉 v8.0.8 - CLI Auto-Linking & Developer Experience**
17
17
 
18
18
  AutomatosX is a comprehensive code intelligence platform with AI-powered workflow automation:
19
19
  - **Code Intelligence** - Tree-sitter AST parsing with SQLite FTS5 search for 45 languages
@@ -28,35 +28,103 @@ AutomatosX is a comprehensive code intelligence platform with AI-powered workflo
28
28
  ## 📋 Requirements
29
29
 
30
30
  - **Node.js**: v24.x or higher ([Download](https://nodejs.org/))
31
- - **npm**: v10.0.0 or higher
31
+ - **pnpm**: v9.0.0 or higher ([Install instructions](#installing-pnpm))
32
32
  - **Supported Operating Systems**:
33
33
  - **Ubuntu**: 24.04 LTS (Noble Numbat) or later
34
34
  - **macOS**: 26 (Tahoe) or later
35
35
  - **Windows**: 11 or later
36
36
 
37
- ## 🚀 Quick Start
37
+ ### Installing pnpm
38
+
39
+ ```bash
40
+ # Via npm (recommended)
41
+ npm install -g pnpm@9
42
+
43
+ # Via Homebrew (macOS)
44
+ brew install pnpm
45
+
46
+ # Via winget (Windows)
47
+ winget install -e --id pnpm.pnpm
48
+
49
+ # Verify installation
50
+ pnpm --version # Should show 9.x.x
51
+ ```
52
+
53
+ **Why pnpm?** This project uses pnpm (not npm) because:
54
+ - ✅ Better monorepo/workspace support
55
+ - ✅ 2-3x faster installations
56
+ - ✅ Smaller disk usage (40% reduction)
57
+ - ✅ Stricter dependency resolution
58
+
59
+ See [INSTALLATION.md](./INSTALLATION.md) for detailed setup instructions.
60
+
61
+ ## 🚀 Quick Start (Development)
38
62
 
39
63
  ```bash
64
+ # Clone the repository
65
+ git clone https://github.com/defai-digital/automatosx.git
66
+ cd automatosx
67
+
40
68
  # Install dependencies
41
- npm install
69
+ pnpm install
42
70
 
43
71
  # Build the project
44
- npm run build
72
+ pnpm run build
45
73
 
46
- # Launch Interactive CLI
47
- npm run cli -- cli
74
+ # Link CLI binary (makes 'ax' command available globally)
75
+ pnpm run link
48
76
 
49
- # Or use specific commands
50
- npm run cli -- find "getUserById"
51
- npm run cli -- speckit spec "Build authentication API"
52
- npm run cli -- gen plan workflows/cicd.yaml
77
+ # Now you can use the CLI directly:
78
+ ax find "getUserById"
79
+ ax cli # Launch interactive mode
80
+ ax speckit spec "Build authentication API"
81
+
82
+ # Or use via pnpm script:
83
+ pnpm run cli -- find "getUserById"
53
84
 
54
85
  # Run tests (745+ tests)
55
- npm test
86
+ pnpm test
87
+ ```
88
+
89
+ ### Using the `ax` Command
90
+
91
+ After `pnpm install` and `pnpm run build`, the `ax` binary is automatically linked globally via the `postinstall` script. This means you can use:
92
+
93
+ ```bash
94
+ # These work anywhere on your system:
95
+ ax find "Calculator"
96
+ ax def "getUserById"
97
+ ax flow "handleRequest"
98
+ ax cli # Interactive ChatGPT-style mode
99
+ ```
100
+
101
+ **To unlink** (if you want to remove the global `ax` command):
102
+ ```bash
103
+ pnpm run unlink
104
+ # Or manually:
105
+ pnpm unlink --global
56
106
  ```
57
107
 
58
108
  **Note**: Current build requires fixing TypeScript compilation errors (2-3 hours). Tests pass but CLI requires pre-compiled dist/ files.
59
109
 
110
+ ## 📦 End User Installation (npm)
111
+
112
+ **If you just want to use the CLI** (not develop AutomatosX):
113
+
114
+ ```bash
115
+ # Install globally with npm (no pnpm needed)
116
+ npm install -g @defai.digital/automatosx
117
+
118
+ # Verify installation
119
+ ax --version
120
+
121
+ # Use the CLI
122
+ ax find "getUserById"
123
+ ax cli # Launch interactive mode
124
+ ```
125
+
126
+ **pnpm is only required for developers** contributing to the AutomatosX codebase.
127
+
60
128
  ### ⚠️ Peer Dependency Warnings
61
129
 
62
130
  When installing AutomatosX, you may see warnings about tree-sitter peer dependencies:
@@ -0,0 +1,341 @@
1
+ # CLI Accessibility Analysis
2
+
3
+ **Date**: 2025-11-15
4
+ **Issue**: Users cannot use `ax` or `automatosx` command after `pnpm install`
5
+
6
+ ## Problem Statement
7
+
8
+ After running `pnpm install` in the AutomatosX repository, developers cannot directly use:
9
+ ```bash
10
+ ax find "Calculator" # Command not found
11
+ automatosx status # Command not found
12
+ ```
13
+
14
+ Instead, they must use:
15
+ ```bash
16
+ pnpm run cli -- find "Calculator" # Works but verbose
17
+ ```
18
+
19
+ ## Root Cause Analysis
20
+
21
+ ### 1. Package is Marked Private
22
+
23
+ **Current state** (`package.json:15`):
24
+ ```json
25
+ {
26
+ "private": true,
27
+ "bin": {
28
+ "ax": "./dist/cli/index.js"
29
+ }
30
+ }
31
+ ```
32
+
33
+ **Impact**:
34
+ - ❌ Cannot publish to npm registry
35
+ - ❌ Cannot install globally (`npm install -g` or `pnpm install -g`)
36
+ - ❌ Binary linking doesn't work for private packages
37
+
38
+ **Why it's private**: Likely to prevent accidental publishing during development
39
+
40
+ ### 2. Binary Not Linked During Development
41
+
42
+ When you run `pnpm install` in a workspace:
43
+ - pnpm installs dependencies
44
+ - pnpm does NOT create symlinks for binaries in private packages
45
+ - The `bin` field is only processed during `npm install -g` or when publishing
46
+
47
+ **Expected behavior** (for published packages):
48
+ ```bash
49
+ npm install -g @defai.digital/automatosx
50
+ # Creates symlinks:
51
+ # /usr/local/bin/ax -> /usr/local/lib/node_modules/@defai.digital/automatosx/dist/cli/index.js
52
+ ```
53
+
54
+ **Actual behavior** (for development):
55
+ ```bash
56
+ pnpm install
57
+ # No symlinks created
58
+ # Must use: pnpm run cli
59
+ ```
60
+
61
+ ## Solutions
62
+
63
+ ### Option A: Link Binary Manually (Development Workaround)
64
+
65
+ **Add to `package.json` scripts**:
66
+ ```json
67
+ {
68
+ "scripts": {
69
+ "postinstall": "pnpm run link-cli",
70
+ "link-cli": "chmod +x dist/cli/index.js && (command -v ax >/dev/null 2>&1 || pnpm link --global)",
71
+ "unlink-cli": "pnpm unlink --global"
72
+ }
73
+ }
74
+ ```
75
+
76
+ **How it works**:
77
+ 1. After `pnpm install`, `postinstall` runs automatically
78
+ 2. Makes CLI executable
79
+ 3. Creates global link: `ax` → `dist/cli/index.js`
80
+
81
+ **Testing**:
82
+ ```bash
83
+ pnpm install # Automatically runs postinstall
84
+ ax find "test" # Now works!
85
+ ```
86
+
87
+ **Pros**:
88
+ - ✅ Automatic after `pnpm install`
89
+ - ✅ Works like a globally installed package
90
+ - ✅ Keeps package private (safe during development)
91
+
92
+ **Cons**:
93
+ - ⚠️ Creates global link (may conflict with other versions)
94
+ - ⚠️ Requires manual unlink before uninstalling
95
+
96
+ ---
97
+
98
+ ### Option B: Use pnpm exec (No Changes Needed)
99
+
100
+ **No code changes required**. Developers can use:
101
+
102
+ ```bash
103
+ # Option 1: pnpm exec
104
+ pnpm exec ax find "Calculator"
105
+
106
+ # Option 2: Direct node execution
107
+ node dist/cli/index.js find "Calculator"
108
+
109
+ # Option 3: npm script (current approach)
110
+ pnpm run cli -- find "Calculator"
111
+ ```
112
+
113
+ **Pros**:
114
+ - ✅ No code changes
115
+ - ✅ No global pollution
116
+ - ✅ Works immediately
117
+
118
+ **Cons**:
119
+ - ❌ Verbose
120
+ - ❌ Doesn't feel like a native CLI
121
+
122
+ ---
123
+
124
+ ### Option C: Create Shell Alias (User-Side Workaround)
125
+
126
+ **Add to `~/.zshrc` or `~/.bashrc`**:
127
+ ```bash
128
+ alias ax='pnpm run cli --'
129
+ alias automatosx='pnpm run cli --'
130
+ ```
131
+
132
+ **Then**:
133
+ ```bash
134
+ ax find "Calculator" # Works!
135
+ ```
136
+
137
+ **Pros**:
138
+ - ✅ Simple and clean
139
+ - ✅ No code changes
140
+ - ✅ Feels native
141
+
142
+ **Cons**:
143
+ - ❌ Requires manual setup per developer
144
+ - ❌ Only works in directories with package.json
145
+
146
+ ---
147
+
148
+ ### Option D: Remove "private": true (Publish to npm)
149
+
150
+ **Change `package.json`**:
151
+ ```json
152
+ {
153
+ "private": false, // Allow publishing
154
+ "name": "@defai.digital/automatosx",
155
+ "version": "8.0.7"
156
+ }
157
+ ```
158
+
159
+ **Then publish**:
160
+ ```bash
161
+ npm publish --access public
162
+ ```
163
+
164
+ **End users can install**:
165
+ ```bash
166
+ npm install -g @defai.digital/automatosx
167
+ ax find "Calculator" # Works globally!
168
+ ```
169
+
170
+ **Pros**:
171
+ - ✅ Best end-user experience
172
+ - ✅ Standard npm package workflow
173
+ - ✅ Binary linking handled automatically
174
+ - ✅ Can publish updates to npm registry
175
+
176
+ **Cons**:
177
+ - ⚠️ Package becomes public (already open-source, so not an issue)
178
+ - ⚠️ Requires npm publishing workflow
179
+ - ⚠️ Must follow semantic versioning strictly
180
+
181
+ ---
182
+
183
+ ### Option E: Hybrid Approach (Recommended)
184
+
185
+ **For developers** (working on the repo):
186
+ - Use `pnpm run cli --` or add shell alias
187
+ - Keep package private during active development
188
+
189
+ **For end users** (using the tool):
190
+ - Publish to npm as a public package
191
+ - Users install with `npm install -g @defai.digital/automatosx`
192
+ - Binary works out of the box
193
+
194
+ **Implementation**:
195
+ 1. Keep `"private": true` in the main branch
196
+ 2. Before releasing, set `"private": false` and publish
197
+ 3. After publishing, revert to `"private": true`
198
+
199
+ **Or better**: Use npm lifecycle scripts to ensure builds before publish:
200
+ ```json
201
+ {
202
+ "scripts": {
203
+ "prepublishOnly": "pnpm run build && pnpm test",
204
+ "publish:cli": "pnpm run build && npm publish --access public"
205
+ }
206
+ }
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Decision Matrix
212
+
213
+ | Criterion | Option A (Link) | Option B (pnpm exec) | Option C (Alias) | Option D (Publish) | Option E (Hybrid) |
214
+ |-----------|----------------|---------------------|------------------|-------------------|-------------------|
215
+ | **Developer UX** | ✅ Excellent | ⚠️ Verbose | ✅ Excellent | ✅ Excellent | ✅ Excellent |
216
+ | **End User UX** | ❌ No access | ❌ No access | ❌ No access | ✅ Excellent | ✅ Excellent |
217
+ | **Setup Complexity** | ⚠️ Auto but risky | ✅ Zero | ⚠️ Manual | ✅ Standard | ⚠️ Workflow needed |
218
+ | **Global Pollution** | ❌ Yes | ✅ No | ✅ No | ⚠️ Intentional | ⚠️ Intentional |
219
+ | **Maintenance** | ⚠️ Medium | ✅ Zero | ✅ Zero | ✅ Low | ⚠️ Medium |
220
+ | **Production Ready** | ❌ No | ❌ No | ❌ No | ✅ Yes | ✅ Yes |
221
+
222
+ ---
223
+
224
+ ## Recommendation
225
+
226
+ ### Immediate Fix (v8.0.8): Option A + Documentation
227
+
228
+ **Add postinstall script for automatic binary linking**:
229
+
230
+ ```json
231
+ {
232
+ "scripts": {
233
+ "postinstall": "node scripts/link-binary.js",
234
+ "preuninstall": "pnpm unlink --global 2>/dev/null || true"
235
+ }
236
+ }
237
+ ```
238
+
239
+ **Create `scripts/link-binary.js`**:
240
+ ```javascript
241
+ #!/usr/bin/env node
242
+ const { execSync } = require('child_process');
243
+ const path = require('path');
244
+ const fs = require('fs');
245
+
246
+ const cliPath = path.join(__dirname, '../dist/cli/index.js');
247
+
248
+ // Only link if dist/cli/index.js exists (after build)
249
+ if (fs.existsSync(cliPath)) {
250
+ try {
251
+ console.log('Linking AutomatosX CLI binary...');
252
+ execSync('pnpm link --global', { stdio: 'inherit' });
253
+ console.log('✅ AutomatosX CLI linked! You can now use "ax" command.');
254
+ } catch (error) {
255
+ console.log('⚠️ Could not link binary automatically. Use "pnpm run cli" instead.');
256
+ }
257
+ } else {
258
+ console.log('⚠️ CLI binary not built yet. Run "pnpm run build" first.');
259
+ }
260
+ ```
261
+
262
+ **Update README.md** with clear instructions:
263
+ ```markdown
264
+ ## Developer Setup
265
+
266
+ After cloning the repository:
267
+
268
+ ```bash
269
+ # Install dependencies and link CLI
270
+ pnpm install
271
+ pnpm run build
272
+
273
+ # The CLI is now available as:
274
+ ax find "Calculator" # Linked automatically after install
275
+ # OR
276
+ pnpm run cli -- find "Calculator" # Alternative method
277
+ ```
278
+
279
+ To unlink:
280
+ ```bash
281
+ pnpm unlink --global
282
+ ```
283
+ ```
284
+
285
+ ---
286
+
287
+ ### Long-term Fix (v9.0.0): Option D (Publish to npm)
288
+
289
+ **Remove `"private": true` and publish officially**:
290
+
291
+ 1. Update package.json: `"private": false`
292
+ 2. Add publishing workflow
293
+ 3. Publish to npm: `npm publish --access public`
294
+ 4. Update all documentation to use: `npm install -g @defai.digital/automatosx`
295
+
296
+ **This is the standard approach for CLI tools.**
297
+
298
+ ---
299
+
300
+ ## Current Workarounds (No Code Changes)
301
+
302
+ For developers RIGHT NOW who want to use `ax` command:
303
+
304
+ ### Workaround 1: Manual Link
305
+ ```bash
306
+ cd /path/to/automatosx2
307
+ pnpm run build
308
+ pnpm link --global
309
+ ax find "Calculator" # Now works!
310
+ ```
311
+
312
+ ### Workaround 2: Shell Alias
313
+ ```bash
314
+ # Add to ~/.zshrc or ~/.bashrc
315
+ alias ax='pnpm run cli --'
316
+
317
+ # Then use:
318
+ ax find "Calculator"
319
+ ```
320
+
321
+ ### Workaround 3: Direct Execution
322
+ ```bash
323
+ # Add to ~/.zshrc or ~/.bashrc
324
+ export PATH="/path/to/automatosx2/dist/cli:$PATH"
325
+
326
+ # Make sure CLI is executable
327
+ chmod +x /path/to/automatosx2/dist/cli/index.js
328
+
329
+ # Then use:
330
+ ax find "Calculator"
331
+ ```
332
+
333
+ ---
334
+
335
+ ## Recommendation Summary
336
+
337
+ **Immediate** (Now): Use manual `pnpm link --global` + document in README
338
+ **Next Release** (v8.0.8): Add postinstall script for automatic linking
339
+ **Future** (v9.0.0): Publish to npm as public package
340
+
341
+ This provides a smooth developer experience while maintaining the ability to publish for end users later.