@automaton-labs/aib 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/README.md +578 -0
  2. package/dist/bin/aib.js +2 -0
  3. package/dist/bin/cli.js +3 -0
  4. package/dist/client/http-client.js +1 -0
  5. package/dist/client/transport-options.js +1 -0
  6. package/dist/client/websocket-client.js +1 -0
  7. package/dist/commands/add-missing-imports-preview-cache.js +2 -0
  8. package/dist/commands/add-missing-imports.js +2 -0
  9. package/dist/commands/apply-module-plan.js +3 -0
  10. package/dist/commands/captured-input.js +2 -0
  11. package/dist/commands/config-command.js +3 -0
  12. package/dist/commands/diagnostics-command.js +3 -0
  13. package/dist/commands/doctor.js +1 -0
  14. package/dist/commands/entity-resolution.js +1 -0
  15. package/dist/commands/execution-command.js +1 -0
  16. package/dist/commands/feedback-command.js +3 -0
  17. package/dist/commands/find-importers.js +1 -0
  18. package/dist/commands/find-unused-imports.js +1 -0
  19. package/dist/commands/generate-docs-command.js +6 -0
  20. package/dist/commands/help-command.js +3 -0
  21. package/dist/commands/imports-command.js +1 -0
  22. package/dist/commands/init-skill-usage.js +3 -0
  23. package/dist/commands/init-workspace.js +3 -0
  24. package/dist/commands/inspect-cycles.js +5 -0
  25. package/dist/commands/inspect-format.js +18 -0
  26. package/dist/commands/inspect-graph.js +9 -0
  27. package/dist/commands/inspect-imports.js +2 -0
  28. package/dist/commands/inspect-symbol-query.js +1 -0
  29. package/dist/commands/inspect-tree.js +5 -0
  30. package/dist/commands/inspect.js +16 -0
  31. package/dist/commands/json-file-input.js +1 -0
  32. package/dist/commands/list-instances.js +1 -0
  33. package/dist/commands/module-plan-cache.js +2 -0
  34. package/dist/commands/module-plan-command.js +1 -0
  35. package/dist/commands/module-plan-timeout.js +1 -0
  36. package/dist/commands/move-command.js +1 -0
  37. package/dist/commands/move-preview-cache.js +2 -0
  38. package/dist/commands/move-to-file.js +2 -0
  39. package/dist/commands/mutation-execution-cache.js +3 -0
  40. package/dist/commands/normalize-imports.js +4 -0
  41. package/dist/commands/observability-command.js +3 -0
  42. package/dist/commands/ping.js +1 -0
  43. package/dist/commands/print-config.js +1 -0
  44. package/dist/commands/quick-read.js +11 -0
  45. package/dist/commands/refactor-batch-builder.js +1 -0
  46. package/dist/commands/refactor-batch-execution-cache.js +1 -0
  47. package/dist/commands/refactor-batch-preview-cache.js +2 -0
  48. package/dist/commands/refactor-batch.js +4 -0
  49. package/dist/commands/refactor-command.js +1 -0
  50. package/dist/commands/rename-command.js +1 -0
  51. package/dist/commands/rename-entities.js +4 -0
  52. package/dist/commands/rename-execution-cache.js +1 -0
  53. package/dist/commands/rename-input.js +1 -0
  54. package/dist/commands/rename-preview-cache.js +2 -0
  55. package/dist/commands/result-view.js +6 -0
  56. package/dist/commands/runtime-command.js +4 -0
  57. package/dist/commands/runtime-info.js +1 -0
  58. package/dist/commands/session-workspace.js +31 -0
  59. package/dist/commands/shared.js +1 -0
  60. package/dist/commands/sync-command.js +2 -0
  61. package/dist/commands/validate-module-plan.js +2 -0
  62. package/dist/commands/workspace-cache.js +1 -0
  63. package/dist/compatibility/policy.js +1 -0
  64. package/dist/config/auto-start-ide.js +1 -0
  65. package/dist/config/defaults.js +1 -0
  66. package/dist/config/env-vars.js +1 -0
  67. package/dist/config/glob-match.js +1 -0
  68. package/dist/config/import-rules.js +1 -0
  69. package/dist/config/local-config.js +3 -0
  70. package/dist/config/mutation-comments.js +1 -0
  71. package/dist/config/path-aliases.js +1 -0
  72. package/dist/config/path-display.js +1 -0
  73. package/dist/config/product-storage.js +1 -0
  74. package/dist/config/resolve-command-alias.js +1 -0
  75. package/dist/config/resolve.js +1 -0
  76. package/dist/config/workspace-root.js +3 -0
  77. package/dist/config/workspace-state.js +1 -0
  78. package/dist/content/content-bundle.js +1 -0
  79. package/dist/diagnostics/module-plan-timeline.js +2 -0
  80. package/dist/diagnostics/readiness-text.js +8 -0
  81. package/dist/discovery/registry.js +1 -0
  82. package/dist/discovery/select-instance.js +1 -0
  83. package/dist/dsl/aib-dsl.js +1 -0
  84. package/dist/help/bootstrap.md +924 -0
  85. package/dist/help/diagnostics/doctor.json +70 -0
  86. package/dist/help/docs/basics.md +14 -0
  87. package/dist/help/docs/dsl.md +25 -0
  88. package/dist/help/docs/help-format.md +12 -0
  89. package/dist/help/docs/imports.normalize.md +36 -0
  90. package/dist/help/docs/inspect.code.md +29 -0
  91. package/dist/help/docs/inspect.deps.md +32 -0
  92. package/dist/help/docs/inspect.duplicates.md +72 -0
  93. package/dist/help/docs/inspect.exports.md +34 -0
  94. package/dist/help/docs/inspect.file.md +32 -0
  95. package/dist/help/docs/inspect.graph.md +112 -0
  96. package/dist/help/docs/inspect.imports.md +15 -0
  97. package/dist/help/docs/inspect.md +71 -0
  98. package/dist/help/docs/inspect.members.md +24 -0
  99. package/dist/help/docs/inspect.tree.md +30 -0
  100. package/dist/help/docs/inspect.usages.md +48 -0
  101. package/dist/help/docs/modulePlan.md +51 -0
  102. package/dist/help/docs/move.md +37 -0
  103. package/dist/help/docs/mutation.md +47 -0
  104. package/dist/help/docs/patterns.md +178 -0
  105. package/dist/help/docs/prefs.md +40 -0
  106. package/dist/help/docs/qr.md +33 -0
  107. package/dist/help/docs/refactor.batch.md +44 -0
  108. package/dist/help/docs/rename.md +39 -0
  109. package/dist/help/docs/selectors.md +23 -0
  110. package/dist/help/docs/session.md +61 -0
  111. package/dist/help/docs/view.md +30 -0
  112. package/dist/help/dsl/bootstrap.md +924 -0
  113. package/dist/help/dsl/docs/basics.md +14 -0
  114. package/dist/help/dsl/docs/dsl.md +25 -0
  115. package/dist/help/dsl/docs/help-format.md +12 -0
  116. package/dist/help/dsl/docs/imports.normalize.md +36 -0
  117. package/dist/help/dsl/docs/inspect.code.md +29 -0
  118. package/dist/help/dsl/docs/inspect.deps.md +32 -0
  119. package/dist/help/dsl/docs/inspect.duplicates.md +72 -0
  120. package/dist/help/dsl/docs/inspect.exports.md +34 -0
  121. package/dist/help/dsl/docs/inspect.file.md +32 -0
  122. package/dist/help/dsl/docs/inspect.graph.md +112 -0
  123. package/dist/help/dsl/docs/inspect.imports.md +15 -0
  124. package/dist/help/dsl/docs/inspect.md +71 -0
  125. package/dist/help/dsl/docs/inspect.members.md +24 -0
  126. package/dist/help/dsl/docs/inspect.tree.md +30 -0
  127. package/dist/help/dsl/docs/inspect.usages.md +48 -0
  128. package/dist/help/dsl/docs/modulePlan.md +51 -0
  129. package/dist/help/dsl/docs/move.md +37 -0
  130. package/dist/help/dsl/docs/mutation.md +47 -0
  131. package/dist/help/dsl/docs/patterns.md +178 -0
  132. package/dist/help/dsl/docs/prefs.md +40 -0
  133. package/dist/help/dsl/docs/qr.md +33 -0
  134. package/dist/help/dsl/docs/refactor.batch.md +44 -0
  135. package/dist/help/dsl/docs/rename.md +39 -0
  136. package/dist/help/dsl/docs/selectors.md +23 -0
  137. package/dist/help/dsl/docs/session.md +61 -0
  138. package/dist/help/dsl/docs/view.md +30 -0
  139. package/dist/help/dsl/full.md +924 -0
  140. package/dist/help/dsl/snippets/agents.md +14 -0
  141. package/dist/help/dsl/topics/basics.md +12 -0
  142. package/dist/help/dsl/topics/dsl.md +23 -0
  143. package/dist/help/dsl/topics/help-format.md +10 -0
  144. package/dist/help/dsl/topics/imports.normalize.md +34 -0
  145. package/dist/help/dsl/topics/inspect.code.md +27 -0
  146. package/dist/help/dsl/topics/inspect.deps.md +30 -0
  147. package/dist/help/dsl/topics/inspect.duplicates.md +43 -0
  148. package/dist/help/dsl/topics/inspect.exports.md +32 -0
  149. package/dist/help/dsl/topics/inspect.file.md +30 -0
  150. package/dist/help/dsl/topics/inspect.graph.md +110 -0
  151. package/dist/help/dsl/topics/inspect.imports.md +13 -0
  152. package/dist/help/dsl/topics/inspect.md +69 -0
  153. package/dist/help/dsl/topics/inspect.members.md +22 -0
  154. package/dist/help/dsl/topics/inspect.tree.md +20 -0
  155. package/dist/help/dsl/topics/inspect.usages.md +46 -0
  156. package/dist/help/dsl/topics/modulePlan.md +38 -0
  157. package/dist/help/dsl/topics/move.md +27 -0
  158. package/dist/help/dsl/topics/mutation.md +45 -0
  159. package/dist/help/dsl/topics/patterns.md +176 -0
  160. package/dist/help/dsl/topics/prefs.md +38 -0
  161. package/dist/help/dsl/topics/qr.md +31 -0
  162. package/dist/help/dsl/topics/refactor.batch.md +33 -0
  163. package/dist/help/dsl/topics/rename.md +25 -0
  164. package/dist/help/dsl/topics/selectors.md +21 -0
  165. package/dist/help/dsl/topics/session.md +59 -0
  166. package/dist/help/dsl/topics/view.md +28 -0
  167. package/dist/help/full.md +924 -0
  168. package/dist/help/help-meta.json +113 -0
  169. package/dist/help/index.md +167 -0
  170. package/dist/help/json/bootstrap.md +1074 -0
  171. package/dist/help/json/docs/basics.md +15 -0
  172. package/dist/help/json/docs/dsl.md +25 -0
  173. package/dist/help/json/docs/help-format.md +12 -0
  174. package/dist/help/json/docs/imports.normalize.md +47 -0
  175. package/dist/help/json/docs/inspect.code.md +41 -0
  176. package/dist/help/json/docs/inspect.deps.md +46 -0
  177. package/dist/help/json/docs/inspect.duplicates.md +65 -0
  178. package/dist/help/json/docs/inspect.exports.md +40 -0
  179. package/dist/help/json/docs/inspect.file.md +38 -0
  180. package/dist/help/json/docs/inspect.graph.md +139 -0
  181. package/dist/help/json/docs/inspect.imports.md +15 -0
  182. package/dist/help/json/docs/inspect.md +87 -0
  183. package/dist/help/json/docs/inspect.members.md +32 -0
  184. package/dist/help/json/docs/inspect.tree.md +30 -0
  185. package/dist/help/json/docs/inspect.usages.md +61 -0
  186. package/dist/help/json/docs/modulePlan.md +70 -0
  187. package/dist/help/json/docs/move.md +53 -0
  188. package/dist/help/json/docs/mutation.md +62 -0
  189. package/dist/help/json/docs/patterns.md +178 -0
  190. package/dist/help/json/docs/prefs.md +40 -0
  191. package/dist/help/json/docs/qr.md +33 -0
  192. package/dist/help/json/docs/refactor.batch.md +72 -0
  193. package/dist/help/json/docs/rename.md +47 -0
  194. package/dist/help/json/docs/selectors.md +23 -0
  195. package/dist/help/json/docs/session.md +77 -0
  196. package/dist/help/json/docs/view.md +30 -0
  197. package/dist/help/json/full.md +1074 -0
  198. package/dist/help/json/snippets/agents.md +14 -0
  199. package/dist/help/json/topics/basics.md +13 -0
  200. package/dist/help/json/topics/dsl.md +23 -0
  201. package/dist/help/json/topics/help-format.md +10 -0
  202. package/dist/help/json/topics/imports.normalize.md +45 -0
  203. package/dist/help/json/topics/inspect.code.md +39 -0
  204. package/dist/help/json/topics/inspect.deps.md +44 -0
  205. package/dist/help/json/topics/inspect.duplicates.md +37 -0
  206. package/dist/help/json/topics/inspect.exports.md +38 -0
  207. package/dist/help/json/topics/inspect.file.md +36 -0
  208. package/dist/help/json/topics/inspect.graph.md +137 -0
  209. package/dist/help/json/topics/inspect.imports.md +13 -0
  210. package/dist/help/json/topics/inspect.md +85 -0
  211. package/dist/help/json/topics/inspect.members.md +30 -0
  212. package/dist/help/json/topics/inspect.tree.md +20 -0
  213. package/dist/help/json/topics/inspect.usages.md +59 -0
  214. package/dist/help/json/topics/modulePlan.md +57 -0
  215. package/dist/help/json/topics/move.md +43 -0
  216. package/dist/help/json/topics/mutation.md +60 -0
  217. package/dist/help/json/topics/patterns.md +176 -0
  218. package/dist/help/json/topics/prefs.md +38 -0
  219. package/dist/help/json/topics/qr.md +31 -0
  220. package/dist/help/json/topics/refactor.batch.md +61 -0
  221. package/dist/help/json/topics/rename.md +42 -0
  222. package/dist/help/json/topics/selectors.md +21 -0
  223. package/dist/help/json/topics/session.md +59 -0
  224. package/dist/help/json/topics/view.md +28 -0
  225. package/dist/help/snippets/agents.md +14 -0
  226. package/dist/help/topics/basics.md +12 -0
  227. package/dist/help/topics/dsl.md +23 -0
  228. package/dist/help/topics/help-format.md +10 -0
  229. package/dist/help/topics/imports.normalize.md +34 -0
  230. package/dist/help/topics/inspect.code.md +27 -0
  231. package/dist/help/topics/inspect.deps.md +30 -0
  232. package/dist/help/topics/inspect.duplicates.md +43 -0
  233. package/dist/help/topics/inspect.exports.md +32 -0
  234. package/dist/help/topics/inspect.file.md +30 -0
  235. package/dist/help/topics/inspect.graph.md +110 -0
  236. package/dist/help/topics/inspect.imports.md +13 -0
  237. package/dist/help/topics/inspect.md +69 -0
  238. package/dist/help/topics/inspect.members.md +22 -0
  239. package/dist/help/topics/inspect.tree.md +20 -0
  240. package/dist/help/topics/inspect.usages.md +46 -0
  241. package/dist/help/topics/modulePlan.md +38 -0
  242. package/dist/help/topics/move.md +27 -0
  243. package/dist/help/topics/mutation.md +45 -0
  244. package/dist/help/topics/patterns.md +176 -0
  245. package/dist/help/topics/prefs.md +38 -0
  246. package/dist/help/topics/qr.md +31 -0
  247. package/dist/help/topics/refactor.batch.md +33 -0
  248. package/dist/help/topics/rename.md +25 -0
  249. package/dist/help/topics/selectors.md +21 -0
  250. package/dist/help/topics/session.md +59 -0
  251. package/dist/help/topics/view.md +28 -0
  252. package/dist/ide-launch/common.cjs +162 -0
  253. package/dist/managed-host/extension-vsix-resolver.js +1 -0
  254. package/dist/managed-host/manage-serve-web-host.cjs +141 -0
  255. package/dist/managed-host/serve-web-autostart.js +1 -0
  256. package/dist/managed-host/serve-web-host.cjs +1790 -0
  257. package/dist/metrics/central-metrics.js +2 -0
  258. package/dist/observability/config.js +1 -0
  259. package/dist/observability/context.js +1 -0
  260. package/dist/observability/failure-snapshot.js +2 -0
  261. package/dist/observability/recent.js +2 -0
  262. package/dist/payloads/read-stdin-json.js +1 -0
  263. package/dist/runtime/bundled-node.js +1 -0
  264. package/dist/runtime/input-source.js +1 -0
  265. package/dist/runtime/managed-runtime-provisioning.js +1 -0
  266. package/dist/runtime/run-command.js +1 -0
  267. package/dist/selectors/parse-entities.js +1 -0
  268. package/dist/session/client.js +1 -0
  269. package/dist/session/paths.js +1 -0
  270. package/dist/session/server.js +6 -0
  271. package/dist/shared/agent-text.js +1 -0
  272. package/dist/shared/diagnostic-catalog.js +1 -0
  273. package/dist/shared/diagnostics.js +1 -0
  274. package/dist/shared/errors.js +28 -0
  275. package/dist/shared/event-loop.js +1 -0
  276. package/dist/shared/hints.js +1 -0
  277. package/dist/shared/metrics.js +1 -0
  278. package/dist/shared/operations.js +1 -0
  279. package/dist/shared/presentation.js +4 -0
  280. package/dist/shared/protocol.js +1 -0
  281. package/dist/shared/routes.js +1 -0
  282. package/dist/shared/stdout.js +2 -0
  283. package/dist/shared/types.js +1 -0
  284. package/dist/tracing/config.js +2 -0
  285. package/dist/tracing/trace.js +3 -0
  286. package/extension/vscode-refactor-bridge-extension.vsix +0 -0
  287. package/package.json +39 -0
  288. package/runtimes/launcher/win-x64/aib.exe +0 -0
  289. package/scripts/install-windows-launcher.cjs +58 -0
  290. package/scripts/postinstall.cjs +28 -0
  291. package/scripts/provision-runtime.cjs +299 -0
@@ -0,0 +1,57 @@
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
+ If a name is ambiguous, use selectors.
6
+ Run help selectors to refresh selector syntax.
7
+
8
+ modulePlan is for splitting large files into smaller modules.
9
+ Use it when a large file should be refactored into several target files.
10
+
11
+ modulePlan orchestrates semantic moves and updates affected references/imports.
12
+
13
+ Use expectEmpty when your modulePlan intent is to move all declarations out of the source file.
14
+ It does not change the move behavior; it only asks output to report remaining source declarations if any remain.
15
+ Use it only when remaining declarations would mean the split did not match your intent.
16
+ Do not use it for partial extractions.
17
+
18
+ Plan:
19
+ modulePlan preview --stdin
20
+ modulePlan execute --stdin
21
+ modulePlan apply <planId>
22
+
23
+ Use preview/apply when you want to inspect the plan before writing files.
24
+ Use execute when you want to preview and apply immediately.
25
+ Use --from with captured input handles when rerunning edited large plans.
26
+
27
+ Split one large source file into several targets:
28
+ Run:
29
+ aib modulePlan execute --stdin
30
+
31
+ Input:
32
+ {
33
+ "sourceFile": "src/large-service.ts",
34
+ "expectEmpty": true,
35
+ "modules": [
36
+ {
37
+ "target": "src/large-service.types.ts",
38
+ "entities": ["ServiceOptions", "ServiceMode"]
39
+ },
40
+ {
41
+ "target": "src/large-service.core.ts",
42
+ "entities": ["LargeService", "createLargeService"]
43
+ }
44
+ ]
45
+ }
46
+
47
+ If a large or partial modulePlan request fails, edit the captured input file and rerun with --from.
48
+ For small one-off modulePlan requests, write a corrected request instead.
49
+
50
+ Latest modulePlan input:
51
+ <session-dir>/inputs/modulePlan/_last.json
52
+
53
+ Handle:
54
+ aib:input:modulePlan:last
55
+
56
+ Example:
57
+ modulePlan preview --from aib:input:modulePlan:last
@@ -0,0 +1,43 @@
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
+ If a name is ambiguous, use selectors.
6
+ Run help selectors to refresh selector syntax.
7
+
8
+ Move transfers one or more symbols from one file to another.
9
+ Move is semantic; it moves supported declarations and updates affected imports/references.
10
+ Use it for focused extraction into a single target file.
11
+ For large file splitting across several target files, use modulePlan.
12
+
13
+ Move to file:
14
+ move toFile preview --stdin
15
+ move toFile execute --stdin
16
+ move toFile apply <previewId>
17
+
18
+ Use preview/apply when you want to inspect the planned change before writing files.
19
+ Use execute when you want to write immediately.
20
+ Use --from with captured input handles when rerunning edited large requests.
21
+
22
+ Move several entities into one target:
23
+ Run:
24
+ aib move toFile execute --stdin
25
+
26
+ Input:
27
+ {
28
+ "sourceFile": "src/service.ts",
29
+ "targetFile": "src/service.helpers.ts",
30
+ "entities": ["oldHelper", "OtherHelper"]
31
+ }
32
+
33
+ If a large move request fails, edit the captured input file and rerun with --from.
34
+ For small one-off move requests, write a corrected request instead.
35
+
36
+ Latest move input:
37
+ <session-dir>/inputs/move/_last.json
38
+
39
+ Handle:
40
+ aib:input:move:last
41
+
42
+ Example:
43
+ move toFile preview --from aib:input:move:last
@@ -0,0 +1,60 @@
1
+ Mutation commands change code through TS/IDE refactors.
2
+ Successful mutations update affected references and imports.
3
+
4
+ After a successful mutation, do not manually patch the same imports unless aib reports a follow-up or checks show a real issue.
5
+
6
+ AIB mutations are designed to reduce manual checking.
7
+ Your job is to express the intent in DSL.
8
+ AIB's job is to convert that intent into code changes.
9
+
10
+ Do not read all changed files just because a mutation touched them.
11
+ That defeats the purpose of using AIB for mechanical refactors.
12
+
13
+ If the command succeeds, the requested mechanical change was applied.
14
+ After failure or partial success, use the output to decide the next request.
15
+
16
+ When running mutation commands, set the harness timeout to 3 minutes.
17
+ If the harness stops waiting before final output appears, recover with:
18
+
19
+ aib execution status last
20
+
21
+ Modes:
22
+ preview inspect planned edits, then apply by id
23
+ apply write a previewed change
24
+ execute write immediately
25
+
26
+ Use execute for routine rename/move/modulePlan requests.
27
+
28
+ 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.
29
+ Typical examples: a huge modulePlan or refactor batch.
30
+
31
+ preview/apply uses more tool calls and more output tokens.
32
+ preview validates input and planned edits, but writing files can still hit a TS/IDE refactor error.
33
+ execute writes immediately and reports what changed.
34
+
35
+ If a mutation cannot be completed, aib reports the failed part and the captured input.
36
+ For large or partial requests, edit the captured input and rerun the remaining or changed intent.
37
+ For small requests, write a corrected request instead.
38
+
39
+ Prefer batch JSON for related mutations.
40
+ One request can describe several related changes.
41
+ aib captures JSON input automatically so large failed or partial requests can be edited and rerun.
42
+
43
+ When a batch mutation partly fails, split the next request by failure type.
44
+
45
+ If the failure is wrong input, fix the selector/entity/file and run the corrected remaining intent.
46
+ If TS/IDE cannot apply one part of the batch, do not treat the whole intent as failed.
47
+ Run the next request without the failed part and let aib report any later failures.
48
+ Then decide whether failed parts need smaller requests or manual fallback.
49
+
50
+ If a large or partial mutation request fails, edit the captured input file and rerun with --from.
51
+ For small one-off requests, write a corrected request instead.
52
+
53
+ Latest mutation inputs:
54
+ <session-dir>/inputs/rename/_last.json
55
+ <session-dir>/inputs/move/_last.json
56
+ <session-dir>/inputs/refactor/_last.json
57
+ <session-dir>/inputs/modulePlan/_last.json
58
+
59
+ Example:
60
+ rename preview --from aib:input:rename:last
@@ -0,0 +1,176 @@
1
+ Use aib before broad file reads when the question is about TS/JS structure, references, dependencies, or focused code.
2
+ Use normal text search when the question is just text.
3
+
4
+ For a first pass in a new codebase, map directories before reading files:
5
+
6
+ tree src depth=5 +onlyDirs limit=200
7
+
8
+ Start compact for broad scans.
9
+ Use summary, locations, or local graph views first when output could be large.
10
+ Expand to code or wider graph views only for the parts that matter now.
11
+ If output hides data and shows `view: aib:res_<id>`, use `aib view ...` to fetch only the hidden part instead of repeating the original request.
12
+
13
+ Compact output is a starting point, not a substitute for needed code.
14
+ Fetch exact code when correctness depends on implementation details.
15
+
16
+ Use prefs when the current phase repeats the same output shape.
17
+ Turn details off when they stop helping.
18
+ Turn them back on when they matter.
19
+
20
+ Use @file only when several following operations share the same file.
21
+ For independent one-off file requests, pass the path directly:
22
+ file @svc/a.ts
23
+ code @svc/b.ts ServiceB
24
+
25
+ AIB mutations are designed to reduce manual checking.
26
+ Your job is to express the intent in DSL.
27
+ AIB's job is to convert that intent into code changes.
28
+
29
+ Do not read all changed files just because a mutation touched them.
30
+ That defeats the purpose of using AIB for mechanical refactors.
31
+
32
+ If the command succeeds, the requested mechanical change was applied.
33
+ After failure or partial success, use the output to decide the next request.
34
+
35
+ For mutation commands, set the shell/tool harness timeout to 3 minutes.
36
+
37
+ If a mutation command times out or returns no final output, use:
38
+
39
+ aib execution status last
40
+
41
+ This is an escape hatch for recovering the latest mutation status/result.
42
+
43
+ Before repeated mutation work, check aib config:
44
+
45
+ aib config
46
+
47
+ Set pathAliases for repeated request paths.
48
+ Set importRules so move/modulePlan create imports in the project style.
49
+
50
+ This avoids repeating long paths in requests and avoids manual import cleanup after mutations.
51
+ Do this before large move/modulePlan work, not after cleanup becomes repetitive.
52
+
53
+ Example aib.json config:
54
+
55
+ {
56
+ "pathAliases": {
57
+ "svc": "src/services",
58
+ "cli": "packages/cli/src",
59
+ "ext": "packages/extension/src"
60
+ },
61
+ "importRules": [
62
+ {
63
+ "scope": ".",
64
+ "specifier": "shortest",
65
+ "ending": "auto",
66
+ "builtin": "bare",
67
+ "unusedImports": "remove"
68
+ }
69
+ ],
70
+ "importNormalize": [
71
+ {
72
+ "scope": "src",
73
+ "to": "shortestAlias",
74
+ "exclude": ["src/generated"]
75
+ }
76
+ ],
77
+ "inspect.graph.exclude": [
78
+ "**/* copy.ts"
79
+ ]
80
+ }
81
+
82
+ pathAliases define short request aliases for paths agents repeat in aib commands.
83
+ Use them to reduce input tokens for repeated inspect and mutation work.
84
+
85
+ Aliases are for aib request paths. They do not change TypeScript imports by themselves.
86
+ For import style after mutations, use importRules.
87
+
88
+ importRules control imports created or expanded by move/modulePlan mutation cleanup.
89
+ They do not rewrite the whole project.
90
+
91
+ AIB starts from IDE/TS import preferences.
92
+ For mutation cleanup, matching importRules in aib.json take priority.
93
+
94
+ Do not assume IDE/TS defaults match the repo style.
95
+ Set importRules before large move/modulePlan work so imports do not need manual cleanup.
96
+
97
+ Fields:
98
+ scope repo-relative file or directory scope; most specific scope wins
99
+ specifier relative|shortest|project-relative|non-relative
100
+ ending auto|minimal|index|js
101
+ builtin node|bare
102
+ unusedImports remove|preserve
103
+
104
+ Defaults:
105
+ specifier omitted IDE/TS decides
106
+ ending omitted IDE/TS decides
107
+ builtin omitted keep TS/project builtin style
108
+ unusedImports omitted keep unused imports
109
+
110
+ specifier:
111
+ relative best for local relative imports
112
+ shortest best for shortest valid alias/path output
113
+ project-relative best for root-relative project imports
114
+ non-relative best for package or alias imports
115
+
116
+ ending:
117
+ minimal best for extensionless TS imports
118
+ js best for ESM-style TS projects that require .js
119
+ auto leaves the decision to TypeScript
120
+ index best for explicit index import style
121
+
122
+ builtin:
123
+ node path -> node:path; best for explicit Node builtin imports
124
+ bare node:path -> path; best for bare Node builtin imports
125
+ omit field keeps TypeScript/project output; add builtin if agents keep fixing this manually
126
+
127
+ unusedImports:
128
+ remove clean unused imports in mutation-touched files
129
+ preserve keep unused imports
130
+ omit same as preserve
131
+
132
+ Mutation-touched files are files where TS produced edits: source/target files and any reference/update files TS changed.
133
+ Recommended value: remove
134
+
135
+ importNormalize defines reusable defaults for aib imports normalize.
136
+ Use it when the same normalize request would otherwise be repeated.
137
+
138
+ It affects explicit import normalize commands only.
139
+ It does not run automatically during move/modulePlan; use importRules for mutation-time cleanup.
140
+
141
+ Fields:
142
+ scope repo-relative file or directory scope; most specific scope wins
143
+ to relative|alias|shortestAlias
144
+ preferAlias tsconfig paths pattern used when to=alias
145
+ exclude files, directories, or glob-like patterns to skip
146
+
147
+ to:
148
+ relative rewrite resolved local imports to relative paths
149
+ alias rewrite resolved local imports to a matching tsconfig alias
150
+ shortestAlias rewrite to the shortest valid alias specifier
151
+
152
+ preferAlias:
153
+ @shared/* prefer one alias pattern when several aliases can resolve the same file
154
+
155
+ inspect.graph.exclude skips files before graph builds the model.
156
+ Use it for generated files, backups, local copies, or other paths that make graph output noisy.
157
+
158
+ Excluded files do not affect graph counts, hubs, entrypoints, leaves, edges, imports, importedBy, or saved graph files.
159
+
160
+ Leave feedback while working.
161
+
162
+ aib is built for agents. Agent feedback is the main signal for improving output, docs, mutations, and token efficiency.
163
+
164
+ Use feedback when something is wrong, unclear, noisy, or could be more efficient.
165
+
166
+ Format:
167
+ feedback "kind | message"
168
+ feedback "kind | topic | message"
169
+
170
+ Kinds:
171
+ bug, confusion, friction, idea, other
172
+
173
+ Topic is optional. Choose any short topic that helps classify the feedback.
174
+
175
+ Example:
176
+ feedback "friction | imports | normalize required manual cleanup"
@@ -0,0 +1,38 @@
1
+ Prefs change defaults for the active session.
2
+ Use them when you want repeated CLI behavior without repeating request fields.
3
+
4
+ Set prefs:
5
+ session prefs set <name> <value> [<name> <value>...]
6
+
7
+ Example:
8
+ session prefs set inspect.graph.hubs false inspect.graph.leaves false
9
+
10
+ Show prefs:
11
+ session prefs get [prefix] [--all]
12
+
13
+ By default, get shows session overrides.
14
+ --all includes defaults.
15
+ prefix filters keys.
16
+
17
+ boolean = true|false
18
+ N = integer
19
+
20
+ Available prefs:
21
+ inspect.code.maxNonEmptyLines N
22
+ inspect.usages.maxLocations N
23
+ inspect.usages.maxCodeBlocks N
24
+ inspect.members.maxItems N
25
+ inspect.members.all boolean
26
+ inspect.graph.hubs boolean
27
+ inspect.graph.entrypoints boolean
28
+ inspect.graph.leaves boolean
29
+ inspect.graph.edges boolean
30
+ inspect.graph.symbols boolean
31
+ inspect.graph.symbolUsage boolean
32
+
33
+ Use prefs to reduce repeated request fields and avoid unnecessary output.
34
+
35
+ If graph output is too noisy:
36
+ session prefs set inspect.graph.hubs false inspect.graph.leaves false
37
+
38
+ Change prefs while working. Turn details back on when you need them.
@@ -0,0 +1,31 @@
1
+ Use qr to read arbitrary text files with compact, cross-platform line windows.
2
+ qr supports AIB path aliases.
3
+
4
+ qr is not a replacement for inspect.
5
+ Use it as a token-efficient way to read text data when semantic inspect is not needed.
6
+
7
+ Controls:
8
+ -h N head; first N lines
9
+ -t N tail; last N lines
10
+ -o N offset; starting line, 1-based
11
+ -l N limit; line count for offset reads
12
+ -a all; whole file
13
+
14
+ If no window is provided, qr uses -h 80.
15
+ If -a is present, it wins over other window flags.
16
+
17
+ Run:
18
+ aib qr --stdin
19
+
20
+ Input:
21
+ qr @scripts/a.txt h=80
22
+ qr @scripts/b.py o=300 l=50
23
+ qr @scripts/c.md t=120
24
+ qr @logs/app.log all
25
+
26
+ Inline:
27
+ aib qr @scripts/a.txt -h 80
28
+ aib qr @scripts/b.py -o 300 -l 50
29
+ aib qr @logs/app.log -a
30
+
31
+ Use stdin for several reads.
@@ -0,0 +1,61 @@
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
+ If a name is ambiguous, use selectors.
6
+ Run help selectors to refresh selector syntax.
7
+
8
+ refactor batch runs related mutation requests together.
9
+ Use it when one workflow needs ordered steps, such as rename plus move.
10
+
11
+ Use modulePlan when the main intent is only to split one large file into target modules.
12
+ Use refactor batch when the split also includes coordinated renames or mixed mutation steps.
13
+
14
+ refactor batch preview --stdin
15
+ refactor batch execute --stdin
16
+ refactor batch apply --stdin
17
+
18
+ Use preview/apply when you want to inspect a large mixed plan before writing files.
19
+ Use execute when you want to write immediately.
20
+ Use --from with captured input handles when rerunning edited large batches.
21
+
22
+ Example: rename and move in one request
23
+
24
+ Run:
25
+ aib refactor batch execute --stdin
26
+
27
+ Input:
28
+ {
29
+ "sourceFile": "src/service.ts",
30
+ "requests": [
31
+ {
32
+ "op": "rename",
33
+ "renames": {
34
+ "oldHelper": "newHelper",
35
+ "oldType": "newType"
36
+ }
37
+ },
38
+ {
39
+ "op": "move",
40
+ "targetFile": "src/service.helpers.ts",
41
+ "entities": ["newHelper"]
42
+ },
43
+ {
44
+ "op": "move",
45
+ "targetFile": "src/service.types.ts",
46
+ "entities": ["newType"]
47
+ }
48
+ ]
49
+ }
50
+
51
+ If a large or partial refactor batch fails, edit the captured input file and rerun with --from.
52
+ For small one-off refactor requests, write a corrected request instead.
53
+
54
+ Latest refactor input:
55
+ <session-dir>/inputs/refactor/_last.json
56
+
57
+ Handle:
58
+ aib:input:refactor:last
59
+
60
+ Example:
61
+ refactor batch execute --from aib:input:refactor:last
@@ -0,0 +1,42 @@
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
+ If a name is ambiguous, use selectors.
6
+ Run help selectors to refresh selector syntax.
7
+
8
+ Rename is for semantic symbol renames.
9
+ It follows TypeScript references.
10
+ It is not plain-text replacement.
11
+
12
+ Single rename:
13
+ rename preview <file> <entity> <newName>
14
+ rename execute <file> <entity> <newName>
15
+ rename apply <previewId>
16
+
17
+ Use preview/apply when you want to inspect the planned change before writing files.
18
+ Use execute when you want to write immediately.
19
+
20
+ Run:
21
+ aib rename execute --stdin
22
+
23
+ Input:
24
+ {
25
+ "file": "src/service.ts",
26
+ "renames": {
27
+ "oldName": "newName",
28
+ "OldService": "NewService"
29
+ }
30
+ }
31
+
32
+ If a large rename request fails, edit the captured input file and rerun with --from.
33
+ For small one-off rename requests, write a corrected request instead.
34
+
35
+ Latest rename input:
36
+ <session-dir>/inputs/rename/_last.json
37
+
38
+ Handle:
39
+ aib:input:rename:last
40
+
41
+ Example:
42
+ rename preview --from aib:input:rename:last
@@ -0,0 +1,21 @@
1
+ Selectors identify symbols when names are ambiguous.
2
+ Use plain names when they are unambiguous.
3
+ Use selectors when aib reports ambiguity or when different symbol kinds share a name.
4
+
5
+ Example:
6
+ type WsOptions
7
+ class WsOptions
8
+
9
+ If aib needs the exact entity, use:
10
+ t-WsOptions
11
+ c-WsOptions
12
+
13
+ Selectors list:
14
+ f-name function
15
+ c-Name class
16
+ i-Name interface
17
+ t-Name type
18
+ v-name variable
19
+ e-Name enum
20
+ m-name method, usually with parent in JSON
21
+ p-name property, usually with parent in JSON
@@ -0,0 +1,59 @@
1
+ Start by creating or selecting your session.
2
+ Create it once, then reuse it.
3
+ Do not create a new session for every command or subtask.
4
+
5
+ Session stores captured inputs, saved outputs, aliases, and prefs.
6
+
7
+ Prefer short session names:
8
+ aa, tr, qa, a2
9
+
10
+ Create:
11
+ session init --name <name>
12
+
13
+ Follow the command output.
14
+ If aib says multiple sessions exist, use the session you created explicitly:
15
+ aib -s <name> <command>
16
+
17
+ Or bind this shell:
18
+ AIB=<name>
19
+
20
+ If you want to prune session inputs/outputs, use:
21
+ session clear
22
+
23
+ After clear, keep using the same session.
24
+
25
+ Check:
26
+ session status
27
+
28
+ Handles:
29
+ Commands may return handles for hidden output or reusable indexes.
30
+
31
+ Hidden output:
32
+ aib:res_<id>
33
+
34
+ Use view to fetch only the hidden part without repeating the original request:
35
+ aib view aib:res_<id>
36
+
37
+ Reusable indexes:
38
+ aib:usages:<name>
39
+ aib:graph:<name>
40
+
41
+ Usages and graph handles store computed indexes.
42
+ Use them with --from-file to focus or expand the saved result:
43
+
44
+ inspect usages --from-file aib:usages:service-usages --focus createService --detail code
45
+ inspect graph --from-file aib:graph:services-graph --focus src/service.ts
46
+
47
+ Escape hatch for latest mutation status/result:
48
+ aib execution status last
49
+
50
+ Prefs are stored in the session.
51
+ Use prefs when you want repeated CLI behavior without repeating request fields.
52
+
53
+ Set several prefs:
54
+ session prefs set inspect.graph.hubs false inspect.graph.leaves false
55
+
56
+ Show current overrides:
57
+ session prefs get
58
+
59
+ See help prefs for the full list.
@@ -0,0 +1,28 @@
1
+ AIB keeps large outputs compact.
2
+ When part of a result is hidden, output may include:
3
+
4
+ view: aib:res_<id>
5
+
6
+ Use view to fetch the hidden part without repeating what you already saw.
7
+
8
+ When a batch has several hidden results of the same kind, output may include:
9
+
10
+ view all code: aib:res_<id>
11
+ view all members: aib:res_<id>
12
+
13
+ A `view all` handle covers hidden parts from all results of that kind.
14
+
15
+ For code views, narrow what you fetch:
16
+ only show only these hidden code entities
17
+ except show all hidden code except these entities
18
+
19
+ Run:
20
+ aib view --stdin
21
+
22
+ Input:
23
+ view aib:res_<id_1> only=[ClassA.{bigA,bigB},bigQ,ClassB.bigB]
24
+ view aib:res_<id_2> except=[ClassC.bigC]
25
+
26
+ Inline:
27
+ aib view aib:res_<id_1> --only bigQ --only "ClassA.{bigA,bigB}"
28
+ aib view aib:res_<id_2> --except ClassB.bigB --except ClassC.bigC
@@ -0,0 +1,14 @@
1
+ Recommended:
2
+ For TS/JS code work, use aib. Start with {{docsPath}}.
3
+
4
+ Strict:
5
+ For TS/JS code work in this repo, prefer aib before broad file reads. Start with {{docsPath}}.
6
+
7
+ Minimal:
8
+ Use {{docsPath}} when working with TS/JS code.
9
+
10
+ Help fallback:
11
+ For TS/JS code work, use aib. Start with {{docsPath}}. If local docs are not enough, run `aib help bootstrap`.
12
+
13
+ Refactor-focused:
14
+ When changing TS/JS code, use aib for semantic discovery, usages, graph, rename, move, and modulePlan. Start with {{docsPath}}.
@@ -0,0 +1,12 @@
1
+ Use the active session while you work.
2
+
3
+ Examples are patterns, not limits.
4
+ Feature sections show common high-value uses, not every valid use.
5
+ Adapt requests to the task: combine features, batch related questions, and skip steps when you already have enough context.
6
+
7
+ Prefer batch DSL instead of one-off inline calls.
8
+ One request can inspect/mutate several files/entities and save reusable artifacts when supported.
9
+ Use one-off commands only for small checks/changes.
10
+
11
+ For mutations, aib asks TS/IDE refactors to update affected references and imports.
12
+ After a successful mutation, do not manually patch the same imports unless aib reports a follow-up or the build/checks show a real issue.
@@ -0,0 +1,23 @@
1
+ DSL request model:
2
+ - directives set defaults for following requests
3
+ - each request line can override defaults with key=value
4
+ - +flag means true
5
+ - -flag means false
6
+ - file/imports/exports/members/code/deps accept a path as the first positional argument; examples below use this shape.
7
+ - Use @file when several following operations share the same file.
8
+ - For one-off file operations, pass the path directly.
9
+
10
+ Syntax:
11
+ @file <path> default file
12
+ @source <path> default sourceFile for mutations
13
+ op arg arg key=value request
14
+ +flag boolean true
15
+ -flag boolean false
16
+ >name save reusable artifact when supported
17
+ old->new rename pair
18
+ Parent.member parent-qualified member
19
+ Parent.{a,b} several members under one parent
20
+ key=[a,b] list value for repeatable fields
21
+ file="path with spaces.ts" quote values with spaces
22
+ detail=sum|loc|code aliases for summary|locations|code
23
+ from=... alias for fromFile
@@ -0,0 +1,10 @@
1
+ Inline commands below omit the aib prefix.
2
+ Run them as: aib <command>
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