@automaton-labs/aib 0.0.4 → 0.0.6

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 (136) hide show
  1. package/dist/bin/cli.js +2 -2
  2. package/dist/commands/config-command.js +2 -1
  3. package/dist/commands/config-output.js +10 -8
  4. package/dist/commands/doctor.js +2 -1
  5. package/dist/commands/help-command.js +7 -3
  6. package/dist/commands/inspect-format.js +1 -1
  7. package/dist/commands/quick-read.js +8 -8
  8. package/dist/commands/result-view.js +5 -5
  9. package/dist/commands/session-workspace.js +8 -8
  10. package/dist/config/workspace-root.js +3 -3
  11. package/dist/help/bootstrap.md +92 -91
  12. package/dist/help/docs/config-setup.aliases.md +56 -0
  13. package/dist/help/docs/config-setup.excludes.md +45 -0
  14. package/dist/help/docs/config-setup.import-normalize.md +86 -0
  15. package/dist/help/docs/config-setup.import-rules.md +96 -0
  16. package/dist/help/docs/config-setup.tsconfigs.md +33 -0
  17. package/dist/help/docs/first-setup.md +63 -48
  18. package/dist/help/docs/help-format.md +4 -7
  19. package/dist/help/docs/help-protocol.md +26 -0
  20. package/dist/help/docs/inspect.cycles.md +38 -0
  21. package/dist/help/docs/inspect.md +1 -0
  22. package/dist/help/docs/modulePlan.md +3 -0
  23. package/dist/help/docs/move.md +3 -0
  24. package/dist/help/docs/mutation.md +3 -0
  25. package/dist/help/docs/patterns.md +7 -118
  26. package/dist/help/docs/qr.md +6 -2
  27. package/dist/help/docs/quick-map.md +30 -0
  28. package/dist/help/docs/reveal.md +30 -0
  29. package/dist/help/dsl/bootstrap.md +92 -91
  30. package/dist/help/dsl/docs/config-setup.aliases.md +56 -0
  31. package/dist/help/dsl/docs/config-setup.excludes.md +45 -0
  32. package/dist/help/dsl/docs/config-setup.import-normalize.md +86 -0
  33. package/dist/help/dsl/docs/config-setup.import-rules.md +96 -0
  34. package/dist/help/dsl/docs/config-setup.tsconfigs.md +33 -0
  35. package/dist/help/dsl/docs/first-setup.md +63 -48
  36. package/dist/help/dsl/docs/help-format.md +4 -7
  37. package/dist/help/dsl/docs/help-protocol.md +26 -0
  38. package/dist/help/dsl/docs/inspect.cycles.md +38 -0
  39. package/dist/help/dsl/docs/inspect.md +1 -0
  40. package/dist/help/dsl/docs/modulePlan.md +3 -0
  41. package/dist/help/dsl/docs/move.md +3 -0
  42. package/dist/help/dsl/docs/mutation.md +3 -0
  43. package/dist/help/dsl/docs/patterns.md +7 -118
  44. package/dist/help/dsl/docs/qr.md +6 -2
  45. package/dist/help/dsl/docs/quick-map.md +30 -0
  46. package/dist/help/dsl/docs/reveal.md +30 -0
  47. package/dist/help/dsl/full.md +92 -91
  48. package/dist/help/dsl/topics/config-setup.aliases.md +54 -0
  49. package/dist/help/dsl/topics/config-setup.excludes.md +43 -0
  50. package/dist/help/dsl/topics/config-setup.import-normalize.md +84 -0
  51. package/dist/help/dsl/topics/config-setup.import-rules.md +94 -0
  52. package/dist/help/dsl/topics/config-setup.tsconfigs.md +31 -0
  53. package/dist/help/dsl/topics/first-setup.md +63 -48
  54. package/dist/help/dsl/topics/help-format.md +4 -7
  55. package/dist/help/dsl/topics/help-protocol.md +24 -0
  56. package/dist/help/dsl/topics/inspect.cycles.md +36 -0
  57. package/dist/help/dsl/topics/inspect.md +1 -0
  58. package/dist/help/dsl/topics/modulePlan.md +3 -0
  59. package/dist/help/dsl/topics/move.md +3 -0
  60. package/dist/help/dsl/topics/mutation.md +3 -0
  61. package/dist/help/dsl/topics/patterns.md +7 -118
  62. package/dist/help/dsl/topics/qr.md +6 -2
  63. package/dist/help/dsl/topics/quick-map.md +28 -0
  64. package/dist/help/dsl/topics/reveal.md +28 -0
  65. package/dist/help/full.md +92 -91
  66. package/dist/help/help-meta.json +55 -19
  67. package/dist/help/index.md +54 -0
  68. package/dist/help/json/bootstrap.md +92 -91
  69. package/dist/help/json/docs/config-setup.aliases.md +56 -0
  70. package/dist/help/json/docs/config-setup.excludes.md +45 -0
  71. package/dist/help/json/docs/config-setup.import-normalize.md +86 -0
  72. package/dist/help/json/docs/config-setup.import-rules.md +96 -0
  73. package/dist/help/json/docs/config-setup.tsconfigs.md +33 -0
  74. package/dist/help/json/docs/first-setup.md +63 -48
  75. package/dist/help/json/docs/help-format.md +4 -7
  76. package/dist/help/json/docs/help-protocol.md +26 -0
  77. package/dist/help/json/docs/inspect.cycles.md +38 -0
  78. package/dist/help/json/docs/inspect.md +1 -0
  79. package/dist/help/json/docs/modulePlan.md +3 -0
  80. package/dist/help/json/docs/move.md +3 -0
  81. package/dist/help/json/docs/mutation.md +3 -0
  82. package/dist/help/json/docs/patterns.md +7 -118
  83. package/dist/help/json/docs/qr.md +6 -2
  84. package/dist/help/json/docs/quick-map.md +30 -0
  85. package/dist/help/json/docs/reveal.md +30 -0
  86. package/dist/help/json/full.md +92 -91
  87. package/dist/help/json/topics/config-setup.aliases.md +54 -0
  88. package/dist/help/json/topics/config-setup.excludes.md +43 -0
  89. package/dist/help/json/topics/config-setup.import-normalize.md +84 -0
  90. package/dist/help/json/topics/config-setup.import-rules.md +94 -0
  91. package/dist/help/json/topics/config-setup.tsconfigs.md +31 -0
  92. package/dist/help/json/topics/first-setup.md +63 -48
  93. package/dist/help/json/topics/help-format.md +4 -7
  94. package/dist/help/json/topics/help-protocol.md +24 -0
  95. package/dist/help/json/topics/inspect.cycles.md +36 -0
  96. package/dist/help/json/topics/inspect.md +1 -0
  97. package/dist/help/json/topics/modulePlan.md +3 -0
  98. package/dist/help/json/topics/move.md +3 -0
  99. package/dist/help/json/topics/mutation.md +3 -0
  100. package/dist/help/json/topics/patterns.md +7 -118
  101. package/dist/help/json/topics/qr.md +6 -2
  102. package/dist/help/json/topics/quick-map.md +28 -0
  103. package/dist/help/json/topics/reveal.md +28 -0
  104. package/dist/help/topics/config-setup.aliases.md +54 -0
  105. package/dist/help/topics/config-setup.excludes.md +43 -0
  106. package/dist/help/topics/config-setup.import-normalize.md +84 -0
  107. package/dist/help/topics/config-setup.import-rules.md +94 -0
  108. package/dist/help/topics/config-setup.tsconfigs.md +31 -0
  109. package/dist/help/topics/first-setup.md +63 -48
  110. package/dist/help/topics/help-format.md +4 -7
  111. package/dist/help/topics/help-protocol.md +24 -0
  112. package/dist/help/topics/inspect.cycles.md +36 -0
  113. package/dist/help/topics/inspect.md +1 -0
  114. package/dist/help/topics/modulePlan.md +3 -0
  115. package/dist/help/topics/move.md +3 -0
  116. package/dist/help/topics/mutation.md +3 -0
  117. package/dist/help/topics/patterns.md +7 -118
  118. package/dist/help/topics/qr.md +6 -2
  119. package/dist/help/topics/quick-map.md +28 -0
  120. package/dist/help/topics/reveal.md +28 -0
  121. package/dist/managed-host/serve-web-autostart.js +1 -1
  122. package/dist/managed-host/serve-web-host.cjs +193 -79
  123. package/dist/observability/config.js +1 -1
  124. package/dist/payloads/read-stdin-json.js +1 -1
  125. package/dist/runtime/managed-runtime-provisioning.js +1 -1
  126. package/dist/runtime/run-command.js +1 -1
  127. package/dist/session/server.js +7 -5
  128. package/dist/shared/diagnostic-catalog.js +1 -1
  129. package/dist/shared/errors.js +17 -15
  130. package/dist/shared/stdin-examples.js +3 -0
  131. package/dist/tracing/trace.js +5 -3
  132. package/extension/vscode-refactor-bridge-extension.vsix +0 -0
  133. package/package.json +1 -1
  134. package/runtimes/launcher/linux-x64/aib +0 -0
  135. package/runtimes/launcher/win-x64/aib.exe +0 -0
  136. package/scripts/provision-runtime.cjs +25 -1
@@ -0,0 +1,84 @@
1
+ Configure import normalization intent.
2
+
3
+ importNormalize defines default normalization rules for explicit aib imports normalize commands.
4
+ Use it before broad or important import cleanup so the scope, target style, preferred alias, and excludes are stored in aib.json instead of repeated in command arguments.
5
+
6
+ It does not run automatically during move/modulePlan.
7
+ Use importRules for mutation-time import cleanup.
8
+
9
+ Set importNormalize when the intended cleanup has project meaning:
10
+ - adopting a new tsconfig alias across a project area;
11
+ - converting an area to aliases;
12
+ - converting scripts/tools or extracted modules to relative imports;
13
+ - excluding generated or bundled output from normalization.
14
+
15
+ For tiny one-file checks, inline options are fine.
16
+ Before wider cleanup, put the intended rule in config and preview the smallest useful scope.
17
+
18
+ Fields:
19
+ scope repo-relative file or directory scope; most specific scope wins
20
+ to relative|alias|shortestAlias
21
+ preferAlias tsconfig paths pattern used when to=alias
22
+ exclude files, directories, or glob-like patterns to skip
23
+
24
+ to:
25
+ relative rewrite resolved local imports to relative paths
26
+ alias rewrite resolved local imports to a matching tsconfig alias
27
+ shortestAlias rewrite to the shortest valid alias specifier
28
+
29
+ preferAlias:
30
+ @shared/* prefer one alias pattern when several aliases can resolve the same file
31
+
32
+ Alias cleanup:
33
+
34
+ "importNormalize": [
35
+ {
36
+ "scope": "src",
37
+ "to": "shortestAlias",
38
+ "preferAlias": "@/*",
39
+ "exclude": [
40
+ "src/generated",
41
+ "src/**/dist"
42
+ ]
43
+ }
44
+ ]
45
+
46
+ Relative cleanup for scripts/tools:
47
+
48
+ "importNormalize": [
49
+ {
50
+ "scope": "scripts",
51
+ "to": "relative",
52
+ "exclude": [
53
+ "scripts/**/*.cjs",
54
+ "scripts/**/*.mjs"
55
+ ]
56
+ }
57
+ ]
58
+
59
+ If you have not just checked config rules, run:
60
+
61
+ aib config rules
62
+
63
+ After editing aib.json, run:
64
+
65
+ aib sync
66
+
67
+ Then preview the smallest useful scope before applying:
68
+
69
+ aib imports normalize preview <scope>
70
+
71
+ Preview shows counts, sample import rewrites, a planId, and the apply command.
72
+ It does not change project files.
73
+
74
+ If preview changes imports outside the intended area, narrow scope or add exclude.
75
+
76
+ If preview does not use the expected alias, check tsconfig aliases:
77
+
78
+ aib reveal tsaliases
79
+
80
+ If the config and aliases look correct but preview still looks stale or strange, run:
81
+
82
+ aib sync
83
+
84
+ Then preview again.
@@ -0,0 +1,94 @@
1
+ Use this when move/modulePlan creates imports that do not match the repository style.
2
+
3
+ Do not keep fixing the same generated import style by hand.
4
+ Tune importRules, sync config, then retry the smallest useful mutation before continuing larger mutation work.
5
+
6
+ Check current config:
7
+
8
+ aib config rules
9
+
10
+ importRules control imports created or expanded by move/modulePlan mutation cleanup.
11
+ They do not rewrite the whole project.
12
+
13
+ AIB starts from IDE/TS import preferences.
14
+ For mutation cleanup, matching importRules in aib.json take priority.
15
+ Do not assume IDE/TS defaults match the repo style.
16
+
17
+ Fields:
18
+ scope repo-relative file or directory scope; most specific scope wins
19
+ specifier relative|shortest|project-relative|non-relative
20
+ ending auto|minimal|index|js
21
+ builtin node|bare
22
+ unusedImports remove|preserve
23
+
24
+ Defaults:
25
+ specifier omitted IDE/TS decides
26
+ ending omitted IDE/TS decides
27
+ builtin omitted keep TS/project builtin style
28
+ unusedImports omitted keep unused imports
29
+
30
+ specifier:
31
+ relative best for local relative imports
32
+ shortest best for shortest valid alias/path output
33
+ project-relative best for root-relative project imports
34
+ non-relative best for package or alias imports
35
+
36
+ ending:
37
+ minimal best for extensionless TS imports
38
+ js best for ESM-style TS projects that require .js
39
+ auto leaves the decision to TypeScript
40
+ index best for explicit index import style
41
+
42
+ builtin:
43
+ node path -> node:path; best for explicit Node builtin imports
44
+ bare node:path -> path; best for bare Node builtin imports
45
+ omit field keeps TypeScript/project output; add builtin if agents keep fixing this manually
46
+
47
+ unusedImports:
48
+ remove clean unused imports in mutation-touched files
49
+ preserve keep unused imports
50
+ omit same as preserve
51
+
52
+ Mutation-touched files are files where TS produced edits: source/target files and any reference/update files TS changed.
53
+ Recommended value: remove
54
+
55
+ If the repository has one import style, use one broad rule:
56
+
57
+ "importRules": [
58
+ {
59
+ "scope": ".",
60
+ "specifier": "shortest",
61
+ "ending": "auto",
62
+ "builtin": "node",
63
+ "unusedImports": "remove"
64
+ }
65
+ ]
66
+
67
+ Use scoped rules only when areas differ by style, for example packages use aliases but scripts use relative imports:
68
+
69
+ "importRules": [
70
+ {
71
+ "scope": "packages",
72
+ "specifier": "shortest",
73
+ "ending": "auto",
74
+ "builtin": "node",
75
+ "unusedImports": "remove"
76
+ },
77
+ {
78
+ "scope": "scripts",
79
+ "specifier": "relative",
80
+ "ending": "auto",
81
+ "builtin": "node",
82
+ "unusedImports": "remove"
83
+ }
84
+ ]
85
+
86
+ Use the most specific scope that matches the real convention.
87
+ Do not add scoped rules just because directories exist.
88
+
89
+ After editing aib.json, run:
90
+
91
+ aib sync
92
+
93
+ Then rerun the smallest affected move/modulePlan preview or execute request.
94
+ If imports are still wrong, update importRules again before doing more manual cleanup.
@@ -0,0 +1,31 @@
1
+ AIB syncs and watches visible tsconfigs.
2
+ Keep real app/package configs visible.
3
+ Exclude nested workspaces, seed projects, snapshots, backups, copied apps, or other non-primary projects.
4
+
5
+ Do not exclude real package/app configs just to reduce output.
6
+
7
+ Check which TypeScript configs AIB will sync and watch:
8
+
9
+ aib reveal tsconfigs +all
10
+
11
+ If output includes non-primary projects, exclude them:
12
+
13
+ "sync.tsconfig.exclude": [
14
+ "dev-seed/**",
15
+ "snapshots/**"
16
+ ]
17
+
18
+ After editing aib.json, run:
19
+
20
+ aib sync
21
+
22
+ Then check again:
23
+
24
+ aib reveal tsconfigs +all
25
+
26
+ Visible tsconfigs should describe the active project surface.
27
+ Excluded tsconfigs should be things the agent should not use for setup decisions.
28
+
29
+ Use +nec only when you need to compare visible configs with config-excluded configs:
30
+
31
+ aib reveal tsconfigs +nec
@@ -46,7 +46,7 @@ Use not set as the checklist for the setup sections below.
46
46
 
47
47
  4. Configure path aliases
48
48
 
49
- Run:
49
+ Check TypeScript aliases for hints:
50
50
 
51
51
  aib reveal tsaliases
52
52
 
@@ -62,7 +62,7 @@ A good alias:
62
62
  - is easy to recognize later.
63
63
 
64
64
  A bad alias:
65
- - duplicates a short path like "src": "src";
65
+ - duplicates a short path like "src": "src", "packages": "packages", "scripts": "scripts";
66
66
  - points to a rarely used folder;
67
67
  - mirrors the directory tree without a workflow reason.
68
68
 
@@ -81,9 +81,52 @@ Example:
81
81
 
82
82
  5. Configure import rules
83
83
 
84
- Set importRules to the import style this repository should use after move/modulePlan mutations.
85
-
86
- If the repository has one style, use one broad rule:
84
+ importRules control imports created or expanded by move/modulePlan mutation cleanup.
85
+ They do not rewrite the whole project.
86
+
87
+ AIB starts from IDE/TS import preferences.
88
+ For mutation cleanup, matching importRules in aib.json take priority.
89
+ Do not assume IDE/TS defaults match the repo style.
90
+
91
+ Fields:
92
+ scope repo-relative file or directory scope; most specific scope wins
93
+ specifier relative|shortest|project-relative|non-relative
94
+ ending auto|minimal|index|js
95
+ builtin node|bare
96
+ unusedImports remove|preserve
97
+
98
+ Defaults:
99
+ specifier omitted IDE/TS decides
100
+ ending omitted IDE/TS decides
101
+ builtin omitted keep TS/project builtin style
102
+ unusedImports omitted keep unused imports
103
+
104
+ specifier:
105
+ relative best for local relative imports
106
+ shortest best for shortest valid alias/path output
107
+ project-relative best for root-relative project imports
108
+ non-relative best for package or alias imports
109
+
110
+ ending:
111
+ minimal best for extensionless TS imports
112
+ js best for ESM-style TS projects that require .js
113
+ auto leaves the decision to TypeScript
114
+ index best for explicit index import style
115
+
116
+ builtin:
117
+ node path -> node:path; best for explicit Node builtin imports
118
+ bare node:path -> path; best for bare Node builtin imports
119
+ omit field keeps TypeScript/project output; add builtin if agents keep fixing this manually
120
+
121
+ unusedImports:
122
+ remove clean unused imports in mutation-touched files
123
+ preserve keep unused imports
124
+ omit same as preserve
125
+
126
+ Mutation-touched files are files where TS produced edits: source/target files and any reference/update files TS changed.
127
+ Recommended value: remove
128
+
129
+ If the repository has one import style, use one broad rule:
87
130
 
88
131
  "importRules": [
89
132
  {
@@ -117,42 +160,10 @@ Use scoped rules only when areas differ by style, for example packages use alias
117
160
  Use the most specific scope that matches the real convention.
118
161
  Do not add scoped rules just because directories exist.
119
162
 
120
- 6. Configure import normalization
121
-
122
- Add importNormalize only for cleanup commands the agent is likely to run more than once.
163
+ 6. Configure tree and graph excludes
123
164
 
124
- Use it when the repo has a clear normalization target:
125
-
126
- "importNormalize": [
127
- {
128
- "scope": "src",
129
- "to": "shortestAlias",
130
- "preferAlias": "@/*",
131
- "exclude": [
132
- "src/generated",
133
- "src/**/dist"
134
- ]
135
- },
136
- {
137
- "scope": "scripts",
138
- "to": "relative",
139
- "exclude": [
140
- "scripts/**/*.cjs",
141
- "scripts/**/*.mjs"
142
- ]
143
- }
144
- ]
145
-
146
- Choose scopes from real repo conventions.
147
- Do not copy importRules into importNormalize automatically.
148
- Leave it unset if normalization is not a repeated workflow.
149
-
150
- 7. Configure tree and graph excludes
151
-
152
- Add excludes for noise the repository is known to contain.
153
-
154
- Use tree excludes for what the agent should not see while mapping folders.
155
- Use graph excludes for files that should not affect graph counts, hubs, entrypoints, leaves, edges, or saved graph views.
165
+ Tree excludes affect directory and file discovery output.
166
+ Graph excludes affect graph counts, hubs, entrypoints, leaves, edges, imports, importedBy, and saved graph views.
156
167
 
157
168
  Built-in excludes already skip common noise such as node_modules, .git, dist, build, out, and .tmp.
158
169
  Add config excludes for repository-specific noise.
@@ -186,21 +197,25 @@ If the repository needs one of these areas for reasoning or mutation impact chec
186
197
  Do not exclude broad source areas to make output smaller.
187
198
  If output is too large, use scope, depth, limit, graph view, or graph toggles first.
188
199
 
189
- 8. Configure TypeScript config discovery
200
+ 7. Configure TypeScript config discovery
201
+
202
+ AIB syncs and watches visible tsconfigs.
203
+ Keep real app/package configs visible.
204
+ Exclude nested workspaces, seed projects, snapshots, backups, copied apps, or other non-primary projects.
205
+
206
+ Do not exclude real package/app configs just to reduce output.
190
207
 
191
208
  Check which TypeScript configs AIB will sync and watch:
192
209
 
193
210
  aib reveal tsconfigs +all
194
211
 
195
- If output includes nested workspaces, seed projects, snapshots, backups, copied apps, or other non-primary projects, exclude them:
212
+ If output includes non-primary projects, exclude them:
196
213
 
197
214
  "sync.tsconfig.exclude": [
198
215
  "dev-seed/**",
199
216
  "snapshots/**"
200
217
  ]
201
218
 
202
- Do not exclude real package/app configs just to reduce output.
203
-
204
219
  After editing aib.json, run:
205
220
 
206
221
  aib sync
@@ -216,7 +231,7 @@ Use +nec only when you need to compare visible configs with config-excluded conf
216
231
 
217
232
  aib reveal tsconfigs +nec
218
233
 
219
- 9. Sync and verify
234
+ 8. Sync and verify
220
235
 
221
236
  After all aib.json edits, run:
222
237
 
@@ -246,7 +261,7 @@ Confirm:
246
261
  - visible tsconfigs match the active project surface;
247
262
  - config sections are set intentionally.
248
263
 
249
- 10. Note operational constraints
264
+ 9. Note operational constraints
250
265
 
251
266
  Before reporting back, identify any constraints the user should know.
252
267
 
@@ -264,12 +279,12 @@ Watchers:
264
279
  AIB watches aib.json and visible tsconfig files after sync.
265
280
  If config changes are not reflected, run aib sync.
266
281
 
267
- 11. Report to user
282
+ 10. Report to user
268
283
 
269
284
  Report:
270
285
  - whether AIB config already existed or was initialized;
271
286
  - which aliases were added and why;
272
- - which importRules/importNormalize settings were added or intentionally left unset;
287
+ - which importRules settings were added or intentionally left unset;
273
288
  - which tree/graph/tsconfig excludes were added;
274
289
  - whether sync and verification passed;
275
290
  - any worktree, TTL, watcher, or tsconfig discovery constraints the user should know.
@@ -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}}
@@ -0,0 +1,24 @@
1
+ After context compaction, always run:
2
+ aib help help-protocol quick-map
3
+ aib config aliases
4
+
5
+ Use focused help when you would otherwise guess how a known AIB capability works.
6
+
7
+ Reread bootstrap when you need to restore the overall AIB workflow faster than piecing it together from focused topics.
8
+ If you just reread bootstrap, do not also read focused topics unless you need details that bootstrap does not cover.
9
+
10
+ Do not reread bootstrap automatically if focused help is enough.
11
+
12
+ If you are about to change import style across files, add or adopt tsconfig aliases, or clean imports repeatedly, read:
13
+ aib help config-setup.import-normalize imports.normalize
14
+
15
+ Refresh focused config help by signal:
16
+ - repeated long paths: aib help config-setup.aliases
17
+ - wrong move/modulePlan imports: aib help config-setup.import-rules
18
+ - noisy tree/graph output: aib help config-setup.excludes
19
+ - too many visible tsconfigs: aib help config-setup.tsconfigs
20
+
21
+ When refreshing multiple areas, request them together instead of one by one.
22
+
23
+ Example:
24
+ aib help patterns mutation inspect inspect.file inspect.code imports.normalize
@@ -0,0 +1,36 @@
1
+ Use cycles to find import cycles in a file or directory scope.
2
+
3
+ Cycles reports cyclic components, not every possible path through a dense graph.
4
+ It classifies cycles as runtime, type-only, or mixed.
5
+
6
+ Start broad with summary output.
7
+ Use detail=imports when you need the import edges that explain a cycle.
8
+ Use detail=files when file membership is enough.
9
+
10
+ Controls:
11
+ scope file or directory scope
12
+ files focus cycles that include one or more files
13
+ detail summary|imports|files
14
+ limit max cyclic components shown
15
+
16
+ Run:
17
+ aib inspect cycles <scope>
18
+
19
+ Inline:
20
+ aib inspect cycles src/features --limit 20
21
+ aib inspect cycles src/features --detail imports --limit 20
22
+ aib inspect cycles --files src/features/service.ts --detail imports
23
+
24
+ Stdin:
25
+ aib inspect --stdin
26
+
27
+ Input:
28
+ cycles src/features limit=20
29
+ cycles src/features detail=imports limit=20
30
+ cycles scope=src/features files=[src/features/service.ts] detail=imports
31
+
32
+ If output hides components and shows a view handle, inspect only the hidden part:
33
+
34
+ aib view <handle> --offset 2 --limit 2
35
+ aib view <handle> --index 4 --detail imports
36
+ aib view <handle> --index 5 --detail files
@@ -21,6 +21,7 @@ incoming references/callers usages
21
21
  file/module connectivity graph
22
22
  compact directory layout tree
23
23
  repeated declarations/helpers duplicates
24
+ local import cycles cycles
24
25
 
25
26
  Prefer one batch DSL request for related questions.
26
27
 
@@ -10,6 +10,9 @@ Use it when a large file should be refactored into several target files.
10
10
 
11
11
  modulePlan orchestrates semantic moves and updates affected references/imports.
12
12
 
13
+ If imports created by modulePlan do not match the repo style, run:
14
+ aib help config-setup.import-rules
15
+
13
16
  Use +expectEmpty when your modulePlan intent is to move all declarations out of the source file.
14
17
  It does not change the move behavior; it only asks output to report remaining source declarations if any remain.
15
18
  Use it only when remaining declarations would mean the split did not match your intent.
@@ -10,6 +10,9 @@ Move is semantic; it moves supported declarations and updates affected imports/r
10
10
  Use it for focused extraction into a single target file.
11
11
  For large file splitting across several target files, use modulePlan.
12
12
 
13
+ If imports created by move do not match the repo style, run:
14
+ aib help config-setup.import-rules
15
+
13
16
  Move to file:
14
17
  move toFile preview --stdin
15
18
  move toFile execute --stdin
@@ -3,6 +3,9 @@ Successful mutations update affected references and imports.
3
3
 
4
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
5
 
6
+ If move/modulePlan imports do not match the repo style, run:
7
+ aib help config-setup.import-rules
8
+
6
9
  AIB mutations are designed to reduce manual checking.
7
10
  Your job is to express the intent in DSL.
8
11
  AIB's job is to convert that intent into code changes.
@@ -1,4 +1,9 @@
1
+ To refresh help protocol:
2
+ aib help help-protocol
3
+
1
4
  Use aib before broad file reads when the question is about TS/JS structure, references, dependencies, or focused code.
5
+ Use qr for cross-OS quick reads of text files, logs, JSON, scripts, and line windows.
6
+ It is not a replacement for inspect.
2
7
  Use normal text search when the question is just text.
3
8
 
4
9
  For a first pass in a new codebase, map directories before reading files:
@@ -40,117 +45,7 @@ aib execution status last
40
45
 
41
46
  This is an escape hatch for recovering the latest mutation status/result.
42
47
 
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
48
+ Config excludes can hide files from tree/graph/sync output.
154
49
 
155
50
  AIB has four config exclude fields:
156
51
  inspect.graph.exclude
@@ -160,13 +55,7 @@ sync.tsconfig.exclude
160
55
 
161
56
  For all of them, node_modules, .git, dist, build, out, and .tmp are skipped by default.
162
57
 
163
- Use config excludes for generated files, backups, local copies, nested workspaces, seed projects, or other repository-specific noise.
164
-
165
- Graph excludes affect graph counts, hubs, entrypoints, leaves, edges, imports, importedBy, and saved graph files.
166
- Tree excludes affect directory/file discovery output.
167
- Tsconfig excludes affect which TypeScript configs AIB syncs and watches.
168
-
169
- Leave feedback while working.
58
+ Important: leave feedback while working.
170
59
 
171
60
  aib is built for agents. Agent feedback is the main signal for improving output, docs, mutations, and token efficiency.
172
61
 
@@ -1,9 +1,13 @@
1
- Use qr to read arbitrary text files with compact, cross-platform line windows.
1
+ Use qr for cross-OS quick reads of text files: ts, js, cmd, sh, json, log, txt, ndjson, etc.
2
+ Use it for compact line windows and batching.
2
3
  qr supports AIB path aliases.
3
4
 
4
- qr is not a replacement for inspect.
5
+ It is not a replacement for inspect.
5
6
  Use it as a token-efficient way to read text data when semantic inspect is not needed.
6
7
 
8
+ For focused text reads, prefer qr over cat/Get-Content/type, especially when aliases, line windows, or batching help.
9
+ Use shell reads only when piping into shell tooling or qr is unavailable.
10
+
7
11
  Controls:
8
12
  -h N head; first N lines
9
13
  -t N tail; last N lines