@aionlabsai/aion 0.2.0 → 0.2.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 (118) hide show
  1. package/README.md +224 -9
  2. package/dist/cli/commands/audit.d.ts.map +1 -1
  3. package/dist/cli/commands/audit.js +461 -20
  4. package/dist/cli/commands/audit.js.map +1 -1
  5. package/dist/cli/commands/chat.d.ts +3 -0
  6. package/dist/cli/commands/chat.d.ts.map +1 -0
  7. package/dist/cli/commands/chat.js +128 -0
  8. package/dist/cli/commands/chat.js.map +1 -0
  9. package/dist/cli/commands/diff.d.ts +3 -0
  10. package/dist/cli/commands/diff.d.ts.map +1 -0
  11. package/dist/cli/commands/diff.js +144 -0
  12. package/dist/cli/commands/diff.js.map +1 -0
  13. package/dist/cli/commands/health.d.ts.map +1 -1
  14. package/dist/cli/commands/health.js +17 -0
  15. package/dist/cli/commands/health.js.map +1 -1
  16. package/dist/cli/commands/init.d.ts +3 -0
  17. package/dist/cli/commands/init.d.ts.map +1 -0
  18. package/dist/cli/commands/init.js +52 -0
  19. package/dist/cli/commands/init.js.map +1 -0
  20. package/dist/cli/commands/report.d.ts.map +1 -1
  21. package/dist/cli/commands/report.js +8 -0
  22. package/dist/cli/commands/report.js.map +1 -1
  23. package/dist/cli/menu.d.ts.map +1 -1
  24. package/dist/cli/menu.js +43 -1
  25. package/dist/cli/menu.js.map +1 -1
  26. package/dist/core/orchestrator.d.ts +2 -1
  27. package/dist/core/orchestrator.d.ts.map +1 -1
  28. package/dist/core/orchestrator.js +2 -2
  29. package/dist/core/orchestrator.js.map +1 -1
  30. package/dist/core/pipelines/audit-pipeline.d.ts +9 -1
  31. package/dist/core/pipelines/audit-pipeline.d.ts.map +1 -1
  32. package/dist/core/pipelines/audit-pipeline.js +98 -9
  33. package/dist/core/pipelines/audit-pipeline.js.map +1 -1
  34. package/dist/index.js +7 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/infra/aion-config.d.ts +26 -0
  37. package/dist/infra/aion-config.d.ts.map +1 -0
  38. package/dist/infra/aion-config.js +60 -0
  39. package/dist/infra/aion-config.js.map +1 -0
  40. package/dist/infra/aion-ignore.d.ts +3 -0
  41. package/dist/infra/aion-ignore.d.ts.map +1 -0
  42. package/dist/infra/aion-ignore.js +35 -0
  43. package/dist/infra/aion-ignore.js.map +1 -0
  44. package/dist/infra/audit-cache.d.ts +39 -0
  45. package/dist/infra/audit-cache.d.ts.map +1 -0
  46. package/dist/infra/audit-cache.js +82 -0
  47. package/dist/infra/audit-cache.js.map +1 -0
  48. package/dist/infra/audit-trend.d.ts +17 -0
  49. package/dist/infra/audit-trend.d.ts.map +1 -0
  50. package/dist/infra/audit-trend.js +113 -0
  51. package/dist/infra/audit-trend.js.map +1 -0
  52. package/dist/infra/db/store.d.ts.map +1 -1
  53. package/dist/infra/db/store.js +14 -7
  54. package/dist/infra/db/store.js.map +1 -1
  55. package/dist/infra/embeddings.d.ts.map +1 -1
  56. package/dist/infra/embeddings.js +32 -14
  57. package/dist/infra/embeddings.js.map +1 -1
  58. package/dist/prompts/scanner.d.ts +1 -0
  59. package/dist/prompts/scanner.d.ts.map +1 -1
  60. package/dist/prompts/scanner.js +4 -0
  61. package/dist/prompts/scanner.js.map +1 -1
  62. package/package.json +24 -19
  63. package/dist/agents/planner.test.d.ts +0 -2
  64. package/dist/agents/planner.test.d.ts.map +0 -1
  65. package/dist/agents/planner.test.js +0 -21
  66. package/dist/agents/planner.test.js.map +0 -1
  67. package/dist/core/cost-tracker.test.d.ts +0 -2
  68. package/dist/core/cost-tracker.test.d.ts.map +0 -1
  69. package/dist/core/cost-tracker.test.js +0 -36
  70. package/dist/core/cost-tracker.test.js.map +0 -1
  71. package/dist/core/pipelines/audit-pipeline.test.d.ts +0 -2
  72. package/dist/core/pipelines/audit-pipeline.test.d.ts.map +0 -1
  73. package/dist/core/pipelines/audit-pipeline.test.js +0 -135
  74. package/dist/core/pipelines/audit-pipeline.test.js.map +0 -1
  75. package/dist/core/repo-context.d.ts +0 -2
  76. package/dist/core/repo-context.d.ts.map +0 -1
  77. package/dist/core/repo-context.js +0 -12
  78. package/dist/core/repo-context.js.map +0 -1
  79. package/dist/core/repo-context.test.d.ts +0 -2
  80. package/dist/core/repo-context.test.d.ts.map +0 -1
  81. package/dist/core/repo-context.test.js +0 -40
  82. package/dist/core/repo-context.test.js.map +0 -1
  83. package/dist/core/runtime-policy.test.d.ts +0 -2
  84. package/dist/core/runtime-policy.test.d.ts.map +0 -1
  85. package/dist/core/runtime-policy.test.js +0 -27
  86. package/dist/core/runtime-policy.test.js.map +0 -1
  87. package/dist/infra/bm25.test.d.ts +0 -2
  88. package/dist/infra/bm25.test.d.ts.map +0 -1
  89. package/dist/infra/bm25.test.js +0 -17
  90. package/dist/infra/bm25.test.js.map +0 -1
  91. package/dist/infra/chunker.test.d.ts +0 -2
  92. package/dist/infra/chunker.test.d.ts.map +0 -1
  93. package/dist/infra/chunker.test.js +0 -33
  94. package/dist/infra/chunker.test.js.map +0 -1
  95. package/dist/infra/db/database.d.ts +0 -4
  96. package/dist/infra/db/database.d.ts.map +0 -1
  97. package/dist/infra/db/database.js +0 -25
  98. package/dist/infra/db/database.js.map +0 -1
  99. package/dist/infra/evidence-gate.test.d.ts +0 -2
  100. package/dist/infra/evidence-gate.test.d.ts.map +0 -1
  101. package/dist/infra/evidence-gate.test.js +0 -36
  102. package/dist/infra/evidence-gate.test.js.map +0 -1
  103. package/dist/infra/repo-index.test.d.ts +0 -2
  104. package/dist/infra/repo-index.test.d.ts.map +0 -1
  105. package/dist/infra/repo-index.test.js +0 -53
  106. package/dist/infra/repo-index.test.js.map +0 -1
  107. package/dist/infra/repo-query.test.d.ts +0 -2
  108. package/dist/infra/repo-query.test.d.ts.map +0 -1
  109. package/dist/infra/repo-query.test.js +0 -34
  110. package/dist/infra/repo-query.test.js.map +0 -1
  111. package/dist/infra/semgrep.test.d.ts +0 -2
  112. package/dist/infra/semgrep.test.d.ts.map +0 -1
  113. package/dist/infra/semgrep.test.js +0 -39
  114. package/dist/infra/semgrep.test.js.map +0 -1
  115. package/dist/schemas/audit.test.d.ts +0 -2
  116. package/dist/schemas/audit.test.d.ts.map +0 -1
  117. package/dist/schemas/audit.test.js +0 -41
  118. package/dist/schemas/audit.test.js.map +0 -1
package/README.md CHANGED
@@ -2,12 +2,70 @@
2
2
 
3
3
  Multi-agent AI engineering runtime for auditing, analyzing, reviewing, and fixing code from the terminal.
4
4
 
5
+ ## What It Does
6
+
7
+ Aion is a terminal-first engineering assistant for working inside codebases. It combines quick local scans with multi-agent AI workflows for deeper analysis.
8
+
9
+ Use it to:
10
+
11
+ - Audit a repository across security, architecture, testing, reliability, data, dependencies, and AI prompt risks.
12
+ - Analyze bugs or issue descriptions.
13
+ - Review files, diffs, or risky changes.
14
+ - Run zero-token local scans for secrets, env vars, SBOM, API maps, and cognitive load.
15
+ - Generate dependency graphs, health reports, churn reports, and onboarding guides.
16
+ - Use natural language from the terminal.
17
+
5
18
  ## Install
6
19
 
7
20
  ```bash
8
21
  npm install -g @aionlabsai/aion
9
22
  ```
10
23
 
24
+ Verify the install:
25
+
26
+ ```bash
27
+ aion --version
28
+ aion --help
29
+ ```
30
+
31
+ The package also installs the `ai-runtime` command.
32
+
33
+ ## Requirements
34
+
35
+ - Node.js 18 or newer
36
+ - One configured AI provider for AI-powered commands
37
+ - Git for churn and repository history features
38
+ - Optional: Semgrep for deeper static analysis integration
39
+
40
+ ## Provider Setup
41
+
42
+ ### Claude SDK
43
+
44
+ ```bash
45
+ export ANTHROPIC_API_KEY="your_key_here"
46
+ ```
47
+
48
+ ### Claude CLI
49
+
50
+ Without `ANTHROPIC_API_KEY`, Aion can use an authenticated `claude` CLI session when available:
51
+
52
+ ```bash
53
+ claude /login
54
+ ```
55
+
56
+ ### OpenRouter
57
+
58
+ ```bash
59
+ export OPENROUTER_API_KEY="your_key_here"
60
+ export OPENROUTER_MODEL="moonshotai/kimi-k2"
61
+ ```
62
+
63
+ ### Codex
64
+
65
+ ```bash
66
+ export AI_RUNTIME_CODEX_MODEL="gpt-5-codex"
67
+ ```
68
+
11
69
  ## Usage
12
70
 
13
71
  ```bash
@@ -18,24 +76,181 @@ aion analyze .
18
76
  aion "review this project and find risky code"
19
77
  ```
20
78
 
21
- The package also installs the `ai-runtime` command.
79
+ ## Interactive Menu
22
80
 
23
- ## Requirements
81
+ Run:
24
82
 
25
- - Node.js 18 or newer
26
- - A configured AI provider
83
+ ```bash
84
+ aion menu
85
+ ```
86
+
87
+ The menu includes:
27
88
 
28
- For Claude SDK usage:
89
+ - Audit presets
90
+ - Reports
91
+ - Dependency graph
92
+ - Churn analysis
93
+ - Local scans
94
+ - Pattern detection
95
+ - Health score
96
+ - Explain and onboarding commands
97
+ - Built-in terminal documentation
98
+ - Natural language mode
99
+
100
+ ## Common Commands
101
+
102
+ ### Audit
29
103
 
30
104
  ```bash
31
- export ANTHROPIC_API_KEY="your_key_here"
105
+ aion audit . --local-only
106
+ aion audit .
107
+ aion audit . --preset security
108
+ aion audit . --preset ai --budget normal
109
+ aion audit . --domains security,dependencies,compliance
110
+ aion audit . --preset security --max-files 20
32
111
  ```
33
112
 
34
- Without `ANTHROPIC_API_KEY`, Aion can use an authenticated `claude` CLI session when available.
113
+ Useful presets:
114
+
115
+ - `security`
116
+ - `ai`
117
+ - `backend`
118
+ - `devops`
119
+ - `quality`
120
+ - `saas`
121
+ - `fintech`
122
+ - `full` requires `--force-full` because it can start every AI scanner and spend heavily.
35
123
 
36
- ## Package
124
+ Cost controls:
37
125
 
38
126
  ```bash
39
- npm install -g @aionlabsai/aion
127
+ aion audit . --local-only
128
+ aion audit . --preset security --scanners 2
129
+ aion audit . --preset security --max-files 20
130
+ aion audit . --preset full --force-full --budget deep --scanner-timeout 240
131
+ ```
132
+
133
+ Local scans still inspect the whole repository. `--max-files` only limits the prioritized file list handed to AI scanners.
134
+
135
+ ### Analyze, Review, Fix
136
+
137
+ ```bash
138
+ aion analyze "login fails after token refresh"
139
+ aion review src/auth/middleware.ts
140
+ aion fix "users can bypass tenant isolation"
141
+ ```
142
+
143
+ ### Local Scans
144
+
145
+ These scans do not require model calls:
146
+
147
+ ```bash
148
+ aion scan secrets
149
+ aion scan env-audit
150
+ aion scan sbom
151
+ aion scan sbom --unpinned-only
152
+ aion scan api-map
153
+ aion scan cognitive-load
154
+ ```
155
+
156
+ ### Reports And Graphs
157
+
158
+ ```bash
159
+ aion health
160
+ aion report
161
+ aion report --md
162
+ aion graph
163
+ aion churn
164
+ aion patterns
165
+ ```
166
+
167
+ ### Explain And Onboard
168
+
169
+ ```bash
170
+ aion explain src/index.ts
171
+ aion impact src/index.ts
172
+ aion onboard
173
+ ```
174
+
175
+ ### Natural Language
176
+
177
+ ```bash
178
+ aion "audit this repository for dependency and secret risks"
179
+ aion "explain the auth module"
180
+ aion "find risky code in the payment flow"
181
+ ```
182
+
183
+ ## Runtime Files
184
+
185
+ Aion writes local runtime data under project-local or user-local folders depending on the command:
186
+
187
+ - `.ai-runtime/` for generated reports and repository indexes
188
+ - `.ai-runtime/reports/latest-audit.json` points to the latest audit run
189
+ - `.ai-runtime/reports/audits/<timestamp>/` stores organized audit output
190
+ - `.ai-memory/` for optional memory/knowledge files
191
+ - `~/.ai-runtime/` for task history unless `AI_RUNTIME_DB_PATH` is set
192
+
193
+ Each organized audit run contains:
194
+
195
+ - `index.html`
196
+ - `summary.md`
197
+ - `action-plan.md`
198
+ - `report.json`
199
+ - `action-items.json`
200
+ - `files-hotspots.json`
201
+ - `README.md`
202
+ - `findings-by-persona.json`
203
+ - `findings-by-severity.json`
204
+ - `findings-by-category.json`
205
+
206
+ Override the task store path:
207
+
208
+ ```bash
209
+ export AI_RUNTIME_DB_PATH="/path/to/aion-store"
40
210
  ```
41
211
 
212
+ ## Security Checks
213
+
214
+ Recommended checks before publishing or releasing:
215
+
216
+ ```bash
217
+ npm test
218
+ npm audit --audit-level=moderate
219
+ aion scan secrets
220
+ aion scan env-audit
221
+ aion scan sbom --unpinned-only
222
+ ```
223
+
224
+ ## Development
225
+
226
+ ```bash
227
+ npm install
228
+ npm test
229
+ npm run build
230
+ node dist/index.js --help
231
+ ```
232
+
233
+ Install the local checkout globally:
234
+
235
+ ```bash
236
+ npm link
237
+ aion --version
238
+ ```
239
+
240
+ ## Publishing
241
+
242
+ Update the version, validate, then publish:
243
+
244
+ ```bash
245
+ npm version patch
246
+ npm test
247
+ npm audit --audit-level=moderate
248
+ npm pack --dry-run
249
+ npm publish --access public
250
+ ```
251
+
252
+ Package:
253
+
254
+ ```bash
255
+ npm install -g @aionlabsai/aion
256
+ ```
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqIzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyFpD"}
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyjBzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkKpD"}