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