@automaton-labs/aib 0.0.5 → 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 (258) 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 -1
  6. package/dist/commands/config-output.js +10 -8
  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 -1
  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 +8 -8
  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/session-workspace.js +7 -7
  38. package/dist/commands/worker-command.js +1 -0
  39. package/dist/config/defaults.js +1 -1
  40. package/dist/config/env-vars.js +1 -1
  41. package/dist/config/path-aliases.js +1 -1
  42. package/dist/config/resolve-command-alias.js +1 -1
  43. package/dist/config/workspace-root.js +3 -3
  44. package/dist/content/content-bundle.js +1 -1
  45. package/dist/dsl/aib-dsl.js +1 -1
  46. package/dist/dsl/declaration-dsl.js +1 -0
  47. package/dist/dsl/file-move-to-dir-dsl.js +1 -0
  48. package/dist/dsl/file-refactor-batch-dsl.js +1 -0
  49. package/dist/dsl/file-rename-dsl.js +1 -0
  50. package/dist/help/bootstrap.bash.md +907 -0
  51. package/dist/help/bootstrap.md +105 -144
  52. package/dist/help/{json/bootstrap.md → bootstrap.pwsh.md} +216 -397
  53. package/dist/help/docs/dsl.md +4 -3
  54. package/dist/help/docs/file.move.md +46 -0
  55. package/dist/help/docs/file.rename.md +35 -0
  56. package/dist/help/docs/help-format.md +4 -7
  57. package/dist/help/docs/inspect.code.md +5 -5
  58. package/dist/help/docs/inspect.deps.md +7 -7
  59. package/dist/help/docs/inspect.file.md +2 -1
  60. package/dist/help/docs/inspect.graph.md +3 -3
  61. package/dist/help/docs/inspect.md +5 -5
  62. package/dist/help/docs/mutation.md +23 -13
  63. package/dist/help/docs/patterns.md +1 -5
  64. package/dist/help/docs/qr.md +7 -22
  65. package/dist/help/docs/quick-map.md +1 -0
  66. package/dist/help/docs/recipe.file-layout.md +15 -0
  67. package/dist/help/docs/rg.md +22 -0
  68. package/dist/help/docs/selectors.md +3 -2
  69. package/dist/help/docs/session.md +1 -1
  70. package/dist/help/dsl/bootstrap.bash.md +907 -0
  71. package/dist/help/dsl/bootstrap.md +105 -144
  72. package/dist/help/{json/full.md → dsl/bootstrap.pwsh.md} +216 -397
  73. package/dist/help/dsl/docs/dsl.md +4 -3
  74. package/dist/help/dsl/docs/file.move.md +46 -0
  75. package/dist/help/dsl/docs/file.rename.md +35 -0
  76. package/dist/help/dsl/docs/help-format.md +4 -7
  77. package/dist/help/dsl/docs/inspect.code.md +5 -5
  78. package/dist/help/dsl/docs/inspect.deps.md +7 -7
  79. package/dist/help/dsl/docs/inspect.file.md +2 -1
  80. package/dist/help/dsl/docs/inspect.graph.md +3 -3
  81. package/dist/help/dsl/docs/inspect.md +5 -5
  82. package/dist/help/dsl/docs/mutation.md +23 -13
  83. package/dist/help/dsl/docs/patterns.md +1 -5
  84. package/dist/help/dsl/docs/qr.md +7 -22
  85. package/dist/help/dsl/docs/quick-map.md +1 -0
  86. package/dist/help/dsl/docs/recipe.file-layout.md +15 -0
  87. package/dist/help/dsl/docs/rg.md +22 -0
  88. package/dist/help/dsl/docs/selectors.md +3 -2
  89. package/dist/help/dsl/docs/session.md +1 -1
  90. package/dist/help/dsl/full.md +105 -144
  91. package/dist/help/dsl/help-index.md +44 -0
  92. package/dist/help/dsl/tokens/qr.inline.examples.md +2 -0
  93. package/dist/help/dsl/tokens/stdin.examples.bash.md +8 -0
  94. package/dist/help/dsl/tokens/stdin.examples.pwsh.md +8 -0
  95. package/dist/help/dsl/tokens/stdin.examples.with-qr.bash.md +12 -0
  96. package/dist/help/dsl/tokens/stdin.examples.with-qr.pwsh.md +12 -0
  97. package/dist/help/dsl/topics/dsl.md +4 -3
  98. package/dist/help/dsl/topics/file.move.md +44 -0
  99. package/dist/help/dsl/topics/file.rename.md +33 -0
  100. package/dist/help/dsl/topics/help-format.md +4 -7
  101. package/dist/help/dsl/topics/inspect.code.md +5 -5
  102. package/dist/help/dsl/topics/inspect.deps.md +7 -7
  103. package/dist/help/dsl/topics/inspect.file.md +2 -1
  104. package/dist/help/dsl/topics/inspect.graph.md +3 -3
  105. package/dist/help/dsl/topics/inspect.md +5 -5
  106. package/dist/help/dsl/topics/mutation.md +23 -13
  107. package/dist/help/dsl/topics/patterns.md +1 -5
  108. package/dist/help/dsl/topics/qr.md +7 -22
  109. package/dist/help/dsl/topics/quick-map.md +1 -0
  110. package/dist/help/dsl/topics/recipe.file-layout.md +13 -0
  111. package/dist/help/dsl/topics/rg.md +20 -0
  112. package/dist/help/dsl/topics/selectors.md +3 -2
  113. package/dist/help/dsl/topics/session.md +1 -1
  114. package/dist/help/full.md +105 -144
  115. package/dist/help/help-index.md +44 -0
  116. package/dist/help/help-meta.json +45 -29
  117. package/dist/help/index.md +32 -75
  118. package/dist/help/tokens/qr.inline.examples.md +2 -0
  119. package/dist/help/tokens/stdin.examples.bash.md +8 -0
  120. package/dist/help/tokens/stdin.examples.pwsh.md +8 -0
  121. package/dist/help/tokens/stdin.examples.with-qr.bash.md +12 -0
  122. package/dist/help/tokens/stdin.examples.with-qr.pwsh.md +12 -0
  123. package/dist/help/topics/dsl.md +4 -3
  124. package/dist/help/topics/file.move.md +44 -0
  125. package/dist/help/topics/file.rename.md +33 -0
  126. package/dist/help/topics/help-format.md +4 -7
  127. package/dist/help/topics/inspect.code.md +5 -5
  128. package/dist/help/topics/inspect.deps.md +7 -7
  129. package/dist/help/topics/inspect.file.md +2 -1
  130. package/dist/help/topics/inspect.graph.md +3 -3
  131. package/dist/help/topics/inspect.md +5 -5
  132. package/dist/help/topics/mutation.md +23 -13
  133. package/dist/help/topics/patterns.md +1 -5
  134. package/dist/help/topics/qr.md +7 -22
  135. package/dist/help/topics/quick-map.md +1 -0
  136. package/dist/help/topics/recipe.file-layout.md +13 -0
  137. package/dist/help/topics/rg.md +20 -0
  138. package/dist/help/topics/selectors.md +3 -2
  139. package/dist/help/topics/session.md +1 -1
  140. package/dist/host/capabilities.js +1 -0
  141. package/dist/ide-launch/common.cjs +162 -162
  142. package/dist/managed-host/extension-vsix-resolver.js +1 -1
  143. package/dist/managed-host/manage-serve-web-host.cjs +141 -141
  144. package/dist/managed-host/serve-web-autostart.js +1 -1
  145. package/dist/managed-host/serve-web-host.cjs +1985 -1660
  146. package/dist/observability/config.js +1 -1
  147. package/dist/payloads/read-stdin-json.js +1 -1
  148. package/dist/rg-wrapper/core.js +6 -0
  149. package/dist/rg-wrapper/options.js +1 -0
  150. package/dist/rtk-wrapper/core.js +2 -0
  151. package/dist/runtime/input-source.js +1 -1
  152. package/dist/runtime/managed-runtime-provisioning.js +1 -1
  153. package/dist/runtime/run-command.js +1 -1
  154. package/dist/selectors/parse-entities.js +1 -1
  155. package/dist/session/daemon-state.js +2 -0
  156. package/dist/session/server.js +7 -6
  157. package/dist/shared/errors.js +14 -13
  158. package/dist/shared/operations.js +1 -1
  159. package/dist/shared/protocol.js +1 -1
  160. package/dist/shared/routes.js +1 -1
  161. package/dist/shared/stdin-examples.js +1 -0
  162. package/dist/shared/types.js +1 -1
  163. package/dist/tool-runtime/runtime-tools.js +1 -0
  164. package/dist/tracing/trace.js +5 -3
  165. package/dist/workers/control-plane/aib-control-plane-worker.cjs +80 -0
  166. package/dist/workers/control-plane/client-config.default.json +3 -0
  167. package/dist/workers/product-storage.js +1 -0
  168. package/dist/workers/registry.js +1 -0
  169. package/extension/vscode-refactor-bridge-extension.vsix +0 -0
  170. package/package.json +6 -4
  171. package/runtimes/launcher/linux-x64/aib +0 -0
  172. package/runtimes/launcher/win-x64/aib.exe +0 -0
  173. package/runtimes/tools/rg/darwin-arm64/rg +0 -0
  174. package/runtimes/tools/rg/darwin-x64/rg +0 -0
  175. package/runtimes/tools/rg/linux-arm64/rg +0 -0
  176. package/runtimes/tools/rg/linux-x64/rg +0 -0
  177. package/runtimes/tools/rg/manifest.json +36 -0
  178. package/runtimes/tools/rg/win32-x64/rg.exe +0 -0
  179. package/runtimes/tools/rtk/darwin-arm64/rtk +0 -0
  180. package/runtimes/tools/rtk/darwin-x64/rtk +0 -0
  181. package/runtimes/tools/rtk/linux-arm64/rtk +0 -0
  182. package/runtimes/tools/rtk/linux-x64/rtk +0 -0
  183. package/runtimes/tools/rtk/manifest.json +36 -0
  184. package/runtimes/tools/rtk/win32-x64/rtk.exe +0 -0
  185. package/scripts/provision-runtime.cjs +25 -1
  186. package/dist/help/json/docs/basics.md +0 -15
  187. package/dist/help/json/docs/config-setup.aliases.md +0 -56
  188. package/dist/help/json/docs/config-setup.excludes.md +0 -45
  189. package/dist/help/json/docs/config-setup.import-normalize.md +0 -86
  190. package/dist/help/json/docs/config-setup.import-rules.md +0 -96
  191. package/dist/help/json/docs/config-setup.tsconfigs.md +0 -33
  192. package/dist/help/json/docs/dsl.md +0 -25
  193. package/dist/help/json/docs/first-setup.md +0 -292
  194. package/dist/help/json/docs/help-format.md +0 -12
  195. package/dist/help/json/docs/help-protocol.md +0 -26
  196. package/dist/help/json/docs/imports.normalize.md +0 -47
  197. package/dist/help/json/docs/inspect.code.md +0 -41
  198. package/dist/help/json/docs/inspect.cycles.md +0 -38
  199. package/dist/help/json/docs/inspect.deps.md +0 -46
  200. package/dist/help/json/docs/inspect.duplicates.md +0 -65
  201. package/dist/help/json/docs/inspect.exports.md +0 -40
  202. package/dist/help/json/docs/inspect.file.md +0 -38
  203. package/dist/help/json/docs/inspect.graph.md +0 -139
  204. package/dist/help/json/docs/inspect.imports.md +0 -15
  205. package/dist/help/json/docs/inspect.md +0 -88
  206. package/dist/help/json/docs/inspect.members.md +0 -32
  207. package/dist/help/json/docs/inspect.tree.md +0 -32
  208. package/dist/help/json/docs/inspect.usages.md +0 -61
  209. package/dist/help/json/docs/modulePlan.md +0 -73
  210. package/dist/help/json/docs/move.md +0 -56
  211. package/dist/help/json/docs/mutation.md +0 -65
  212. package/dist/help/json/docs/patterns.md +0 -76
  213. package/dist/help/json/docs/prefs.md +0 -40
  214. package/dist/help/json/docs/qr.md +0 -37
  215. package/dist/help/json/docs/quick-map.md +0 -30
  216. package/dist/help/json/docs/refactor.batch.md +0 -72
  217. package/dist/help/json/docs/rename.md +0 -47
  218. package/dist/help/json/docs/reveal.md +0 -30
  219. package/dist/help/json/docs/selectors.md +0 -23
  220. package/dist/help/json/docs/session.md +0 -77
  221. package/dist/help/json/docs/view.md +0 -30
  222. package/dist/help/json/snippets/agents.md +0 -14
  223. package/dist/help/json/topics/basics.md +0 -13
  224. package/dist/help/json/topics/config-setup.aliases.md +0 -54
  225. package/dist/help/json/topics/config-setup.excludes.md +0 -43
  226. package/dist/help/json/topics/config-setup.import-normalize.md +0 -84
  227. package/dist/help/json/topics/config-setup.import-rules.md +0 -94
  228. package/dist/help/json/topics/config-setup.tsconfigs.md +0 -31
  229. package/dist/help/json/topics/dsl.md +0 -23
  230. package/dist/help/json/topics/first-setup.md +0 -290
  231. package/dist/help/json/topics/help-format.md +0 -10
  232. package/dist/help/json/topics/help-protocol.md +0 -24
  233. package/dist/help/json/topics/imports.normalize.md +0 -45
  234. package/dist/help/json/topics/inspect.code.md +0 -39
  235. package/dist/help/json/topics/inspect.cycles.md +0 -36
  236. package/dist/help/json/topics/inspect.deps.md +0 -44
  237. package/dist/help/json/topics/inspect.duplicates.md +0 -37
  238. package/dist/help/json/topics/inspect.exports.md +0 -38
  239. package/dist/help/json/topics/inspect.file.md +0 -36
  240. package/dist/help/json/topics/inspect.graph.md +0 -137
  241. package/dist/help/json/topics/inspect.imports.md +0 -13
  242. package/dist/help/json/topics/inspect.md +0 -86
  243. package/dist/help/json/topics/inspect.members.md +0 -30
  244. package/dist/help/json/topics/inspect.tree.md +0 -22
  245. package/dist/help/json/topics/inspect.usages.md +0 -59
  246. package/dist/help/json/topics/modulePlan.md +0 -60
  247. package/dist/help/json/topics/move.md +0 -46
  248. package/dist/help/json/topics/mutation.md +0 -63
  249. package/dist/help/json/topics/patterns.md +0 -74
  250. package/dist/help/json/topics/prefs.md +0 -38
  251. package/dist/help/json/topics/qr.md +0 -35
  252. package/dist/help/json/topics/quick-map.md +0 -28
  253. package/dist/help/json/topics/refactor.batch.md +0 -61
  254. package/dist/help/json/topics/rename.md +0 -42
  255. package/dist/help/json/topics/reveal.md +0 -28
  256. package/dist/help/json/topics/selectors.md +0 -21
  257. package/dist/help/json/topics/session.md +0 -59
  258. package/dist/help/json/topics/view.md +0 -28
@@ -6,20 +6,17 @@ It can inspect symbols, usages, dependencies, duplicates, focused code, and run
6
6
  aib is designed for agent workflows:
7
7
  batch requests, compact text output, session handles, and reusable artifacts.
8
8
 
9
- Inline commands omit the aib prefix.
10
- When you see:
11
- session prefs get
12
-
13
- Run:
14
- aib session prefs get
15
-
16
- Stdin examples show command and input separately to avoid shell-specific syntax.
17
- Stdin Run lines include the aib prefix to avoid confusion.
9
+ Inline commands omit the aib prefix.
10
+ When you see:
11
+ session clear
12
+
13
+ Run:
14
+ aib session clear
18
15
 
19
- PowerShell stdin shape:
20
- @'
21
- <input>
22
- '@ | aib <command> --stdin
16
+ Stdin examples show command and input separately to avoid shell-specific syntax.
17
+ Stdin Run lines include the aib prefix to avoid confusion.
18
+
19
+ {{stdin.examples}}
23
20
 
24
21
  Basics
25
22
 
@@ -62,7 +59,7 @@ Use normal text search when the question is just text.
62
59
 
63
60
  For a first pass in a new codebase, map directories before reading files:
64
61
 
65
- tree src depth=5 +onlyDirs limit=200
62
+ aib inspect tree src --depth 5 --only-dirs --limit 200
66
63
 
67
64
  Start compact for broad scans.
68
65
  Use summary, locations, or local graph views first when output could be large.
@@ -72,10 +69,6 @@ If output hides data and shows `view: aib:res_<id>`, use `aib view ...` to fetch
72
69
  Compact output is a starting point, not a substitute for needed code.
73
70
  Fetch exact code when correctness depends on implementation details.
74
71
 
75
- Use prefs when the current phase repeats the same output shape.
76
- Turn details off when they stop helping.
77
- Turn them back on when they matter.
78
-
79
72
  For mutation commands, set the shell/tool harness timeout to 3 minutes.
80
73
 
81
74
  If a mutation command times out or returns no final output, use:
@@ -101,7 +94,7 @@ If move/modulePlan imports do not match the repo style, run:
101
94
  aib help config-setup.import-rules
102
95
 
103
96
  If you are about to change import style across files, add or adopt tsconfig aliases, or clean imports repeatedly, run:
104
- aib help config-setup.import-normalize
97
+ aib help config-setup.import-normalize imports.normalize
105
98
 
106
99
  If tree/graph output includes known repo noise, run:
107
100
  aib help config-setup.excludes
@@ -196,7 +189,7 @@ Start by creating or selecting your session.
196
189
  Create it once, then reuse it.
197
190
  Do not create a new session for every command or subtask.
198
191
 
199
- Session stores saved artifacts, aliases, and prefs.
192
+ Session stores saved artifacts and aliases.
200
193
 
201
194
  Prefer short session names:
202
195
  aa, tr, qa, a2
@@ -224,39 +217,6 @@ Reusable index handles look like:
224
217
 
225
218
  Pass index handles back to the matching inspect command with `--from-file` or `from` in DSL.
226
219
 
227
- Prefs
228
-
229
- Prefs change defaults for the active session.
230
- Use them when you want repeated CLI behavior without repeating request fields.
231
-
232
- Set prefs:
233
- session prefs set <name> <value> [<name> <value>...]
234
-
235
- Example:
236
- session prefs set inspect.graph.hubs false inspect.graph.leaves false
237
-
238
- Show prefs:
239
- session prefs get [prefix] [--all]
240
-
241
- By default, get shows session overrides.
242
- --all includes defaults.
243
- prefix filters keys.
244
-
245
- boolean = true|false
246
- N = integer
247
-
248
- Available prefs:
249
- inspect.code.maxNonEmptyLines N
250
- inspect.usages.maxLocations N
251
- inspect.usages.maxCodeBlocks N
252
- inspect.members.maxItems N
253
- inspect.members.all boolean
254
- inspect.graph.hubs boolean
255
- inspect.graph.entrypoints boolean
256
- inspect.graph.leaves boolean
257
- inspect.graph.edges boolean
258
- inspect.graph.symbolUsage boolean
259
-
260
220
  Selectors identify symbols when names are ambiguous.
261
221
  Use plain names when they are unambiguous.
262
222
  Use selectors when aib reports ambiguity or when different symbol kinds share a name.
@@ -275,8 +235,9 @@ c-Name class
275
235
  i-Name interface
276
236
  t-Name type
277
237
  v-name variable
278
- e-Name enum
279
- m-name method, usually with parent
238
+ e-Name enum
239
+ ns-Name namespace
240
+ m-name method, usually with parent
280
241
  p-name property, usually with parent
281
242
 
282
243
  DSL request model:
@@ -289,9 +250,10 @@ DSL request model:
289
250
  - For one-off file operations, pass the path directly.
290
251
 
291
252
  Syntax:
292
- @file <path> default file
293
- @source <path> default sourceFile for mutations
294
- op arg arg key=value request
253
+ @file <path> default file
254
+ @source <path> default sourceFile for mutations
255
+ @base <dir> default base dir for file mutations
256
+ op arg arg key=value request
295
257
  +flag boolean true
296
258
  -flag boolean false
297
259
  >name save reusable artifact when supported
@@ -336,16 +298,16 @@ aib help inspect.cycles
336
298
  Prefer one batch DSL request for related questions.
337
299
 
338
300
  Batch example:
339
-
340
- Run:
341
- aib inspect --stdin
342
-
301
+
302
+ Run:
303
+ aib inspect --stdin
304
+
343
305
  Input:
344
306
  @file @svc/service.ts
345
307
  file
346
308
  file @svc/serviceB.ts
347
309
  members Service
348
- code entities=[Service.{render,reset},normalize]
310
+ code entities=[Service.{render,reset},normalize,default,IIFE#1]
349
311
  code @svc/serviceC.ts ServiceC -ranges
350
312
  usages target=@svc/service.ts normalize scope=src detail=loc
351
313
  duplicates scope=src/scripts detail=sum limit=20
@@ -386,8 +348,9 @@ Exported declarations are marked in the output.
386
348
  It shows what lives in the file before you decide whether to read code.
387
349
 
388
350
  Good for:
389
- - mapping an unfamiliar file
351
+ - mapping a file
390
352
  - listing top-level declarations
353
+ - seeing default exports, decorators, IIFEs, and runtime calls
391
354
  - checking whether a file contains real declarations or mostly re-exports
392
355
 
393
356
  Do not add limit just in case.
@@ -490,7 +453,7 @@ Use code to fetch exact declarations or members.
490
453
  It returns focused code without reading the whole file.
491
454
 
492
455
  Good for:
493
- - reading a known function, class, method, or declaration
456
+ - reading a known function, class, method, declaration, `default`, or `IIFE#N`
494
457
  - fetching several related code blocks in one request
495
458
  - keeping context focused on code needed for the current task
496
459
 
@@ -504,30 +467,30 @@ Defaults: +show +ranges
504
467
  Use -show for names/ranges only.
505
468
  Use -ranges for source without ranges.
506
469
 
507
- Run:
508
- aib inspect --stdin
509
-
470
+ Run:
471
+ aib inspect --stdin
472
+
510
473
  Input:
511
474
  code @svc/service.ts Service.{render,reset} normalize
512
- code @svc/serviceB.ts ServiceB.{constructor}
475
+ code @svc/serviceB.ts ServiceB.{constructor} default IIFE#1
513
476
 
514
477
  Inspect Deps
515
478
 
516
479
  Use deps to see what one entity depends on inside its file.
517
480
  It separates type-only dependencies from runtime value dependencies.
518
481
 
519
- Good for:
520
- - checking what a symbol may need when moved or extracted
521
- - spotting nearby types, constants, or helpers tied to one entity
522
- - deciding whether one symbol is standalone or tied to nearby declarations
482
+ Good for:
483
+ - checking what a symbol may need when moved or extracted
484
+ - spotting nearby types, constants, or helpers tied to one entity
485
+ - deciding whether one symbol is standalone or tied to nearby declarations
523
486
  - debugging mutation failures caused by local dependency shape
524
487
 
525
488
  Controls:
526
489
  file, entity, entities, parent
527
490
 
528
- Run:
529
- aib inspect --stdin
530
-
491
+ Run:
492
+ aib inspect --stdin
493
+
531
494
  Input:
532
495
  deps @svc/service.ts entities=[createService,normalize,Service.{render,reset}]
533
496
  deps @svc/serviceB.ts ServiceB.{constructor} getConfig
@@ -602,7 +565,7 @@ scope=src creates a broad reusable map for src.
602
565
  scope=src/services is cheaper for local work.
603
566
  scope=[src/services,src/components] compares known areas without mapping all src.
604
567
 
605
- After you understand which graph sections matter, hide the rest with flags or prefs.
568
+ After you understand which graph sections matter, hide the rest with flags.
606
569
  Graph can be noisy; shape it for the current task.
607
570
 
608
571
  Controls:
@@ -626,8 +589,8 @@ graph from=aib:graph:services-graph focus=[@svc/users.ts,@svc/admins.ts] +symbol
626
589
  Focus saved graph later:
627
590
  inspect graph --from-file aib:graph:services-graph --focus @svc/messages.ts --focus @svc/posts.ts --symbol-usage
628
591
 
629
- Inline graph focus can add focus and symbolUsage.
630
- Use DSL, request files, or prefs to hide sections such as edges/hubs/entrypoints/leaves.
592
+ Inline graph focus can add focus and symbolUsage.
593
+ Use DSL or request flags to hide sections such as edges/hubs/entrypoints/leaves.
631
594
 
632
595
  Inspect Tree
633
596
 
@@ -681,22 +644,32 @@ duplicates scope=@svc detail=loc pathExclude=[src/generated,"**/* copy.ts"] limi
681
644
 
682
645
  Mutation
683
646
 
684
- Mutation commands change code through TS/IDE refactors.
685
- Successful mutations update affected references and imports.
686
-
647
+ Mutation commands change code and files through TS/IDE-backed operations.
648
+ Successful mutations update affected references and imports.
649
+
650
+ Semantic mutations change TypeScript symbols/declarations.
651
+ File mutations change file layout.
652
+
687
653
  After a successful mutation, do not manually patch the same imports unless aib reports a follow-up or checks show a real issue.
688
654
 
689
- If move/modulePlan imports do not match the repo style, run:
655
+ If mutation imports do not match the repo style, run:
690
656
  aib help config-setup.import-rules
691
657
 
692
- AIB mutations are designed to reduce manual checking.
693
- Your job is to express the intent in DSL.
694
- AIB's job is to convert that intent into code changes.
695
-
696
- Do not read all changed files just because a mutation touched them.
697
- That defeats the purpose of using AIB for mechanical refactors.
698
-
699
- If the command succeeds, the requested mechanical change was applied.
658
+ AIB mutations are designed to reduce manual checking.
659
+ Your job is to express the intent in DSL.
660
+ AIB's job is to convert that intent into code changes.
661
+
662
+ Choose the mutation by intent:
663
+ rename - rename TypeScript symbols
664
+ move toFile - move TypeScript declarations into one file
665
+ modulePlan - split one source file into several modules
666
+ file move toDir - move whole files into directories
667
+ file rename - rename whole files.
668
+
669
+ Do not read all changed files just because a mutation touched them.
670
+ That defeats the purpose of using AIB for mechanical refactors.
671
+
672
+ If the command succeeds, the requested mechanical change was applied.
700
673
  After failure or partial success, use the output to decide the next request.
701
674
 
702
675
  When running mutation commands, set the harness timeout to 3 minutes.
@@ -709,7 +682,7 @@ preview inspect planned edits, then apply by id
709
682
  apply write a previewed change
710
683
  execute write immediately
711
684
 
712
- Use execute for routine rename/move/modulePlan requests.
685
+ Use execute for routine requests.
713
686
 
714
687
  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.
715
688
  Typical examples: a huge modulePlan or refactor batch.
@@ -812,42 +785,24 @@ move src/service.types.ts: newType
812
785
  This keeps related mutation intent together:
813
786
  rename first, then move the renamed symbols.
814
787
 
815
- Imports Normalize
788
+ File Move and File Rename
816
789
 
817
- Use imports normalize for explicit import-style cleanup.
818
- It rewrites resolved local import/export specifiers inside a chosen file or directory.
819
-
820
- Use importNormalize in aib.json for repeated defaults.
790
+ Use file move/rename when the filesystem layout is the intent.
791
+ Do not change filesystem layout manually.
821
792
 
822
- Good for:
823
- - converting one area to aliases or relative imports
824
- - cleaning import style after manual edits or broad refactors
825
- - applying the same import style to a directory without hand-editing files
826
- - applying new tsconfig aliases after they are added
827
-
828
- Controls:
829
- scope file/dir scope to normalize
830
- to relative|alias|shortestAlias
831
- preferAlias select one tsconfig paths pattern when several aliases can resolve the same file
832
- exclude files, directories, or glob-like patterns to skip
833
- all show all planned edits; avoid on broad directory scopes
793
+ Focused topics:
794
+ aib help file.move file.rename
834
795
 
835
- Run:
836
- aib imports normalize preview --stdin
837
-
838
- Input:
839
- imports.normalize scope=@svc to=shortestAlias exclude=[@svc/generated,"**/* copy.ts"]
840
-
841
- Rewrite imports found inside src/core.
842
- When an imported file can be expressed through @features/*, prefer that alias.
843
-
844
- Input:
845
- imports.normalize scope=src/core to=alias preferAlias=@features/*
846
-
847
- With matching importNormalize config for this scope or a parent scope, use inline CLI commands:
848
-
849
- imports normalize preview @svc
850
- imports normalize execute @svc
796
+ Layout smell trigger:
797
+ If a directory has many related files sharing a prefix, mixed responsibilities, or files that should be grouped by feature, read:
798
+ aib help recipe.file-layout
799
+
800
+ Imports Normalize
801
+
802
+ Use imports normalize for explicit import-style cleanup.
803
+
804
+ Focused topic:
805
+ aib help imports.normalize
851
806
 
852
807
  JS/TS compatibility
853
808
 
@@ -906,30 +861,36 @@ For focused text reads, prefer qr over cat/Get-Content/type, especially when ali
906
861
  Use shell reads only when piping into shell tooling or qr is unavailable.
907
862
 
908
863
  Controls:
909
- -h N head; first N lines
910
- -t N tail; last N lines
911
- -o N offset; starting line, 1-based
912
- -l N limit; line count for offset reads
913
- -a all; whole file
864
+ h=N head; first N lines
865
+ t=N tail; last N lines
866
+ o=N l=N range; starting line and line count
867
+ all whole file
914
868
 
915
- If no window is provided, qr uses -h 80.
916
- If -a is present, it wins over other window flags.
869
+ If no window is provided, qr uses h=80.
870
+ If all is present, it wins over other window flags.
917
871
 
918
- Run:
919
- aib qr --stdin
872
+ {{qr.inline.examples}}
920
873
 
921
- Input:
922
- qr @scripts/a.txt h=80
923
- qr @scripts/b.py o=300 l=50
924
- qr @scripts/c.md t=120
925
- qr @logs/app.log all
874
+ aib rg
926
875
 
927
- Inline:
928
- aib qr @scripts/a.txt -h 80
929
- aib qr @scripts/b.py -o 300 -l 50
930
- aib qr @logs/app.log -a
876
+ Run ripgrep through AIB.
877
+
878
+ Regular rg:
879
+ rg <args>
880
+
881
+ AIB rg:
882
+ aib rg -- <args>
883
+
884
+ Everything after `--` is passed as normal ripgrep arguments.
885
+ Use the same args you would pass to `rg`.
886
+ Use normal paths in input. Do not use AIB path aliases here.
887
+
888
+ Examples:
889
+ rg -n "TODO" src/core
890
+ aib rg -- -n "TODO" src/core
931
891
 
932
- Use stdin for several reads.
892
+ rg -n --column "SomeValue" ws/commands ws/config
893
+ aib rg -- -n --column "SomeValue" ws/commands ws/config
933
894
 
934
895
  Need to see TypeScript configs in the repo:
935
896
  aib reveal tsconfigs
@@ -0,0 +1,44 @@
1
+ Run as: aib help <topic...>
2
+
3
+ Start here if this is your first AIB pass:
4
+ bootstrap
5
+
6
+ Always after context compaction:
7
+ aib help help-protocol quick-map
8
+ aib config aliases
9
+
10
+ Help conventions:
11
+ help-format
12
+
13
+ Refresh workflow model:
14
+ basics patterns
15
+
16
+ Core focused topics:
17
+ session
18
+ prefs
19
+ selectors
20
+ dsl
21
+ inspect
22
+ mutation
23
+
24
+ Feature topics:
25
+ inspect.file
26
+ inspect.imports
27
+ inspect.exports
28
+ inspect.members
29
+ inspect.code
30
+ inspect.deps
31
+ inspect.usages
32
+ inspect.graph
33
+ inspect.tree
34
+ inspect.duplicates
35
+ inspect.cycles
36
+ rename
37
+ move
38
+ modulePlan
39
+ refactor.batch
40
+ imports.normalize
41
+ view
42
+ qr
43
+ rg
44
+ reveal
@@ -0,0 +1,2 @@
1
+ Inline:
2
+ aib qr @scripts/a.txt h=80 @scripts/b.py o=300 l=50 @logs/app.log all
@@ -0,0 +1,8 @@
1
+ Bash/Zsh:
2
+ aib <command> --stdin <<'EOF'
3
+ <input>
4
+ EOF
5
+
6
+ aib inspect --stdin <<'EOF'
7
+ tree . +onlyDirs limit=20
8
+ EOF
@@ -0,0 +1,8 @@
1
+ PowerShell:
2
+ @'
3
+ <input>
4
+ '@ | aib <command> --stdin
5
+
6
+ @'
7
+ tree . +onlyDirs limit=20
8
+ '@ | aib inspect --stdin
@@ -0,0 +1,12 @@
1
+ Bash/Zsh:
2
+ aib <command> --stdin <<'EOF'
3
+ <input>
4
+ EOF
5
+
6
+ aib inspect --stdin <<'EOF'
7
+ tree . +onlyDirs limit=20
8
+ EOF
9
+
10
+ aib qr --stdin <<'EOF'
11
+ qr package.json h=20
12
+ EOF
@@ -0,0 +1,12 @@
1
+ PowerShell:
2
+ @'
3
+ <input>
4
+ '@ | aib <command> --stdin
5
+
6
+ @'
7
+ tree . +onlyDirs limit=20
8
+ '@ | aib inspect --stdin
9
+
10
+ @'
11
+ qr package.json h=20
12
+ '@ | aib qr --stdin
@@ -8,9 +8,10 @@ DSL request model:
8
8
  - For one-off file operations, pass the path directly.
9
9
 
10
10
  Syntax:
11
- @file <path> default file
12
- @source <path> default sourceFile for mutations
13
- op arg arg key=value request
11
+ @file <path> default file
12
+ @source <path> default sourceFile for mutations
13
+ @base <dir> default base dir for file mutations
14
+ op arg arg key=value request
14
15
  +flag boolean true
15
16
  -flag boolean false
16
17
  >name save reusable artifact when supported
@@ -0,0 +1,44 @@
1
+ Modes: preview/apply or execute.
2
+ Use execute for routine changes.
3
+ Use preview/apply when learning a mutation command or inspecting a large multi-step request before writing files.
4
+
5
+ file move moves whole files into target directories.
6
+ Missing target directories are created automatically.
7
+
8
+ Use it when the filesystem layout is the intent.
9
+
10
+ Move to directory:
11
+ file move toDir preview --stdin
12
+ file move toDir execute --stdin
13
+ file move toDir apply <previewId>
14
+
15
+ Use preview/apply when you want to inspect planned file moves before writing files.
16
+ Use execute when you want to write immediately.
17
+
18
+ Run:
19
+ aib file move toDir execute --stdin
20
+
21
+ Input:
22
+ @base src/svc
23
+ moveToDir facade: ../services/fileA.ts fileB.ts
24
+ moveToDir ../core/services: fileC.ts classes/main/fileD.ts
25
+
26
+ How this resolves:
27
+ ../services/fileA.ts resolves to src/services/fileA.ts
28
+ fileB.ts resolves to src/svc/fileB.ts
29
+ facade resolves to src/svc/facade
30
+ ../core/services resolves to src/core/services
31
+ moved files keep their basename, not their source subdirectory
32
+
33
+ Resulting files:
34
+ src/svc/facade/fileA.ts
35
+ src/svc/facade/fileB.ts
36
+ src/core/services/fileC.ts
37
+ src/core/services/fileD.ts
38
+
39
+ Rules:
40
+ - @base sets the base directory for source files and target directories.
41
+ - source file paths resolve from @base; cwd-relative paths are accepted when the @base path does not exist.
42
+ - target directories resolve from @base.
43
+ - source paths and target directories may use `..`.
44
+ - file move supports files, not directories.
@@ -0,0 +1,33 @@
1
+ Modes: preview/apply or execute.
2
+ Use execute for routine changes.
3
+ Use preview/apply when learning a mutation command or inspecting a large multi-step request before writing files.
4
+
5
+ file rename renames whole files.
6
+
7
+ Rename files:
8
+ file rename preview --stdin
9
+ file rename execute --stdin
10
+ file rename apply <previewId>
11
+
12
+ Use preview/apply when you want to inspect planned file renames before writing files.
13
+ Use execute when you want to write immediately.
14
+
15
+ Run:
16
+ aib file rename execute --stdin
17
+
18
+ Input:
19
+ @base src
20
+ rename svc/ws-cli.ts->cli.ts svc/ws-command.ts->command.ts
21
+ rename svc/core/opt-build.ts->builder.ts
22
+
23
+ How this resolves:
24
+ - source files resolve from @base;
25
+ - target names without a directory stay beside each source file.
26
+
27
+ Rules:
28
+ - @base sets the base directory for source files.
29
+ - source file paths resolve from @base; cwd-relative paths are accepted when the @base path does not exist.
30
+ - target names without a directory stay beside each source file.
31
+ - target paths with a directory resolve from @base.
32
+ - source paths and target paths may use `..`.
33
+ - file rename supports files, not directories.
@@ -1,10 +1,7 @@
1
1
  Inline commands below omit the aib prefix.
2
2
  Run them as: aib <command>
3
3
 
4
- Stdin examples show command and input separately to avoid shell-specific syntax.
5
- Stdin Run lines include the aib prefix to avoid confusion.
6
-
7
- PowerShell stdin shape:
8
- @'
9
- <input>
10
- '@ | aib <command> --stdin
4
+ Stdin examples show command and input separately to avoid shell-specific syntax.
5
+ Stdin Run lines include the aib prefix to avoid confusion.
6
+
7
+ {{stdin.examples}}
@@ -2,7 +2,7 @@ Use code to fetch exact declarations or members.
2
2
  It returns focused code without reading the whole file.
3
3
 
4
4
  Good for:
5
- - reading a known function, class, method, or declaration
5
+ - reading a known function, class, method, declaration, `default`, or `IIFE#N`
6
6
  - fetching several related code blocks in one request
7
7
  - keeping context focused on code needed for the current task
8
8
 
@@ -19,9 +19,9 @@ Use -ranges for source without ranges.
19
19
  Prefs:
20
20
  inspect.code.maxNonEmptyLines
21
21
 
22
- Run:
23
- aib inspect --stdin
24
-
22
+ Run:
23
+ aib inspect --stdin
24
+
25
25
  Input:
26
26
  code @svc/service.ts Service.{render,reset} normalize
27
- code @svc/serviceB.ts ServiceB.{constructor}
27
+ code @svc/serviceB.ts ServiceB.{constructor} default IIFE#1
@@ -1,18 +1,18 @@
1
1
  Use deps to see what one entity depends on inside its file.
2
2
  It separates type-only dependencies from runtime value dependencies.
3
3
 
4
- Good for:
5
- - checking what a symbol may need when moved or extracted
6
- - spotting nearby types, constants, or helpers tied to one entity
7
- - deciding whether one symbol is standalone or tied to nearby declarations
4
+ Good for:
5
+ - checking what a symbol may need when moved or extracted
6
+ - spotting nearby types, constants, or helpers tied to one entity
7
+ - deciding whether one symbol is standalone or tied to nearby declarations
8
8
  - debugging mutation failures caused by local dependency shape
9
9
 
10
10
  Controls:
11
11
  file, entity, entities, parent
12
12
 
13
- Run:
14
- aib inspect --stdin
15
-
13
+ Run:
14
+ aib inspect --stdin
15
+
16
16
  Input:
17
17
  deps @svc/service.ts entities=[createService,normalize,Service.{render,reset}]
18
18
  deps @svc/serviceB.ts ServiceB.{constructor} getConfig
@@ -3,8 +3,9 @@ Exported declarations are marked in the output.
3
3
  It shows what lives in the file before you decide whether to read code.
4
4
 
5
5
  Good for:
6
- - mapping an unfamiliar file
6
+ - mapping a file
7
7
  - listing top-level declarations
8
+ - seeing default exports, decorators, IIFEs, and runtime calls
8
9
  - checking whether a file contains real declarations or mostly re-exports
9
10
 
10
11
  Do not add limit just in case.