@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,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,13 @@
1
+ Use the active session while you work.
2
+ Reuse captured inputs when editing them is cheaper than rebuilding large JSON.
3
+
4
+ Examples are patterns, not limits.
5
+ Feature sections show common high-value uses, not every valid use.
6
+ Adapt requests to the task: combine features, batch related questions, and skip steps when you already have enough context.
7
+
8
+ Prefer batch JSON instead of inline calls.
9
+ One request can inspect/mutate several files/entities and save reusable outputs.
10
+ Use one-off commands only for small checks/changes.
11
+
12
+ For mutations, aib asks TS/IDE refactors to update affected references and imports.
13
+ 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
@@ -0,0 +1,45 @@
1
+ Use imports normalize for explicit import-style cleanup.
2
+ It rewrites resolved local import/export specifiers inside a chosen file or directory.
3
+
4
+ Use importNormalize in aib.json for repeated defaults.
5
+
6
+ Good for:
7
+ - converting one area to aliases or relative imports
8
+ - cleaning import style after manual edits or broad refactors
9
+ - applying the same import style to a directory without hand-editing files
10
+ - applying new tsconfig aliases after they are added
11
+
12
+ Controls:
13
+ scope file/dir scope to normalize
14
+ to relative|alias|shortestAlias
15
+ preferAlias select one tsconfig paths pattern when several aliases can resolve the same file
16
+ exclude files, directories, or glob-like patterns to skip
17
+ all show all planned edits; avoid on broad directory scopes
18
+
19
+ Run:
20
+ aib imports normalize preview --stdin
21
+
22
+ Input:
23
+ {
24
+ "scope": "src/services",
25
+ "to": "shortestAlias",
26
+ "exclude": ["src/services/generated", "**/* copy.ts"]
27
+ }
28
+
29
+ Rewrite imports found inside src/core.
30
+ When an imported file can be expressed through @features/*, prefer that alias.
31
+
32
+ Run:
33
+ aib imports normalize preview --stdin
34
+
35
+ Input:
36
+ {
37
+ "scope": "src/core",
38
+ "to": "alias",
39
+ "preferAlias": "@features/*"
40
+ }
41
+
42
+ With matching importNormalize config for this scope or a parent scope, use inline CLI commands:
43
+
44
+ imports normalize preview @svc
45
+ imports normalize execute @svc
@@ -0,0 +1,39 @@
1
+ Use code to fetch exact declarations or members.
2
+ It returns focused code without reading the whole file.
3
+
4
+ Good for:
5
+ - reading a known function, class, method, or declaration
6
+ - fetching several related code blocks in one request
7
+ - keeping context focused on code needed for the current task
8
+
9
+ Controls:
10
+ file, entity, entities, parent, show, ranges
11
+
12
+ Specific:
13
+ show include source output
14
+
15
+ Defaults: +show +ranges
16
+ Use -show for names/ranges only.
17
+ Use -ranges for source without ranges.
18
+
19
+ Prefs:
20
+ inspect.code.maxNonEmptyLines
21
+
22
+ Run:
23
+ aib inspect --stdin
24
+
25
+ Input:
26
+ {
27
+ "file": "src/service.ts",
28
+ "op": "code",
29
+ "requests": [
30
+ {
31
+ "entities": [
32
+ { "parent": "Service", "entities": ["render", "reset"] },
33
+ "normalize"
34
+ ],
35
+ "show": true,
36
+ "save": "service-focus"
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,44 @@
1
+ Use deps to see what one entity depends on inside its file.
2
+ It separates type-only dependencies from runtime value dependencies.
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
8
+ - debugging mutation failures caused by local dependency shape
9
+
10
+ Controls:
11
+ file, entity, entities, parent
12
+
13
+ Run:
14
+ aib inspect --stdin
15
+
16
+ Input:
17
+ {
18
+ "file": "src/service.ts",
19
+ "op": "deps",
20
+ "requests": [
21
+ { "entity": "createService" },
22
+ {
23
+ "entities": [
24
+ { "parent": "Service", "entities": ["render", "reset"] }
25
+ ]
26
+ }
27
+ ]
28
+ }
29
+
30
+ inspect deps src/service.ts Service
31
+
32
+ Batch several symbols when you are planning a move:
33
+ Run:
34
+ aib inspect --stdin
35
+
36
+ Input:
37
+ {
38
+ "file": "src/service.ts",
39
+ "requests": [
40
+ { "op": "deps", "entity": "Service" },
41
+ { "op": "deps", "entity": "ServiceOptions" },
42
+ { "op": "deps", "entity": "createService" }
43
+ ]
44
+ }
@@ -0,0 +1,37 @@
1
+ Use duplicates to find repeated top-level names and exact declaration copies.
2
+ It is useful when many files may contain copied local helpers, duplicated types, or repeated declarations.
3
+
4
+ Start with summary for broad scopes.
5
+ Use locations when you need files/lines.
6
+ Use code only for duplicate names you are ready to inspect.
7
+
8
+ Controls:
9
+ scope, detail, limit, offset, kinds, entities, exclude, pathExclude
10
+
11
+ Specific:
12
+ entities only these duplicate names/selectors
13
+ exclude skip these names/selectors
14
+ pathExclude skip files or path/glob-like patterns
15
+ kinds selector kinds, e.g. f, t, c, etc.; kinds=[...]
16
+
17
+ Summary scan:
18
+ Run:
19
+ aib inspect --stdin
20
+
21
+ Input:
22
+ {
23
+ "scope": "src",
24
+ "detail": "summary",
25
+ "limit": 20
26
+ }
27
+
28
+ Inspect specific duplicate code:
29
+ Run:
30
+ aib inspect --stdin
31
+
32
+ Input:
33
+ {
34
+ "scope": "src",
35
+ "detail": "code",
36
+ "entities": ["getBoolean", "WsOptions"]
37
+ }
@@ -0,0 +1,38 @@
1
+ Use exports to see the public API of one file.
2
+ It answers what other files can import from that file.
3
+
4
+ Important:
5
+ inspect.file marks exported declarations already.
6
+
7
+ Do not batch this for a plain implementation file:
8
+ file src/service.ts
9
+ exports src/service.ts
10
+
11
+ Use exports when you need public module surface, barrels, re-exports, export *, or resolveStar.
12
+
13
+ Good for:
14
+ - checking a module boundary or public surface
15
+ - understanding facade/barrel files
16
+ - resolving export * when the local file only re-exports from elsewhere
17
+ - comparing API shape when public imports matter
18
+
19
+ Controls:
20
+ file, ranges, resolveStar
21
+
22
+ Specific:
23
+ resolveStar resolve export * through re-exported modules; +resolveStar
24
+
25
+ Run:
26
+ aib inspect --stdin
27
+
28
+ Input:
29
+ {
30
+ "op": "exports",
31
+ "file": "src/service.ts",
32
+ "requests": [
33
+ { "ranges": true },
34
+ { "file": "src/index.ts", "resolveStar": true }
35
+ ]
36
+ }
37
+
38
+ inspect exports src/service.ts [--ranges] [--resolve-star]
@@ -0,0 +1,36 @@
1
+ Use file to map top-level declarations physically present in one file.
2
+ Exported declarations are marked in the output.
3
+ It shows what lives in the file before you decide whether to read code.
4
+
5
+ Good for:
6
+ - mapping an unfamiliar file
7
+ - listing top-level declarations
8
+ - checking whether a file contains real declarations or mostly re-exports
9
+
10
+ Do not add limit just in case.
11
+ file output is compact and most files have far fewer than 100 top-level declarations.
12
+ Use limit only after file output is actually too large.
13
+
14
+ Controls:
15
+ file, ranges, localOnly
16
+
17
+ Specific:
18
+ localOnly show local declarations and reexports without resolving facade API; +localOnly
19
+
20
+ Defaults: +ranges
21
+ Use -ranges to show names without ranges.
22
+
23
+ Run:
24
+ aib inspect --stdin
25
+
26
+ Input:
27
+ {
28
+ "op": "file",
29
+ "file": "src/service.ts",
30
+ "requests": [
31
+ { "ranges": true },
32
+ { "file": "src/index.ts", "localOnly": true }
33
+ ]
34
+ }
35
+
36
+ inspect file src/service.ts [--ranges] [--local-only]
@@ -0,0 +1,137 @@
1
+ Use graph when the question is about file/module boundaries, not one symbol.
2
+ It builds a reusable map of local import relationships, then lets you focus files inside that map.
3
+
4
+ Good for:
5
+ - mapping an unfamiliar directory or subsystem
6
+ - seeing which files are hubs, entrypoints, or leaves
7
+ - comparing a few known areas without mapping all src
8
+ - choosing files/entities to inspect next
9
+ - checking module boundaries when ownership is unclear
10
+
11
+ Use deps for one entity's outgoing dependencies.
12
+ Use usages for real incoming references.
13
+ Use graph for file-level connectivity.
14
+
15
+ Model:
16
+ build graph: scope + view + save
17
+ query graph: fromFile + focus + output toggles
18
+
19
+ view controls what enters the saved graph.
20
+ focus only expands details for files already inside it.
21
+ If focus misses a file, rebuild with wider scope or view.
22
+
23
+ Default view:
24
+ directory scope -> local
25
+ file or multiple scopes -> neighbors
26
+ fromFile -> uses the saved graph
27
+
28
+ Views:
29
+ local only files inside scope; best directory map
30
+ neighbors direct import neighborhood; best file-centered map
31
+ expanded wider neighborhood; more output
32
+
33
+ Scope choice:
34
+ scope: "src" creates a broad reusable map for src.
35
+ scope: "src/services" is cheaper for local work.
36
+ scope: [...] compares known areas without mapping all src.
37
+
38
+ After you understand which graph sections matter, hide the rest with JSON fields or prefs.
39
+ Graph can be noisy; shape it for the current task.
40
+
41
+ Controls:
42
+ scope, view, from, focus, symbolUsage, edges, hubs, entrypoints, leaves, exclude, save
43
+
44
+ Specific:
45
+ view local|neighbors|expanded
46
+ from reuse saved graph index; from=aib:graph:<name>
47
+ focus focus a file inside the graph; focus=path
48
+ symbolUsage show imported symbols on edges; +symbolUsage
49
+
50
+ edges/hubs/entrypoints/leaves output section toggles; +name or -name
51
+
52
+ Run:
53
+ aib inspect --stdin
54
+
55
+ Input:
56
+ {
57
+ "op": "graph",
58
+ "requests": [
59
+ {
60
+ "scope": "src/services",
61
+ "view": "local",
62
+ "save": "services-graph"
63
+ },
64
+ {
65
+ "fromFile": "aib:graph:services-graph",
66
+ "focus": ["src/services/users.ts", "src/services/admins.ts"],
67
+ "symbolUsage": true,
68
+ "edges": false
69
+ }
70
+ ]
71
+ }
72
+
73
+ Focus saved graph later:
74
+ inspect graph --from-file aib:graph:services-graph --focus src/services/messages.ts --focus src/services/posts.ts --symbol-usage
75
+
76
+ Inline graph focus can add focus and symbolUsage.
77
+ Inline cannot hide graph sections such as edges/hubs/entrypoints/leaves.
78
+ Use JSON request fields or prefs for section control.
79
+
80
+ Specialized graph command:
81
+ Run:
82
+ aib inspect graph --stdin
83
+
84
+ Input:
85
+ {
86
+ "requests": [
87
+ {
88
+ "scope": "src/services",
89
+ "view": "local",
90
+ "save": "services-graph"
91
+ },
92
+ {
93
+ "fromFile": "aib:graph:services-graph",
94
+ "focus": ["src/services/users.ts", "src/services/admins.ts"],
95
+ "symbolUsage": true,
96
+ "edges": false
97
+ }
98
+ ]
99
+ }
100
+
101
+ Multiple scopes:
102
+ Run:
103
+ aib inspect --stdin
104
+
105
+ Input:
106
+ {
107
+ "op": "graph",
108
+ "scope": ["src/main/server", "src/services/ws"],
109
+ "view": "local",
110
+ "save": "server-ws-graph"
111
+ }
112
+
113
+ scope accepts one file/dir or an array.
114
+ scopes is accepted as an alias for multiple scopes.
115
+
116
+ Graph prefs:
117
+ inspect.graph.edges boolean
118
+ inspect.graph.hubs boolean
119
+ inspect.graph.entrypoints boolean
120
+ inspect.graph.leaves boolean
121
+ inspect.graph.symbols boolean
122
+ inspect.graph.symbolUsage boolean
123
+
124
+ symbolUsage is usually the better first choice when imported names matter.
125
+
126
+ Example:
127
+ session prefs set inspect.graph.edges false inspect.graph.hubs false inspect.graph.symbolUsage true
128
+
129
+ Output fields:
130
+ summary file/edge/package counts
131
+ paths compact path aliases used in text output
132
+ focus selected files with imports/importedBy
133
+ hubs highly connected files
134
+ entrypoints scoped files imported by nobody in graph
135
+ leaves scoped files importing nobody in graph
136
+ edges local file-to-file imports
137
+ saved reusable aib:graph handle
@@ -0,0 +1,13 @@
1
+ Use imports to inspect static and dynamic imports in a file.
2
+ If there are no dynamic imports, the dynamic imports block is omitted.
3
+
4
+ Controls:
5
+ file, ranges
6
+
7
+ Defaults: +ranges
8
+
9
+ Run:
10
+ aib inspect --stdin
11
+
12
+ Input:
13
+ imports @svc/service.ts
@@ -0,0 +1,85 @@
1
+ Inspect helps you turn an unknown code area into a small working model.
2
+
3
+ Use it to understand what exists, how pieces connect, what repeats, where a change can spread, and which exact code should enter context next.
4
+
5
+ One useful flow:
6
+ map -> focus -> code
7
+
8
+ map: learn what exists and how it connects
9
+ focus: choose files/entities/usages that matter
10
+ code: fetch exact code needed
11
+
12
+ Choose inspect operation:
13
+
14
+ declarations in one file file
15
+ static/dynamic imports imports
16
+ public API exports
17
+ methods/properties of parent members
18
+ exact implementation code
19
+ outgoing deps of one entity deps
20
+ incoming references/callers usages
21
+ file/module connectivity graph
22
+ compact directory layout tree
23
+ repeated declarations/helpers duplicates
24
+
25
+ Prefer one batch JSON request for related questions.
26
+ Top-level fields are defaults for every request.
27
+ A request without op uses the top-level op.
28
+ A request without file/scope/target uses the top-level value when applicable.
29
+ Each request may override any default.
30
+
31
+ Batch example:
32
+
33
+ Run:
34
+ aib inspect --stdin
35
+
36
+ Input:
37
+ {
38
+ "file": "src/service.ts",
39
+ "requests": [
40
+ { "op": "file" },
41
+ { "op": "members", "entity": "Service" },
42
+ {
43
+ "op": "code",
44
+ "entities": [
45
+ { "parent": "Service", "entities": ["render", "reset"] },
46
+ "normalize"
47
+ ],
48
+ "show": true,
49
+ "save": "service-focus"
50
+ },
51
+ {
52
+ "op": "usages",
53
+ "target": "src/service.ts",
54
+ "entity": "normalize",
55
+ "scope": "src",
56
+ "detail": "locations"
57
+ },
58
+ {
59
+ "op": "duplicates",
60
+ "scope": "src/scripts",
61
+ "detail": "summary",
62
+ "limit": 20
63
+ }
64
+ ]
65
+ }
66
+
67
+ Inspect controls:
68
+
69
+ file default file for requests
70
+ target file, dir, or symbol area to analyze
71
+ scope where to search; JSON scope:string|string[]
72
+ entity one symbol
73
+ entities several target symbols; JSON entities:[...]
74
+ parent class/interface parent for methods/properties
75
+ ranges include line/range metadata; JSON ranges:boolean; CLI --ranges
76
+ localOnly show local declarations and reexports without resolving facade API; JSON localOnly:boolean; CLI --local-only
77
+ resolveStar resolve export * through re-exported modules; JSON resolveStar:boolean; CLI --resolve-star
78
+ limit max items in one page; JSON limit:N; CLI --limit N
79
+ offset page offset; JSON offset:N; CLI --offset N
80
+ all return all items; JSON all:boolean; CLI --all
81
+ detail output level; JSON detail:summary|locations|code; CLI --detail summary|locations|code
82
+ show include code output; JSON show:boolean; CLI --show
83
+ save save reusable output; JSON save:"name"; CLI --save name
84
+ exclude skip names/selectors; JSON exclude:[...]
85
+ kinds restrict selector kinds; JSON kinds:["f","t"]
@@ -0,0 +1,30 @@
1
+ Use members to map a class/interface/object-like symbol without reading its body.
2
+ It shows the internal shape of a parent entity without reading its full body.
3
+
4
+ Good for:
5
+ - listing member names when the parent entity is known
6
+ - narrowing a large parent entity to relevant members
7
+ - understanding object shape before changing or moving related code
8
+
9
+ Controls:
10
+ file, entity, entities, ranges, limit, offset, all
11
+
12
+ Prefs:
13
+ inspect.members.maxItems
14
+ inspect.members.all
15
+
16
+ Run:
17
+ aib inspect --stdin
18
+
19
+ Input:
20
+ {
21
+ "file": "src/service.ts",
22
+ "op": "members",
23
+ "limit": 12,
24
+ "requests": [
25
+ { "entity": "Service" },
26
+ { "entities": ["ServiceOptions", "WsOptions"], "all": true }
27
+ ]
28
+ }
29
+
30
+ inspect members src/service.ts Service [--limit N] [--offset N] [--all] [--ranges]
@@ -0,0 +1,20 @@
1
+ Use tree to list a compact directory layout.
2
+ It is useful before focused inspect when you know the area but not the exact file.
3
+
4
+ node_modules, .git, dist, build, out, and .tmp are skipped by default.
5
+
6
+ Controls:
7
+ scope, depth, minDepth, limit, include, exclude, onlyDirs
8
+
9
+ Specific:
10
+ depth max nesting depth; depth=N
11
+ minDepth hide shallower paths; minDepth=N
12
+ onlyDirs show directories only; +onlyDirs
13
+ include only matching files/dirs; include=[...]
14
+
15
+ Run:
16
+ aib inspect --stdin
17
+
18
+ Input:
19
+ tree src depth=4 +onlyDirs limit=200
20
+ tree @svc depth=3 include=["**/*.ts"] exclude=["**/*.test.ts","**/* copy.ts"]
@@ -0,0 +1,59 @@
1
+ Use usages to find who references a file, directory, or entity inside a scope.
2
+ It reports real references, not unused imports or text matches.
3
+ For broad impact checks, target-local usages are hidden automatically when the target is inside a wider scope.
4
+ Use includeTarget only when references inside the target file or directory matter.
5
+
6
+ Good for:
7
+ - checking impact before changing behavior
8
+ - finding consumers of an entity or module area
9
+ - confirming whether extracted or renamed code still has callers
10
+ - getting caller locations or caller code without broad file scans
11
+
12
+ Use locations for broad impact checks.
13
+ Use code when usage count is small or caller context matters now.
14
+
15
+ Controls:
16
+ target, scope, entity, entities, parent, detail, limit, all, save, includeTarget
17
+
18
+ Specific:
19
+ includeTarget include references inside the target file/directory; +includeTarget
20
+
21
+ Prefs:
22
+ inspect.usages.maxLocations
23
+ inspect.usages.maxCodeBlocks
24
+
25
+ Run:
26
+ aib inspect --stdin
27
+
28
+ Input:
29
+ {
30
+ "op": "usages",
31
+ "target": "src/service.ts",
32
+ "entities": [
33
+ "createService",
34
+ { "parent": "Service", "entities": ["render", "reset"] }
35
+ ],
36
+ "scope": ["src/app", "src/tests"],
37
+ "detail": "locations",
38
+ "save": "service-usages"
39
+ }
40
+
41
+ inspect usages src/service.ts createService --scope src --detail locations [--limit N] [--all] [--save name]
42
+
43
+ Expand saved usages by focusing the reusable usages index:
44
+ inspect usages --from-file aib:usages:service-usages --focus createService --detail code
45
+
46
+ Use the saved usages handle with --from-file/from to focus or expand the reusable index.
47
+
48
+ Directory target:
49
+ Run:
50
+ aib inspect --stdin
51
+
52
+ Input:
53
+ {
54
+ "op": "usages",
55
+ "target": "src/shared",
56
+ "scope": ["src/app", "src/renderer"],
57
+ "detail": "summary",
58
+ "save": "shared-usages"
59
+ }