@automaton-labs/aib 0.0.6 → 0.0.7

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 (247) hide show
  1. package/dist/bin/cli.js +4 -2
  2. package/dist/commands/apply-module-plan.js +3 -3
  3. package/dist/commands/background-command.js +2 -0
  4. package/dist/commands/captured-input.js +1 -2
  5. package/dist/commands/config-command.js +2 -2
  6. package/dist/commands/config-output.js +10 -10
  7. package/dist/commands/control-plane-command.js +1 -0
  8. package/dist/commands/declaration-command.js +7 -0
  9. package/dist/commands/declaration-execution-cache.js +1 -0
  10. package/dist/commands/declaration-format.js +1 -0
  11. package/dist/commands/declaration-preview-cache.js +2 -0
  12. package/dist/commands/doctor.js +3 -2
  13. package/dist/commands/execution-command.js +1 -1
  14. package/dist/commands/file-command.js +1 -0
  15. package/dist/commands/file-move-to-dir-execution-cache.js +1 -0
  16. package/dist/commands/file-move-to-dir-preview-cache.js +2 -0
  17. package/dist/commands/file-move-to-dir.js +5 -0
  18. package/dist/commands/file-mutation-runtime.js +1 -0
  19. package/dist/commands/file-refactor-batch-execution-cache.js +1 -0
  20. package/dist/commands/file-refactor-batch-preview-cache.js +2 -0
  21. package/dist/commands/file-refactor-batch.js +5 -0
  22. package/dist/commands/file-rename-execution-cache.js +1 -0
  23. package/dist/commands/file-rename-preview-cache.js +2 -0
  24. package/dist/commands/file-rename.js +5 -0
  25. package/dist/commands/help-command.js +5 -5
  26. package/dist/commands/host-command.js +1 -0
  27. package/dist/commands/inspect-cycles.js +3 -3
  28. package/dist/commands/inspect-format.js +15 -15
  29. package/dist/commands/inspect-tree.js +2 -2
  30. package/dist/commands/inspect.js +12 -12
  31. package/dist/commands/move-to-file.js +2 -2
  32. package/dist/commands/ota-command.js +2 -0
  33. package/dist/commands/quick-read.js +4 -4
  34. package/dist/commands/refactor-batch.js +4 -4
  35. package/dist/commands/rename-entities.js +4 -4
  36. package/dist/commands/result-view.js +6 -5
  37. package/dist/commands/worker-command.js +1 -0
  38. package/dist/config/defaults.js +1 -1
  39. package/dist/config/env-vars.js +1 -1
  40. package/dist/config/path-aliases.js +1 -1
  41. package/dist/config/resolve-command-alias.js +1 -1
  42. package/dist/content/content-bundle.js +1 -1
  43. package/dist/dsl/aib-dsl.js +1 -1
  44. package/dist/dsl/declaration-dsl.js +1 -0
  45. package/dist/dsl/file-move-to-dir-dsl.js +1 -0
  46. package/dist/dsl/file-refactor-batch-dsl.js +1 -0
  47. package/dist/dsl/file-rename-dsl.js +1 -0
  48. package/dist/help/{json/bootstrap.md → bootstrap.bash.md} +214 -392
  49. package/dist/help/bootstrap.md +101 -137
  50. package/dist/help/{json/full.md → bootstrap.pwsh.md} +214 -392
  51. package/dist/help/docs/dsl.md +4 -3
  52. package/dist/help/docs/file.move.md +46 -0
  53. package/dist/help/docs/file.rename.md +35 -0
  54. package/dist/help/docs/inspect.code.md +5 -5
  55. package/dist/help/docs/inspect.deps.md +7 -7
  56. package/dist/help/docs/inspect.file.md +2 -1
  57. package/dist/help/docs/inspect.graph.md +3 -3
  58. package/dist/help/docs/inspect.md +5 -5
  59. package/dist/help/docs/mutation.md +23 -13
  60. package/dist/help/docs/patterns.md +1 -5
  61. package/dist/help/docs/qr.md +7 -22
  62. package/dist/help/docs/quick-map.md +1 -0
  63. package/dist/help/docs/recipe.file-layout.md +15 -0
  64. package/dist/help/docs/rg.md +22 -0
  65. package/dist/help/docs/selectors.md +3 -2
  66. package/dist/help/docs/session.md +1 -1
  67. package/dist/help/dsl/bootstrap.bash.md +907 -0
  68. package/dist/help/dsl/bootstrap.md +101 -137
  69. package/dist/help/dsl/bootstrap.pwsh.md +907 -0
  70. package/dist/help/dsl/docs/dsl.md +4 -3
  71. package/dist/help/dsl/docs/file.move.md +46 -0
  72. package/dist/help/dsl/docs/file.rename.md +35 -0
  73. package/dist/help/dsl/docs/inspect.code.md +5 -5
  74. package/dist/help/dsl/docs/inspect.deps.md +7 -7
  75. package/dist/help/dsl/docs/inspect.file.md +2 -1
  76. package/dist/help/dsl/docs/inspect.graph.md +3 -3
  77. package/dist/help/dsl/docs/inspect.md +5 -5
  78. package/dist/help/dsl/docs/mutation.md +23 -13
  79. package/dist/help/dsl/docs/patterns.md +1 -5
  80. package/dist/help/dsl/docs/qr.md +7 -22
  81. package/dist/help/dsl/docs/quick-map.md +1 -0
  82. package/dist/help/dsl/docs/recipe.file-layout.md +15 -0
  83. package/dist/help/dsl/docs/rg.md +22 -0
  84. package/dist/help/dsl/docs/selectors.md +3 -2
  85. package/dist/help/dsl/docs/session.md +1 -1
  86. package/dist/help/dsl/full.md +101 -137
  87. package/dist/help/dsl/help-index.md +44 -0
  88. package/dist/help/dsl/tokens/qr.inline.examples.md +2 -0
  89. package/dist/help/dsl/tokens/stdin.examples.bash.md +8 -0
  90. package/dist/help/dsl/tokens/stdin.examples.pwsh.md +8 -0
  91. package/dist/help/dsl/tokens/stdin.examples.with-qr.bash.md +12 -0
  92. package/dist/help/dsl/tokens/stdin.examples.with-qr.pwsh.md +12 -0
  93. package/dist/help/dsl/topics/dsl.md +4 -3
  94. package/dist/help/dsl/topics/file.move.md +44 -0
  95. package/dist/help/dsl/topics/file.rename.md +33 -0
  96. package/dist/help/dsl/topics/inspect.code.md +5 -5
  97. package/dist/help/dsl/topics/inspect.deps.md +7 -7
  98. package/dist/help/dsl/topics/inspect.file.md +2 -1
  99. package/dist/help/dsl/topics/inspect.graph.md +3 -3
  100. package/dist/help/dsl/topics/inspect.md +5 -5
  101. package/dist/help/dsl/topics/mutation.md +23 -13
  102. package/dist/help/dsl/topics/patterns.md +1 -5
  103. package/dist/help/dsl/topics/qr.md +7 -22
  104. package/dist/help/dsl/topics/quick-map.md +1 -0
  105. package/dist/help/dsl/topics/recipe.file-layout.md +13 -0
  106. package/dist/help/dsl/topics/rg.md +20 -0
  107. package/dist/help/dsl/topics/selectors.md +3 -2
  108. package/dist/help/dsl/topics/session.md +1 -1
  109. package/dist/help/full.md +101 -137
  110. package/dist/help/help-index.md +44 -0
  111. package/dist/help/help-meta.json +43 -27
  112. package/dist/help/index.md +32 -75
  113. package/dist/help/tokens/qr.inline.examples.md +2 -0
  114. package/dist/help/tokens/stdin.examples.bash.md +8 -0
  115. package/dist/help/tokens/stdin.examples.pwsh.md +8 -0
  116. package/dist/help/tokens/stdin.examples.with-qr.bash.md +12 -0
  117. package/dist/help/tokens/stdin.examples.with-qr.pwsh.md +12 -0
  118. package/dist/help/topics/dsl.md +4 -3
  119. package/dist/help/topics/file.move.md +44 -0
  120. package/dist/help/topics/file.rename.md +33 -0
  121. package/dist/help/topics/inspect.code.md +5 -5
  122. package/dist/help/topics/inspect.deps.md +7 -7
  123. package/dist/help/topics/inspect.file.md +2 -1
  124. package/dist/help/topics/inspect.graph.md +3 -3
  125. package/dist/help/topics/inspect.md +5 -5
  126. package/dist/help/topics/mutation.md +23 -13
  127. package/dist/help/topics/patterns.md +1 -5
  128. package/dist/help/topics/qr.md +7 -22
  129. package/dist/help/topics/quick-map.md +1 -0
  130. package/dist/help/topics/recipe.file-layout.md +13 -0
  131. package/dist/help/topics/rg.md +20 -0
  132. package/dist/help/topics/selectors.md +3 -2
  133. package/dist/help/topics/session.md +1 -1
  134. package/dist/host/capabilities.js +1 -0
  135. package/dist/ide-launch/common.cjs +162 -162
  136. package/dist/managed-host/extension-vsix-resolver.js +1 -1
  137. package/dist/managed-host/manage-serve-web-host.cjs +141 -141
  138. package/dist/managed-host/serve-web-autostart.js +1 -1
  139. package/dist/managed-host/serve-web-host.cjs +1781 -1570
  140. package/dist/payloads/read-stdin-json.js +1 -1
  141. package/dist/rg-wrapper/core.js +6 -0
  142. package/dist/rg-wrapper/options.js +1 -0
  143. package/dist/rtk-wrapper/core.js +2 -0
  144. package/dist/runtime/input-source.js +1 -1
  145. package/dist/runtime/run-command.js +1 -1
  146. package/dist/selectors/parse-entities.js +1 -1
  147. package/dist/session/daemon-state.js +2 -0
  148. package/dist/session/server.js +7 -8
  149. package/dist/shared/operations.js +1 -1
  150. package/dist/shared/protocol.js +1 -1
  151. package/dist/shared/routes.js +1 -1
  152. package/dist/shared/stdin-examples.js +1 -3
  153. package/dist/shared/types.js +1 -1
  154. package/dist/tool-runtime/runtime-tools.js +1 -0
  155. package/dist/workers/control-plane/aib-control-plane-worker.cjs +80 -0
  156. package/dist/workers/control-plane/client-config.default.json +3 -0
  157. package/dist/workers/product-storage.js +1 -0
  158. package/dist/workers/registry.js +1 -0
  159. package/extension/vscode-refactor-bridge-extension.vsix +0 -0
  160. package/package.json +6 -4
  161. package/runtimes/launcher/linux-x64/aib +0 -0
  162. package/runtimes/launcher/win-x64/aib.exe +0 -0
  163. package/runtimes/tools/rg/darwin-arm64/rg +0 -0
  164. package/runtimes/tools/rg/darwin-x64/rg +0 -0
  165. package/runtimes/tools/rg/linux-arm64/rg +0 -0
  166. package/runtimes/tools/rg/linux-x64/rg +0 -0
  167. package/runtimes/tools/rg/manifest.json +36 -0
  168. package/runtimes/tools/rg/win32-x64/rg.exe +0 -0
  169. package/runtimes/tools/rtk/darwin-arm64/rtk +0 -0
  170. package/runtimes/tools/rtk/darwin-x64/rtk +0 -0
  171. package/runtimes/tools/rtk/linux-arm64/rtk +0 -0
  172. package/runtimes/tools/rtk/linux-x64/rtk +0 -0
  173. package/runtimes/tools/rtk/manifest.json +36 -0
  174. package/runtimes/tools/rtk/win32-x64/rtk.exe +0 -0
  175. package/dist/help/json/docs/basics.md +0 -15
  176. package/dist/help/json/docs/config-setup.aliases.md +0 -56
  177. package/dist/help/json/docs/config-setup.excludes.md +0 -45
  178. package/dist/help/json/docs/config-setup.import-normalize.md +0 -86
  179. package/dist/help/json/docs/config-setup.import-rules.md +0 -96
  180. package/dist/help/json/docs/config-setup.tsconfigs.md +0 -33
  181. package/dist/help/json/docs/dsl.md +0 -25
  182. package/dist/help/json/docs/first-setup.md +0 -292
  183. package/dist/help/json/docs/help-format.md +0 -9
  184. package/dist/help/json/docs/help-protocol.md +0 -26
  185. package/dist/help/json/docs/imports.normalize.md +0 -47
  186. package/dist/help/json/docs/inspect.code.md +0 -41
  187. package/dist/help/json/docs/inspect.cycles.md +0 -38
  188. package/dist/help/json/docs/inspect.deps.md +0 -46
  189. package/dist/help/json/docs/inspect.duplicates.md +0 -65
  190. package/dist/help/json/docs/inspect.exports.md +0 -40
  191. package/dist/help/json/docs/inspect.file.md +0 -38
  192. package/dist/help/json/docs/inspect.graph.md +0 -139
  193. package/dist/help/json/docs/inspect.imports.md +0 -15
  194. package/dist/help/json/docs/inspect.md +0 -88
  195. package/dist/help/json/docs/inspect.members.md +0 -32
  196. package/dist/help/json/docs/inspect.tree.md +0 -32
  197. package/dist/help/json/docs/inspect.usages.md +0 -61
  198. package/dist/help/json/docs/modulePlan.md +0 -73
  199. package/dist/help/json/docs/move.md +0 -56
  200. package/dist/help/json/docs/mutation.md +0 -65
  201. package/dist/help/json/docs/patterns.md +0 -76
  202. package/dist/help/json/docs/prefs.md +0 -40
  203. package/dist/help/json/docs/qr.md +0 -37
  204. package/dist/help/json/docs/quick-map.md +0 -30
  205. package/dist/help/json/docs/refactor.batch.md +0 -72
  206. package/dist/help/json/docs/rename.md +0 -47
  207. package/dist/help/json/docs/reveal.md +0 -30
  208. package/dist/help/json/docs/selectors.md +0 -23
  209. package/dist/help/json/docs/session.md +0 -77
  210. package/dist/help/json/docs/view.md +0 -30
  211. package/dist/help/json/snippets/agents.md +0 -14
  212. package/dist/help/json/topics/basics.md +0 -13
  213. package/dist/help/json/topics/config-setup.aliases.md +0 -54
  214. package/dist/help/json/topics/config-setup.excludes.md +0 -43
  215. package/dist/help/json/topics/config-setup.import-normalize.md +0 -84
  216. package/dist/help/json/topics/config-setup.import-rules.md +0 -94
  217. package/dist/help/json/topics/config-setup.tsconfigs.md +0 -31
  218. package/dist/help/json/topics/dsl.md +0 -23
  219. package/dist/help/json/topics/first-setup.md +0 -290
  220. package/dist/help/json/topics/help-format.md +0 -7
  221. package/dist/help/json/topics/help-protocol.md +0 -24
  222. package/dist/help/json/topics/imports.normalize.md +0 -45
  223. package/dist/help/json/topics/inspect.code.md +0 -39
  224. package/dist/help/json/topics/inspect.cycles.md +0 -36
  225. package/dist/help/json/topics/inspect.deps.md +0 -44
  226. package/dist/help/json/topics/inspect.duplicates.md +0 -37
  227. package/dist/help/json/topics/inspect.exports.md +0 -38
  228. package/dist/help/json/topics/inspect.file.md +0 -36
  229. package/dist/help/json/topics/inspect.graph.md +0 -137
  230. package/dist/help/json/topics/inspect.imports.md +0 -13
  231. package/dist/help/json/topics/inspect.md +0 -86
  232. package/dist/help/json/topics/inspect.members.md +0 -30
  233. package/dist/help/json/topics/inspect.tree.md +0 -22
  234. package/dist/help/json/topics/inspect.usages.md +0 -59
  235. package/dist/help/json/topics/modulePlan.md +0 -60
  236. package/dist/help/json/topics/move.md +0 -46
  237. package/dist/help/json/topics/mutation.md +0 -63
  238. package/dist/help/json/topics/patterns.md +0 -74
  239. package/dist/help/json/topics/prefs.md +0 -38
  240. package/dist/help/json/topics/qr.md +0 -35
  241. package/dist/help/json/topics/quick-map.md +0 -28
  242. package/dist/help/json/topics/refactor.batch.md +0 -61
  243. package/dist/help/json/topics/rename.md +0 -42
  244. package/dist/help/json/topics/reveal.md +0 -28
  245. package/dist/help/json/topics/selectors.md +0 -21
  246. package/dist/help/json/topics/session.md +0 -59
  247. package/dist/help/json/topics/view.md +0 -28
@@ -1,34 +1,40 @@
1
- AIB
2
-
3
- aib is a local CLI for TS/JS code work backed by IDE and TypeScript APIs.
4
- It can inspect symbols, usages, dependencies, duplicates, focused code, and run IDE-backed mutations.
1
+ AIB
2
+
3
+ aib is a local CLI for TS/JS code work backed by IDE and TypeScript APIs.
4
+ It can inspect symbols, usages, dependencies, duplicates, focused code, and run IDE-backed mutations.
5
+
6
+ aib is designed for agent workflows:
7
+ batch requests, compact text output, session handles, and reusable artifacts.
5
8
 
6
- aib is designed for agent workflows:
7
- batch requests, compact text output, session handles, captured inputs, and reusable outputs.
9
+ Inline commands omit the aib prefix.
10
+ When you see:
11
+ session clear
8
12
 
9
- Inline commands omit the aib prefix.
10
- When you see:
11
- session prefs get
12
-
13
- Run:
14
- aib session prefs get
13
+ Run:
14
+ aib session clear
15
15
 
16
16
  Stdin examples show command and input separately to avoid shell-specific syntax.
17
17
  Stdin Run lines include the aib prefix to avoid confusion.
18
18
 
19
- {{stdin.examples}}
19
+ PowerShell:
20
+ @'
21
+ <input>
22
+ '@ | aib <command> --stdin
23
+
24
+ @'
25
+ tree . +onlyDirs limit=20
26
+ '@ | aib inspect --stdin
20
27
 
21
28
  Basics
22
29
 
23
- Use the active session while you work.
24
- Reuse captured inputs when editing them is cheaper than rebuilding large JSON.
30
+ Use the active session while you work.
25
31
 
26
32
  Examples are patterns, not limits.
27
33
  Feature sections show common high-value uses, not every valid use.
28
34
  Adapt requests to the task: combine features, batch related questions, and skip steps when you already have enough context.
29
35
 
30
- Prefer batch JSON instead of inline calls.
31
- One request can inspect/mutate several files/entities and save reusable outputs.
36
+ Prefer batch DSL instead of one-off inline calls.
37
+ One request can inspect/mutate several files/entities and save reusable artifacts when supported.
32
38
  Use one-off commands only for small checks/changes.
33
39
 
34
40
  For mutations, aib asks TS/IDE refactors to update affected references and imports.
@@ -60,7 +66,7 @@ Use normal text search when the question is just text.
60
66
 
61
67
  For a first pass in a new codebase, map directories before reading files:
62
68
 
63
- tree src depth=5 +onlyDirs limit=200
69
+ aib inspect tree src --depth 5 --only-dirs --limit 200
64
70
 
65
71
  Start compact for broad scans.
66
72
  Use summary, locations, or local graph views first when output could be large.
@@ -70,10 +76,6 @@ If output hides data and shows `view: aib:res_<id>`, use `aib view ...` to fetch
70
76
  Compact output is a starting point, not a substitute for needed code.
71
77
  Fetch exact code when correctness depends on implementation details.
72
78
 
73
- Use prefs when the current phase repeats the same output shape.
74
- Turn details off when they stop helping.
75
- Turn them back on when they matter.
76
-
77
79
  For mutation commands, set the shell/tool harness timeout to 3 minutes.
78
80
 
79
81
  If a mutation command times out or returns no final output, use:
@@ -99,7 +101,7 @@ If move/modulePlan imports do not match the repo style, run:
99
101
  aib help config-setup.import-rules
100
102
 
101
103
  If you are about to change import style across files, add or adopt tsconfig aliases, or clean imports repeatedly, run:
102
- aib help config-setup.import-normalize
104
+ aib help config-setup.import-normalize imports.normalize
103
105
 
104
106
  If tree/graph output includes known repo noise, run:
105
107
  aib help config-setup.excludes
@@ -194,7 +196,7 @@ Start by creating or selecting your session.
194
196
  Create it once, then reuse it.
195
197
  Do not create a new session for every command or subtask.
196
198
 
197
- Session stores captured inputs, saved outputs, aliases, and prefs.
199
+ Session stores saved artifacts and aliases.
198
200
 
199
201
  Prefer short session names:
200
202
  aa, tr, qa, a2
@@ -209,7 +211,7 @@ aib -s <name> <command>
209
211
  Or bind this shell:
210
212
  AIB=<name>
211
213
 
212
- If you want to prune session inputs/outputs, use:
214
+ If you want to prune session data, use:
213
215
  session clear
214
216
 
215
217
  After clear, keep using the same session.
@@ -222,62 +224,6 @@ Reusable index handles look like:
222
224
 
223
225
  Pass index handles back to the matching inspect command with `--from-file` or `from` in DSL.
224
226
 
225
- Every JSON stdin/from request is captured in the active session.
226
-
227
- Latest captured input:
228
- <session-dir>/inputs/<kind>/_last.json
229
-
230
- Handle:
231
- aib:input:<kind>:last
232
-
233
- Use --from when editing the captured input costs less than rebuilding the request.
234
- This is usually true for large batches, partial failures, or multi-step mutation plans.
235
- For small one-off requests, write a corrected request instead.
236
-
237
- Example:
238
- A refactor batch moves symbols into 5 files.
239
- The first 2 moves are done, and the 3rd fails in TypeScript.
240
- Edit <session-dir>/inputs/refactor/_last.json:
241
- - remove the already completed moves
242
- - change or remove the failed move
243
- - keep the remaining moves
244
-
245
- Then rerun:
246
- aib refactor batch <command> --from aib:input:refactor:last
247
-
248
- Prefs
249
-
250
- Prefs change defaults for the active session.
251
- Use them when you want repeated CLI behavior without repeating request fields.
252
-
253
- Set prefs:
254
- session prefs set <name> <value> [<name> <value>...]
255
-
256
- Example:
257
- session prefs set inspect.graph.hubs false inspect.graph.leaves false
258
-
259
- Show prefs:
260
- session prefs get [prefix] [--all]
261
-
262
- By default, get shows session overrides.
263
- --all includes defaults.
264
- prefix filters keys.
265
-
266
- boolean = true|false
267
- N = integer
268
-
269
- Available prefs:
270
- inspect.code.maxNonEmptyLines N
271
- inspect.usages.maxLocations N
272
- inspect.usages.maxCodeBlocks N
273
- inspect.members.maxItems N
274
- inspect.members.all boolean
275
- inspect.graph.hubs boolean
276
- inspect.graph.entrypoints boolean
277
- inspect.graph.leaves boolean
278
- inspect.graph.edges boolean
279
- inspect.graph.symbolUsage boolean
280
-
281
227
  Selectors identify symbols when names are ambiguous.
282
228
  Use plain names when they are unambiguous.
283
229
  Use selectors when aib reports ambiguity or when different symbol kinds share a name.
@@ -296,9 +242,10 @@ c-Name class
296
242
  i-Name interface
297
243
  t-Name type
298
244
  v-name variable
299
- e-Name enum
300
- m-name method, usually with parent in JSON
301
- p-name property, usually with parent in JSON
245
+ e-Name enum
246
+ ns-Name namespace
247
+ m-name method, usually with parent
248
+ p-name property, usually with parent
302
249
 
303
250
  DSL request model:
304
251
  - directives set defaults for following requests
@@ -310,9 +257,10 @@ DSL request model:
310
257
  - For one-off file operations, pass the path directly.
311
258
 
312
259
  Syntax:
313
- @file <path> default file
314
- @source <path> default sourceFile for mutations
315
- op arg arg key=value request
260
+ @file <path> default file
261
+ @source <path> default sourceFile for mutations
262
+ @base <dir> default base dir for file mutations
263
+ op arg arg key=value request
316
264
  +flag boolean true
317
265
  -flag boolean false
318
266
  >name save reusable artifact when supported
@@ -354,67 +302,51 @@ local import cycles cycles
354
302
  Cycles are available but not expanded in bootstrap:
355
303
  aib help inspect.cycles
356
304
 
357
- Prefer one batch JSON request for related questions.
358
- Top-level fields are defaults for every request.
359
- A request without op uses the top-level op.
360
- A request without file/scope/target uses the top-level value when applicable.
361
- Each request may override any default.
362
-
363
- Batch example:
364
-
365
- Run:
366
- aib inspect --stdin
367
-
368
- Input:
369
- {
370
- "file": "src/service.ts",
371
- "requests": [
372
- { "op": "file" },
373
- { "op": "members", "entity": "Service" },
374
- {
375
- "op": "code",
376
- "entities": [
377
- { "parent": "Service", "entities": ["render", "reset"] },
378
- "normalize"
379
- ],
380
- "show": true,
381
- "save": "service-focus"
382
- },
383
- {
384
- "op": "usages",
385
- "target": "src/service.ts",
386
- "entity": "normalize",
387
- "scope": "src",
388
- "detail": "locations"
389
- },
390
- {
391
- "op": "duplicates",
392
- "scope": "src/scripts",
393
- "detail": "summary",
394
- "limit": 20
395
- }
396
- ]
397
- }
305
+ Prefer one batch DSL request for related questions.
306
+
307
+ Batch example:
308
+
309
+ Run:
310
+ aib inspect --stdin
398
311
 
399
- Inspect controls:
400
-
401
- file default file for requests
402
- target file, dir, or symbol area to analyze
403
- scope where to search; JSON scope:string|string[]
404
- entity one symbol
405
- entities several target symbols; JSON entities:[...]
406
- parent class/interface parent for methods/properties
407
- ranges include line/range metadata; JSON ranges:boolean; CLI --ranges
408
- localOnly show local declarations and reexports without resolving facade API; JSON localOnly:boolean; CLI --local-only
409
- resolveStar resolve export * through re-exported modules; JSON resolveStar:boolean; CLI --resolve-star
410
- limit max items in one page; JSON limit:N; CLI --limit N
411
- offset page offset; JSON offset:N; CLI --offset N
412
- all return all items; JSON all:boolean; CLI --all
413
- detail output level; JSON detail:summary|locations|code; CLI --detail summary|locations|code
414
- show include code output; JSON show:boolean; CLI --show
415
- save save reusable output; JSON save:"name"; CLI --save name
416
- exclude skip names/selectors; JSON exclude:[...]
417
- kinds restrict selector kinds; JSON kinds:["f","t"]
312
+ Input:
313
+ @file @svc/service.ts
314
+ file
315
+ file @svc/serviceB.ts
316
+ members Service
317
+ code entities=[Service.{render,reset},normalize,default,IIFE#1]
318
+ code @svc/serviceC.ts ServiceC -ranges
319
+ usages target=@svc/service.ts normalize scope=src detail=loc
320
+ duplicates scope=src/scripts detail=sum limit=20
321
+
322
+ How inheritance works above:
323
+ @file sets the default file for following file-like inspect requests.
324
+ file uses @svc/service.ts.
325
+ file @svc/serviceB.ts overrides the default for that one request.
326
+ members Service uses @svc/service.ts because it has no file override.
327
+ code entities=[...] also uses @svc/service.ts.
328
+ code @svc/serviceC.ts ServiceC overrides the file and disables ranges for that request.
329
+ usages sets its own target/scope/detail because it searches references instead of reading the default file.
330
+ duplicates sets its own scope because it scans a directory.
331
+
332
+ Inspect request fields:
333
+
334
+ file source file; first positional path, @file path, or file=path
335
+ target file or directory to analyze; target=path
336
+ scope where to search; scope=path or scope=[a,b]
337
+ entity one symbol selector; entity=name or positional selector
338
+ entities several symbol selectors; entities=[...] or positional selectors
339
+ parent parent class/interface for methods/properties; Parent.member or parent=Name
340
+ ranges include line/range metadata
341
+ exclude skip paths or names depending on operation; exclude=[...]
342
+ detail output level; detail=sum|loc|code
343
+ all return all items; +all
344
+ limit max items in one page; limit=N
345
+ offset page offset; offset=N
346
+ save save reusable artifact where supported; >name
347
+
348
+ Operation sections list their supported controls.
349
+ Specific explains controls whose meaning is local to that operation.
418
350
 
419
351
  Inspect File
420
352
 
@@ -423,8 +355,9 @@ Exported declarations are marked in the output.
423
355
  It shows what lives in the file before you decide whether to read code.
424
356
 
425
357
  Good for:
426
- - mapping an unfamiliar file
358
+ - mapping a file
427
359
  - listing top-level declarations
360
+ - seeing default exports, decorators, IIFEs, and runtime calls
428
361
  - checking whether a file contains real declarations or mostly re-exports
429
362
 
430
363
  Do not add limit just in case.
@@ -443,15 +376,9 @@ Use -ranges to show names without ranges.
443
376
  Run:
444
377
  aib inspect --stdin
445
378
 
446
- Input:
447
- {
448
- "op": "file",
449
- "file": "src/service.ts",
450
- "requests": [
451
- { "ranges": true },
452
- { "file": "src/index.ts", "localOnly": true }
453
- ]
454
- }
379
+ Input:
380
+ file @svc/service.ts +localOnly
381
+ file src/index.ts
455
382
 
456
383
  inspect file src/service.ts [--ranges] [--local-only]
457
384
 
@@ -501,14 +428,8 @@ Run:
501
428
  aib inspect --stdin
502
429
 
503
430
  Input:
504
- {
505
- "op": "exports",
506
- "file": "src/service.ts",
507
- "requests": [
508
- { "ranges": true },
509
- { "file": "src/index.ts", "resolveStar": true }
510
- ]
511
- }
431
+ exports src/service.ts +ranges
432
+ exports src/index.ts +resolveStar
512
433
 
513
434
  inspect exports src/service.ts [--ranges] [--resolve-star]
514
435
 
@@ -528,16 +449,8 @@ file, entity, entities, ranges, limit, offset, all
528
449
  Run:
529
450
  aib inspect --stdin
530
451
 
531
- Input:
532
- {
533
- "file": "src/service.ts",
534
- "op": "members",
535
- "limit": 12,
536
- "requests": [
537
- { "entity": "Service" },
538
- { "entities": ["ServiceOptions", "WsOptions"], "all": true }
539
- ]
540
- }
452
+ Input:
453
+ members @svc/service.ts entities=[Service,ServiceOptions] +all +ranges
541
454
 
542
455
  inspect members src/service.ts Service [--limit N] [--offset N] [--all] [--ranges]
543
456
 
@@ -547,7 +460,7 @@ Use code to fetch exact declarations or members.
547
460
  It returns focused code without reading the whole file.
548
461
 
549
462
  Good for:
550
- - reading a known function, class, method, or declaration
463
+ - reading a known function, class, method, declaration, `default`, or `IIFE#N`
551
464
  - fetching several related code blocks in one request
552
465
  - keeping context focused on code needed for the current task
553
466
 
@@ -561,55 +474,33 @@ Defaults: +show +ranges
561
474
  Use -show for names/ranges only.
562
475
  Use -ranges for source without ranges.
563
476
 
564
- Run:
565
- aib inspect --stdin
566
-
567
- Input:
568
- {
569
- "file": "src/service.ts",
570
- "op": "code",
571
- "requests": [
572
- {
573
- "entities": [
574
- { "parent": "Service", "entities": ["render", "reset"] },
575
- "normalize"
576
- ],
577
- "show": true,
578
- "save": "service-focus"
579
- }
580
- ]
581
- }
477
+ Run:
478
+ aib inspect --stdin
479
+
480
+ Input:
481
+ code @svc/service.ts Service.{render,reset} normalize
482
+ code @svc/serviceB.ts ServiceB.{constructor} default IIFE#1
582
483
 
583
484
  Inspect Deps
584
485
 
585
486
  Use deps to see what one entity depends on inside its file.
586
487
  It separates type-only dependencies from runtime value dependencies.
587
488
 
588
- Good for:
589
- - checking what a symbol may need when moved or extracted
590
- - spotting nearby types, constants, or helpers tied to one entity
591
- - deciding whether one symbol is standalone or tied to nearby declarations
489
+ Good for:
490
+ - checking what a symbol may need when moved or extracted
491
+ - spotting nearby types, constants, or helpers tied to one entity
492
+ - deciding whether one symbol is standalone or tied to nearby declarations
592
493
  - debugging mutation failures caused by local dependency shape
593
494
 
594
495
  Controls:
595
496
  file, entity, entities, parent
596
497
 
597
- Run:
598
- aib inspect --stdin
599
-
600
- Input:
601
- {
602
- "file": "src/service.ts",
603
- "op": "deps",
604
- "requests": [
605
- { "entity": "createService" },
606
- {
607
- "entities": [
608
- { "parent": "Service", "entities": ["render", "reset"] }
609
- ]
610
- }
611
- ]
612
- }
498
+ Run:
499
+ aib inspect --stdin
500
+
501
+ Input:
502
+ deps @svc/service.ts entities=[createService,normalize,Service.{render,reset}]
503
+ deps @svc/serviceB.ts ServiceB.{constructor} getConfig
613
504
 
614
505
  Inspect Usages
615
506
 
@@ -624,8 +515,8 @@ Good for:
624
515
  - confirming whether extracted or renamed code still has callers
625
516
  - getting caller locations or caller code without broad file scans
626
517
 
627
- Use locations for broad impact checks.
628
- Use code when usage count is small or caller context matters now.
518
+ Use detail=code directly when you already need caller code.
519
+ Use detail=loc + save when the first question is impact shape and you may expand only part of it later.
629
520
 
630
521
  Controls:
631
522
  target, scope, entity, entities, parent, detail, limit, all, save, includeTarget
@@ -637,17 +528,10 @@ Run:
637
528
  aib inspect --stdin
638
529
 
639
530
  Input:
640
- {
641
- "op": "usages",
642
- "target": "src/service.ts",
643
- "entities": [
644
- "createService",
645
- { "parent": "Service", "entities": ["render", "reset"] }
646
- ],
647
- "scope": ["src/app", "src/tests"],
648
- "detail": "locations",
649
- "save": "service-usages"
650
- }
531
+ usages target=@svc/service.ts entities=[createService,normalize,Service.{render,reset}] scope=[src/app,src/tests] detail=loc >service-usages
532
+
533
+ Expand saved usages when needed:
534
+ inspect usages --from-file aib:usages:service-usages --focus createService --detail code --limit 20
651
535
 
652
536
  Inspect Graph
653
537
 
@@ -667,7 +551,7 @@ Use graph for file-level connectivity.
667
551
 
668
552
  Model:
669
553
  build graph: scope + view + save
670
- query graph: fromFile + focus + output toggles
554
+ query graph: from + focus + output toggles
671
555
 
672
556
  view controls what enters the saved graph.
673
557
  focus only expands details for files already inside it.
@@ -676,7 +560,7 @@ If focus misses a file, rebuild with wider scope or view.
676
560
  Default view:
677
561
  directory scope -> local
678
562
  file or multiple scopes -> neighbors
679
- fromFile -> uses the saved graph
563
+ from -> uses the saved graph
680
564
 
681
565
  Views:
682
566
  local only files inside scope; best directory map
@@ -684,11 +568,11 @@ neighbors direct import neighborhood; best file-centered map
684
568
  expanded wider neighborhood; more output
685
569
 
686
570
  Scope choice:
687
- scope: "src" creates a broad reusable map for src.
688
- scope: "src/services" is cheaper for local work.
689
- scope: [...] compares known areas without mapping all src.
571
+ scope=src creates a broad reusable map for src.
572
+ scope=src/services is cheaper for local work.
573
+ scope=[src/services,src/components] compares known areas without mapping all src.
690
574
 
691
- After you understand which graph sections matter, hide the rest with JSON fields or prefs.
575
+ After you understand which graph sections matter, hide the rest with flags.
692
576
  Graph can be noisy; shape it for the current task.
693
577
 
694
578
  Controls:
@@ -706,29 +590,14 @@ Run:
706
590
  aib inspect --stdin
707
591
 
708
592
  Input:
709
- {
710
- "op": "graph",
711
- "requests": [
712
- {
713
- "scope": "src/services",
714
- "view": "local",
715
- "save": "services-graph"
716
- },
717
- {
718
- "fromFile": "aib:graph:services-graph",
719
- "focus": ["src/services/users.ts", "src/services/admins.ts"],
720
- "symbolUsage": true,
721
- "edges": false
722
- }
723
- ]
724
- }
593
+ graph scope=@svc view=local >services-graph
594
+ graph from=aib:graph:services-graph focus=[@svc/users.ts,@svc/admins.ts] +symbolUsage -edges
725
595
 
726
596
  Focus saved graph later:
727
- inspect graph --from-file aib:graph:services-graph --focus src/services/messages.ts --focus src/services/posts.ts --symbol-usage
597
+ inspect graph --from-file aib:graph:services-graph --focus @svc/messages.ts --focus @svc/posts.ts --symbol-usage
728
598
 
729
- Inline graph focus can add focus and symbolUsage.
730
- Inline cannot hide graph sections such as edges/hubs/entrypoints/leaves.
731
- Use JSON request fields or prefs for section control.
599
+ Inline graph focus can add focus and symbolUsage.
600
+ Use DSL or request flags to hide sections such as edges/hubs/entrypoints/leaves.
732
601
 
733
602
  Inspect Tree
734
603
 
@@ -777,30 +646,37 @@ Run:
777
646
  aib inspect --stdin
778
647
 
779
648
  Input:
780
- {
781
- "scope": "src",
782
- "detail": "summary",
783
- "limit": 20
784
- }
649
+ duplicates scope=src detail=sum exclude=[config,baseUrl] kinds=[t,i] limit=20
650
+ duplicates scope=@svc detail=loc pathExclude=[src/generated,"**/* copy.ts"] limit=20
785
651
 
786
652
  Mutation
787
653
 
788
- Mutation commands change code through TS/IDE refactors.
789
- Successful mutations update affected references and imports.
790
-
654
+ Mutation commands change code and files through TS/IDE-backed operations.
655
+ Successful mutations update affected references and imports.
656
+
657
+ Semantic mutations change TypeScript symbols/declarations.
658
+ File mutations change file layout.
659
+
791
660
  After a successful mutation, do not manually patch the same imports unless aib reports a follow-up or checks show a real issue.
792
661
 
793
- If move/modulePlan imports do not match the repo style, run:
662
+ If mutation imports do not match the repo style, run:
794
663
  aib help config-setup.import-rules
795
664
 
796
- AIB mutations are designed to reduce manual checking.
797
- Your job is to express the intent in DSL.
798
- AIB's job is to convert that intent into code changes.
799
-
800
- Do not read all changed files just because a mutation touched them.
801
- That defeats the purpose of using AIB for mechanical refactors.
802
-
803
- If the command succeeds, the requested mechanical change was applied.
665
+ AIB mutations are designed to reduce manual checking.
666
+ Your job is to express the intent in DSL.
667
+ AIB's job is to convert that intent into code changes.
668
+
669
+ Choose the mutation by intent:
670
+ rename - rename TypeScript symbols
671
+ move toFile - move TypeScript declarations into one file
672
+ modulePlan - split one source file into several modules
673
+ file move toDir - move whole files into directories
674
+ file rename - rename whole files.
675
+
676
+ Do not read all changed files just because a mutation touched them.
677
+ That defeats the purpose of using AIB for mechanical refactors.
678
+
679
+ If the command succeeds, the requested mechanical change was applied.
804
680
  After failure or partial success, use the output to decide the next request.
805
681
 
806
682
  When running mutation commands, set the harness timeout to 3 minutes.
@@ -813,7 +689,7 @@ preview inspect planned edits, then apply by id
813
689
  apply write a previewed change
814
690
  execute write immediately
815
691
 
816
- Use execute for routine rename/move/modulePlan requests.
692
+ Use execute for routine requests.
817
693
 
818
694
  Use preview/apply when you are learning a mutation command, or when one request contains a large multi-step change that you want to inspect before writing files.
819
695
  Typical examples: a huge modulePlan or refactor batch.
@@ -822,13 +698,10 @@ preview/apply uses more tool calls and more output tokens.
822
698
  preview validates input and planned edits, but writing files can still hit a TS/IDE refactor error.
823
699
  execute writes immediately and reports what changed.
824
700
 
825
- If a mutation cannot be completed, aib reports the failed part and the captured input.
826
- For large or partial requests, edit the captured input and rerun the remaining or changed intent.
827
- For small requests, write a corrected request instead.
701
+ If a mutation cannot be completed, aib reports the failed part.
828
702
 
829
- Prefer batch JSON for related mutations.
830
- One request can describe several related changes.
831
- aib captures JSON input automatically so large failed or partial requests can be edited and rerun.
703
+ Prefer batch DSL for related mutations.
704
+ One request can describe several related changes.
832
705
 
833
706
  When a batch mutation partly fails, split the next request by failure type.
834
707
 
@@ -847,13 +720,8 @@ Run:
847
720
  aib rename execute --stdin
848
721
 
849
722
  Input:
850
- {
851
- "file": "src/service.ts",
852
- "renames": {
853
- "oldName": "newName",
854
- "OldService": "NewService"
855
- }
856
- }
723
+ @file src/service.ts
724
+ rename oldName->newName OldService->NewService
857
725
 
858
726
  Move
859
727
 
@@ -869,12 +737,9 @@ Move several entities into one target:
869
737
  Run:
870
738
  aib move toFile execute --stdin
871
739
 
872
- Input:
873
- {
874
- "sourceFile": "src/service.ts",
875
- "targetFile": "src/service.helpers.ts",
876
- "entities": ["oldHelper", "OtherHelper"]
877
- }
740
+ Input:
741
+ @source src/service.ts
742
+ move src/service.helpers.ts: oldHelper OtherHelper
878
743
 
879
744
  Module Plan
880
745
 
@@ -886,7 +751,7 @@ modulePlan orchestrates semantic moves and updates affected references/imports.
886
751
  If imports created by modulePlan do not match the repo style, run:
887
752
  aib help config-setup.import-rules
888
753
 
889
- Use expectEmpty when your modulePlan intent is to move all declarations out of the source file.
754
+ Use +expectEmpty when your modulePlan intent is to move all declarations out of the source file.
890
755
  It does not change the move behavior; it only asks output to report remaining source declarations if any remain.
891
756
  Use it only when remaining declarations would mean the split did not match your intent.
892
757
  Do not use it for partial extractions.
@@ -895,21 +760,15 @@ Split one large source file into several targets:
895
760
  Run:
896
761
  aib modulePlan execute --stdin
897
762
 
898
- Input:
899
- {
900
- "sourceFile": "src/large-service.ts",
901
- "expectEmpty": true,
902
- "modules": [
903
- {
904
- "target": "src/large-service.types.ts",
905
- "entities": ["ServiceOptions", "ServiceMode"]
906
- },
907
- {
908
- "target": "src/large-service.core.ts",
909
- "entities": ["LargeService", "createLargeService"]
910
- }
911
- ]
912
- }
763
+ Input:
764
+ @source src/large-service.ts +expectEmpty
765
+ module src/large-service.types.ts: ServiceOptions ServiceMode
766
+ module src/large-service.core.ts: LargeService createLargeService
767
+
768
+ How inheritance works above:
769
+ @source sets the source file once.
770
+ +expectEmpty says no declarations should remain in the source after the plan.
771
+ Each module line declares one target and the entities that should move there.
913
772
 
914
773
  Refactor Batch
915
774
 
@@ -924,77 +783,33 @@ Example: rename and move in one request
924
783
  Run:
925
784
  aib refactor batch execute --stdin
926
785
 
927
- Input:
928
- {
929
- "sourceFile": "src/service.ts",
930
- "requests": [
931
- {
932
- "op": "rename",
933
- "renames": {
934
- "oldHelper": "newHelper",
935
- "oldType": "newType"
936
- }
937
- },
938
- {
939
- "op": "move",
940
- "targetFile": "src/service.helpers.ts",
941
- "entities": ["newHelper"]
942
- },
943
- {
944
- "op": "move",
945
- "targetFile": "src/service.types.ts",
946
- "entities": ["newType"]
947
- }
948
- ]
949
- }
786
+ Input:
787
+ @source src/service.ts
788
+ rename oldHelper->newHelper oldType->newType
789
+ move src/service.helpers.ts: newHelper
790
+ move src/service.types.ts: newType
950
791
 
951
- Imports Normalize
792
+ This keeps related mutation intent together:
793
+ rename first, then move the renamed symbols.
952
794
 
953
- Use imports normalize for explicit import-style cleanup.
954
- It rewrites resolved local import/export specifiers inside a chosen file or directory.
955
-
956
- Use importNormalize in aib.json for repeated defaults.
795
+ File Move and File Rename
957
796
 
958
- Good for:
959
- - converting one area to aliases or relative imports
960
- - cleaning import style after manual edits or broad refactors
961
- - applying the same import style to a directory without hand-editing files
962
- - applying new tsconfig aliases after they are added
963
-
964
- Controls:
965
- scope file/dir scope to normalize
966
- to relative|alias|shortestAlias
967
- preferAlias select one tsconfig paths pattern when several aliases can resolve the same file
968
- exclude files, directories, or glob-like patterns to skip
969
- all show all planned edits; avoid on broad directory scopes
797
+ Use file move/rename when the filesystem layout is the intent.
798
+ Do not change filesystem layout manually.
970
799
 
971
- Run:
972
- aib imports normalize preview --stdin
973
-
974
- Input:
975
- {
976
- "scope": "src/services",
977
- "to": "shortestAlias",
978
- "exclude": ["src/services/generated", "**/* copy.ts"]
979
- }
980
-
981
- Rewrite imports found inside src/core.
982
- When an imported file can be expressed through @features/*, prefer that alias.
983
-
984
- Run:
985
- aib imports normalize preview --stdin
986
-
987
- Input:
988
- {
989
- "scope": "src/core",
990
- "to": "alias",
991
- "preferAlias": "@features/*"
992
- }
993
-
994
- With matching importNormalize config for this scope or a parent scope, use inline CLI commands:
995
-
996
- imports normalize preview @svc
997
- imports normalize execute @svc
800
+ Focused topics:
801
+ aib help file.move file.rename
802
+
803
+ Layout smell trigger:
804
+ If a directory has many related files sharing a prefix, mixed responsibilities, or files that should be grouped by feature, read:
805
+ aib help recipe.file-layout
806
+
807
+ Imports Normalize
808
+
809
+ Use imports normalize for explicit import-style cleanup.
810
+
811
+ Focused topic:
812
+ aib help imports.normalize
998
813
 
999
814
  JS/TS compatibility
1000
815
 
@@ -1053,30 +868,37 @@ For focused text reads, prefer qr over cat/Get-Content/type, especially when ali
1053
868
  Use shell reads only when piping into shell tooling or qr is unavailable.
1054
869
 
1055
870
  Controls:
1056
- -h N head; first N lines
1057
- -t N tail; last N lines
1058
- -o N offset; starting line, 1-based
1059
- -l N limit; line count for offset reads
1060
- -a all; whole file
871
+ h=N head; first N lines
872
+ t=N tail; last N lines
873
+ o=N l=N range; starting line and line count
874
+ all whole file
1061
875
 
1062
- If no window is provided, qr uses -h 80.
1063
- If -a is present, it wins over other window flags.
876
+ If no window is provided, qr uses h=80.
877
+ If all is present, it wins over other window flags.
1064
878
 
1065
- Run:
1066
- aib qr --stdin
879
+ Inline:
880
+ aib qr @scripts/a.txt h=80 @scripts/b.py o=300 l=50 @logs/app.log all
1067
881
 
1068
- Input:
1069
- qr @scripts/a.txt h=80
1070
- qr @scripts/b.py o=300 l=50
1071
- qr @scripts/c.md t=120
1072
- qr @logs/app.log all
882
+ aib rg
1073
883
 
1074
- Inline:
1075
- aib qr @scripts/a.txt -h 80
1076
- aib qr @scripts/b.py -o 300 -l 50
1077
- aib qr @logs/app.log -a
884
+ Run ripgrep through AIB.
885
+
886
+ Regular rg:
887
+ rg <args>
888
+
889
+ AIB rg:
890
+ aib rg -- <args>
891
+
892
+ Everything after `--` is passed as normal ripgrep arguments.
893
+ Use the same args you would pass to `rg`.
894
+ Use normal paths in input. Do not use AIB path aliases here.
895
+
896
+ Examples:
897
+ rg -n "TODO" src/core
898
+ aib rg -- -n "TODO" src/core
1078
899
 
1079
- Use stdin for several reads.
900
+ rg -n --column "SomeValue" ws/commands ws/config
901
+ aib rg -- -n --column "SomeValue" ws/commands ws/config
1080
902
 
1081
903
  Need to see TypeScript configs in the repo:
1082
904
  aib reveal tsconfigs