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