@automaton-labs/aib 0.0.3 → 0.0.5

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 (134) hide show
  1. package/dist/bin/cli.js +2 -2
  2. package/dist/commands/config-command.js +1 -3
  3. package/dist/commands/config-output.js +8 -0
  4. package/dist/commands/help-command.js +7 -3
  5. package/dist/commands/init-workspace.js +1 -3
  6. package/dist/commands/inspect-tree.js +3 -3
  7. package/dist/commands/reveal-command.js +5 -0
  8. package/dist/commands/session-workspace.js +4 -4
  9. package/dist/commands/sync-command.js +2 -2
  10. package/dist/config/local-config.js +3 -3
  11. package/dist/config/resolve-command-alias.js +1 -1
  12. package/dist/config/tsconfig-discovery.js +1 -0
  13. package/dist/config/workspace-root.js +3 -3
  14. package/dist/config/workspace-state.js +1 -1
  15. package/dist/dsl/aib-dsl.js +1 -1
  16. package/dist/help/bootstrap.md +108 -94
  17. package/dist/help/docs/config-setup.aliases.md +56 -0
  18. package/dist/help/docs/config-setup.excludes.md +45 -0
  19. package/dist/help/docs/config-setup.import-normalize.md +86 -0
  20. package/dist/help/docs/config-setup.import-rules.md +96 -0
  21. package/dist/help/docs/config-setup.tsconfigs.md +33 -0
  22. package/dist/help/docs/first-setup.md +292 -0
  23. package/dist/help/docs/help-protocol.md +26 -0
  24. package/dist/help/docs/inspect.cycles.md +38 -0
  25. package/dist/help/docs/inspect.md +1 -0
  26. package/dist/help/docs/inspect.tree.md +8 -6
  27. package/dist/help/docs/modulePlan.md +3 -0
  28. package/dist/help/docs/move.md +3 -0
  29. package/dist/help/docs/mutation.md +3 -0
  30. package/dist/help/docs/patterns.md +16 -118
  31. package/dist/help/docs/qr.md +6 -2
  32. package/dist/help/docs/quick-map.md +30 -0
  33. package/dist/help/docs/reveal.md +30 -0
  34. package/dist/help/dsl/bootstrap.md +108 -94
  35. package/dist/help/dsl/docs/config-setup.aliases.md +56 -0
  36. package/dist/help/dsl/docs/config-setup.excludes.md +45 -0
  37. package/dist/help/dsl/docs/config-setup.import-normalize.md +86 -0
  38. package/dist/help/dsl/docs/config-setup.import-rules.md +96 -0
  39. package/dist/help/dsl/docs/config-setup.tsconfigs.md +33 -0
  40. package/dist/help/dsl/docs/first-setup.md +292 -0
  41. package/dist/help/dsl/docs/help-protocol.md +26 -0
  42. package/dist/help/dsl/docs/inspect.cycles.md +38 -0
  43. package/dist/help/dsl/docs/inspect.md +1 -0
  44. package/dist/help/dsl/docs/inspect.tree.md +8 -6
  45. package/dist/help/dsl/docs/modulePlan.md +3 -0
  46. package/dist/help/dsl/docs/move.md +3 -0
  47. package/dist/help/dsl/docs/mutation.md +3 -0
  48. package/dist/help/dsl/docs/patterns.md +16 -118
  49. package/dist/help/dsl/docs/qr.md +6 -2
  50. package/dist/help/dsl/docs/quick-map.md +30 -0
  51. package/dist/help/dsl/docs/reveal.md +30 -0
  52. package/dist/help/dsl/full.md +108 -94
  53. package/dist/help/dsl/topics/config-setup.aliases.md +54 -0
  54. package/dist/help/dsl/topics/config-setup.excludes.md +43 -0
  55. package/dist/help/dsl/topics/config-setup.import-normalize.md +84 -0
  56. package/dist/help/dsl/topics/config-setup.import-rules.md +94 -0
  57. package/dist/help/dsl/topics/config-setup.tsconfigs.md +31 -0
  58. package/dist/help/dsl/topics/first-setup.md +290 -0
  59. package/dist/help/dsl/topics/help-protocol.md +24 -0
  60. package/dist/help/dsl/topics/inspect.cycles.md +36 -0
  61. package/dist/help/dsl/topics/inspect.md +1 -0
  62. package/dist/help/dsl/topics/inspect.tree.md +8 -6
  63. package/dist/help/dsl/topics/modulePlan.md +3 -0
  64. package/dist/help/dsl/topics/move.md +3 -0
  65. package/dist/help/dsl/topics/mutation.md +3 -0
  66. package/dist/help/dsl/topics/patterns.md +16 -118
  67. package/dist/help/dsl/topics/qr.md +6 -2
  68. package/dist/help/dsl/topics/quick-map.md +28 -0
  69. package/dist/help/dsl/topics/reveal.md +28 -0
  70. package/dist/help/full.md +108 -94
  71. package/dist/help/help-meta.json +57 -17
  72. package/dist/help/index.md +60 -0
  73. package/dist/help/json/bootstrap.md +108 -94
  74. package/dist/help/json/docs/config-setup.aliases.md +56 -0
  75. package/dist/help/json/docs/config-setup.excludes.md +45 -0
  76. package/dist/help/json/docs/config-setup.import-normalize.md +86 -0
  77. package/dist/help/json/docs/config-setup.import-rules.md +96 -0
  78. package/dist/help/json/docs/config-setup.tsconfigs.md +33 -0
  79. package/dist/help/json/docs/first-setup.md +292 -0
  80. package/dist/help/json/docs/help-protocol.md +26 -0
  81. package/dist/help/json/docs/inspect.cycles.md +38 -0
  82. package/dist/help/json/docs/inspect.md +1 -0
  83. package/dist/help/json/docs/inspect.tree.md +8 -6
  84. package/dist/help/json/docs/modulePlan.md +3 -0
  85. package/dist/help/json/docs/move.md +3 -0
  86. package/dist/help/json/docs/mutation.md +3 -0
  87. package/dist/help/json/docs/patterns.md +16 -118
  88. package/dist/help/json/docs/qr.md +6 -2
  89. package/dist/help/json/docs/quick-map.md +30 -0
  90. package/dist/help/json/docs/reveal.md +30 -0
  91. package/dist/help/json/full.md +108 -94
  92. package/dist/help/json/topics/config-setup.aliases.md +54 -0
  93. package/dist/help/json/topics/config-setup.excludes.md +43 -0
  94. package/dist/help/json/topics/config-setup.import-normalize.md +84 -0
  95. package/dist/help/json/topics/config-setup.import-rules.md +94 -0
  96. package/dist/help/json/topics/config-setup.tsconfigs.md +31 -0
  97. package/dist/help/json/topics/first-setup.md +290 -0
  98. package/dist/help/json/topics/help-protocol.md +24 -0
  99. package/dist/help/json/topics/inspect.cycles.md +36 -0
  100. package/dist/help/json/topics/inspect.md +1 -0
  101. package/dist/help/json/topics/inspect.tree.md +8 -6
  102. package/dist/help/json/topics/modulePlan.md +3 -0
  103. package/dist/help/json/topics/move.md +3 -0
  104. package/dist/help/json/topics/mutation.md +3 -0
  105. package/dist/help/json/topics/patterns.md +16 -118
  106. package/dist/help/json/topics/qr.md +6 -2
  107. package/dist/help/json/topics/quick-map.md +28 -0
  108. package/dist/help/json/topics/reveal.md +28 -0
  109. package/dist/help/topics/config-setup.aliases.md +54 -0
  110. package/dist/help/topics/config-setup.excludes.md +43 -0
  111. package/dist/help/topics/config-setup.import-normalize.md +84 -0
  112. package/dist/help/topics/config-setup.import-rules.md +94 -0
  113. package/dist/help/topics/config-setup.tsconfigs.md +31 -0
  114. package/dist/help/topics/first-setup.md +290 -0
  115. package/dist/help/topics/help-protocol.md +24 -0
  116. package/dist/help/topics/inspect.cycles.md +36 -0
  117. package/dist/help/topics/inspect.md +1 -0
  118. package/dist/help/topics/inspect.tree.md +8 -6
  119. package/dist/help/topics/modulePlan.md +3 -0
  120. package/dist/help/topics/move.md +3 -0
  121. package/dist/help/topics/mutation.md +3 -0
  122. package/dist/help/topics/patterns.md +16 -118
  123. package/dist/help/topics/qr.md +6 -2
  124. package/dist/help/topics/quick-map.md +28 -0
  125. package/dist/help/topics/reveal.md +28 -0
  126. package/dist/runtime/run-command.js +1 -1
  127. package/dist/session/server.js +3 -3
  128. package/dist/shared/diagnostic-catalog.js +1 -1
  129. package/dist/shared/errors.js +6 -5
  130. package/extension/vscode-refactor-bridge-extension.vsix +0 -0
  131. package/package.json +1 -1
  132. package/runtimes/launcher/win-x64/aib.exe +0 -0
  133. package/scripts/install-windows-launcher.cjs +1 -0
  134. package/scripts/provision-runtime.cjs +99 -41
@@ -0,0 +1,292 @@
1
+ # First Setup
2
+
3
+ Use this when the user asks you to set up AIB for a repository.
4
+
5
+ If you have not loaded the current bootstrap, run:
6
+ aib help bootstrap
7
+
8
+ 1. Detect existing setup
9
+
10
+ Run:
11
+
12
+ aib config
13
+
14
+ If AIB reports that no config exists, continue to initialization.
15
+
16
+ If config exists:
17
+ - verify that root is the intended repository root;
18
+ - keep existing settings if they are still valid and useful;
19
+ - only add missing project-specific aliases, rules, or excludes;
20
+ - do not regenerate aib.json.
21
+
22
+ If config resolves from a parent directory, verify that this is intentional.
23
+ Do not continue setup inside a nested worktree or copied project if AIB is using the parent repository config.
24
+
25
+ 2. Initialize if missing
26
+
27
+ From the repository root, run:
28
+
29
+ aib init --session-dir .tmp/aib
30
+
31
+ Use the output to check:
32
+ - root is the intended repository root;
33
+ - config is <root>/aib.json;
34
+ - sessionDir is set;
35
+ - cleanup/deletion/runtime TTLs are shown;
36
+ - not set includes the setup sections that still need decisions.
37
+
38
+ Do not create sessions yet.
39
+
40
+ 3. Configure repository-specific behavior
41
+
42
+ Edit aib.json directly.
43
+
44
+ Keep existing settings if they are still valid and useful.
45
+ Update settings that are stale, noisy, too broad, or no longer match the repository.
46
+
47
+ Use not set as the checklist for the setup sections below.
48
+
49
+ 4. Configure path aliases
50
+
51
+ Check TypeScript aliases for hints:
52
+
53
+ aib reveal tsaliases
54
+
55
+ Use this to see existing tsconfig paths and baseUrl values.
56
+ They can reveal stable work areas, but they are not a list to copy.
57
+
58
+ Add pathAliases for long paths that are likely to appear repeatedly in AIB requests.
59
+ Prefer aliases for real work areas, package roots, or deep directories.
60
+
61
+ A good alias:
62
+ - saves meaningful path tokens;
63
+ - points to a stable work area;
64
+ - is easy to recognize later.
65
+
66
+ A bad alias:
67
+ - duplicates a short path like "src": "src", "packages": "packages", "scripts": "scripts";
68
+ - points to a rarely used folder;
69
+ - mirrors the directory tree without a workflow reason.
70
+
71
+ Having 20-30 good aliases is fine for a large repo or monorepo.
72
+
73
+ Example:
74
+
75
+ "pathAliases": {
76
+ "wstore": "apps/web/src/shared/store",
77
+ "wapi": "apps/web/src/shared/api",
78
+ "whooks": "apps/web/src/shared/utils/hooks",
79
+ "pmail": "packages/email/src",
80
+ "putils": "packages/utils/src",
81
+ "arules": "docs/agent/rules"
82
+ }
83
+
84
+ 5. Configure import rules
85
+
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:
132
+
133
+ "importRules": [
134
+ {
135
+ "scope": ".",
136
+ "specifier": "shortest",
137
+ "ending": "auto",
138
+ "builtin": "node",
139
+ "unusedImports": "remove"
140
+ }
141
+ ]
142
+
143
+ Use scoped rules only when areas differ by style, for example packages use aliases but scripts use relative imports:
144
+
145
+ "importRules": [
146
+ {
147
+ "scope": "packages",
148
+ "specifier": "shortest",
149
+ "ending": "auto",
150
+ "builtin": "node",
151
+ "unusedImports": "remove"
152
+ },
153
+ {
154
+ "scope": "scripts",
155
+ "specifier": "relative",
156
+ "ending": "auto",
157
+ "builtin": "node",
158
+ "unusedImports": "remove"
159
+ }
160
+ ]
161
+
162
+ Use the most specific scope that matches the real convention.
163
+ Do not add scoped rules just because directories exist.
164
+
165
+ 6. Configure tree and graph excludes
166
+
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.
169
+
170
+ Built-in excludes already skip common noise such as node_modules, .git, dist, build, out, and .tmp.
171
+ Add config excludes for repository-specific noise.
172
+
173
+ For example, if the user often creates hard-copy directories or backup files before risky edits, those copies can make tree and graph output noisy.
174
+ Exclude them explicitly:
175
+
176
+ "inspect.tree.onlyDirs.exclude": [
177
+ "**/*copy",
178
+ "**/*copy/**"
179
+ ],
180
+ "inspect.tree.files.exclude": [
181
+ "**/* copy.ts",
182
+ "**/*.generated.ts"
183
+ ],
184
+ "inspect.graph.exclude": [
185
+ "**/* copy.ts",
186
+ "**/*.generated.ts",
187
+ "src/generated/**"
188
+ ]
189
+
190
+ Prefer narrow patterns for known noise:
191
+ - generated files;
192
+ - local copy/backup folders;
193
+ - build artifacts not already skipped by defaults;
194
+ - vendored or checked-in output.
195
+
196
+ These are common cases, not mandatory rules.
197
+ If the repository needs one of these areas for reasoning or mutation impact checks, do not exclude it.
198
+
199
+ Do not exclude broad source areas to make output smaller.
200
+ If output is too large, use scope, depth, limit, graph view, or graph toggles first.
201
+
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.
209
+
210
+ Check which TypeScript configs AIB will sync and watch:
211
+
212
+ aib reveal tsconfigs +all
213
+
214
+ If output includes non-primary projects, exclude them:
215
+
216
+ "sync.tsconfig.exclude": [
217
+ "dev-seed/**",
218
+ "snapshots/**"
219
+ ]
220
+
221
+ After editing aib.json, run:
222
+
223
+ aib sync
224
+
225
+ Then check again:
226
+
227
+ aib reveal tsconfigs +all
228
+
229
+ Visible tsconfigs should describe the active project surface.
230
+ Excluded tsconfigs should be things the agent should not use for setup decisions.
231
+
232
+ Use +nec only when you need to compare visible configs with config-excluded configs:
233
+
234
+ aib reveal tsconfigs +nec
235
+
236
+ 8. Sync and verify
237
+
238
+ After all aib.json edits, run:
239
+
240
+ aib sync
241
+
242
+ If sync fails, fix aib.json and rerun sync.
243
+
244
+ Check the final config summary:
245
+
246
+ aib config
247
+
248
+ Run one compact tree batch using important aliases:
249
+
250
+ aib inspect --stdin
251
+
252
+ Input:
253
+ tree @<important-alias> depth=3 +onlyDirs limit=80
254
+ tree @<another-important-alias> depth=3 +onlyDirs limit=80
255
+
256
+ Check final TypeScript config discovery:
257
+
258
+ aib reveal tsconfigs
259
+
260
+ Confirm:
261
+ - aliases resolve;
262
+ - obvious tree noise is hidden;
263
+ - visible tsconfigs match the active project surface;
264
+ - config sections are set intentionally.
265
+
266
+ 9. Note operational constraints
267
+
268
+ Before reporting back, identify any constraints the user should know.
269
+
270
+ Worktrees:
271
+ AIB resolves config from the nearest parent aib.json.
272
+ If the repository uses nested copied projects or worktrees inside the repo root, AIB may resolve the parent config.
273
+ Do not set up AIB inside nested worktrees that should behave as independent repositories.
274
+ Independent worktrees should live outside the main repo root or have their own intended aib.json boundary.
275
+
276
+ TTL:
277
+ Sessions and managed runtime are cleaned up after inactivity according to aib config session.
278
+ Tell the user if you changed these defaults or left them as-is.
279
+
280
+ Watchers:
281
+ AIB watches aib.json and visible tsconfig files after sync.
282
+ If config changes are not reflected, run aib sync.
283
+
284
+ 10. Report to user
285
+
286
+ Report:
287
+ - whether AIB config already existed or was initialized;
288
+ - which aliases were added and why;
289
+ - which importRules settings were added or intentionally left unset;
290
+ - which tree/graph/tsconfig excludes were added;
291
+ - whether sync and verification passed;
292
+ - any worktree, TTL, watcher, or tsconfig discovery constraints the user should know.
@@ -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
 
@@ -3,23 +3,25 @@
3
3
  Use tree to list a compact directory layout.
4
4
  It is useful before focused inspect when you know the area but not the exact file.
5
5
 
6
- node_modules, .git, dist, build, out, and .tmp are skipped by default.
7
-
8
6
  Controls:
9
- scope, depth, minDepth, limit, include, exclude, onlyDirs
7
+ scope, depth, minDepth, limit, only, exclude, onlyDirs, ned, nec
10
8
 
11
9
  Specific:
12
10
  depth max nesting depth; depth=N
13
11
  minDepth hide shallower paths; minDepth=N
14
12
  onlyDirs show directories only; +onlyDirs
15
- include only matching files/dirs; include=[...]
13
+ only only matching files/dirs; only=[...]
14
+ exclude skip matching files/dirs; exclude=[...]
15
+ ned no-default-exclude; ignore built-in excludes; +ned
16
+ nec no-config-exclude; ignore aib.json tree excludes; +nec
16
17
 
17
18
  Run:
18
19
  aib inspect --stdin
19
20
 
20
21
  Input:
21
- tree src depth=4 +onlyDirs limit=200
22
- tree @svc depth=3 include=["**/*.ts"] exclude=["**/*.test.ts","**/* copy.ts"]
22
+ tree src depth=4 +onlyDirs limit=200 +ned +nec
23
+ tree @svc depth=3 only=["**/*.ts"] exclude=["**/*.test.ts","**/* copy.ts"]
24
+ tree src depth=3 only=["src/services/**"] limit=80
23
25
 
24
26
  First pass in an unfamiliar codebase:
25
27
  tree src depth=5 +onlyDirs limit=200
@@ -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,124 +47,17 @@ 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
156
-
157
- inspect.graph.exclude skips files before graph builds the model.
158
- Use it for generated files, backups, local copies, or other paths that make graph output noisy.
159
-
160
- Excluded files do not affect graph counts, hubs, entrypoints, leaves, edges, imports, importedBy, or saved graph files.
161
-
162
- Leave feedback while working.
50
+ Config excludes can hide files from tree/graph/sync output.
51
+
52
+ AIB has four config exclude fields:
53
+ inspect.graph.exclude
54
+ inspect.tree.files.exclude
55
+ inspect.tree.onlyDirs.exclude
56
+ sync.tsconfig.exclude
57
+
58
+ For all of them, node_modules, .git, dist, build, out, and .tmp are skipped by default.
59
+
60
+ Important: leave feedback while working.
163
61
 
164
62
  aib is built for agents. Agent feedback is the main signal for improving output, docs, mutations, and token efficiency.
165
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
@@ -0,0 +1,30 @@
1
+ # Quick Map
2
+
3
+ Read:
4
+ qr quick reads: ts, js, cmd, sh, json, log, txt, etc.
5
+ view hidden/truncated output
6
+
7
+ Inspect:
8
+ file
9
+ imports
10
+ exports
11
+ members
12
+ code
13
+ deps
14
+ usages
15
+ graph
16
+ tree
17
+ duplicates
18
+ cycles
19
+
20
+ Mutate:
21
+ rename
22
+ move
23
+ modulePlan
24
+ refactor batch
25
+ imports normalize
26
+
27
+ Other:
28
+ config
29
+ prefs
30
+ reveal tsconfig and tsconfig alias discovery
@@ -0,0 +1,30 @@
1
+ # Reveal
2
+
3
+ Use reveal to inspect TypeScript config discovery used by AIB.
4
+
5
+ Reveal is for config/setup diagnosis.
6
+ Use it when aliases, sync, imports normalize, or tsconfig excludes depend on which tsconfig files AIB sees.
7
+
8
+ Commands:
9
+ aib reveal tsconfigs
10
+ aib reveal tsaliases
11
+
12
+ tsconfigs shows visible TypeScript configs and config-excluded configs.
13
+ tsaliases shows baseUrl, paths, extends, inherited paths, duplicated inherited paths, and overridden inherited paths.
14
+
15
+ Controls:
16
+ all show all output instead of compact output
17
+ nec no config excludes; ignore sync.tsconfig.exclude
18
+ ned no default excludes
19
+ limit max visible groups/items before + N more
20
+
21
+ Examples:
22
+ aib reveal tsconfigs
23
+ aib reveal tsconfigs +all
24
+ aib reveal tsconfigs +nec limit=20
25
+ aib reveal tsaliases
26
+ aib reveal tsaliases +all
27
+ aib reveal tsaliases +nec
28
+
29
+ Use tsconfigs before tuning sync.tsconfig.exclude.
30
+ Use tsaliases before creating AIB pathAliases or configuring import normalization.