@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.
- package/dist/bin/cli.js +2 -2
- package/dist/commands/config-command.js +2 -1
- package/dist/commands/config-output.js +10 -8
- package/dist/commands/doctor.js +2 -1
- package/dist/commands/help-command.js +7 -3
- package/dist/commands/inspect-format.js +1 -1
- package/dist/commands/quick-read.js +8 -8
- package/dist/commands/result-view.js +5 -5
- package/dist/commands/session-workspace.js +8 -8
- package/dist/config/workspace-root.js +3 -3
- package/dist/help/bootstrap.md +92 -91
- 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 +63 -48
- package/dist/help/docs/help-format.md +4 -7
- 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/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 +7 -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 +92 -91
- 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 +63 -48
- package/dist/help/dsl/docs/help-format.md +4 -7
- 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/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 +7 -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 +92 -91
- 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 +63 -48
- package/dist/help/dsl/topics/help-format.md +4 -7
- 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/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 +7 -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 +92 -91
- package/dist/help/help-meta.json +55 -19
- package/dist/help/index.md +54 -0
- package/dist/help/json/bootstrap.md +92 -91
- 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 +63 -48
- package/dist/help/json/docs/help-format.md +4 -7
- 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/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 +7 -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 +92 -91
- 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 +63 -48
- package/dist/help/json/topics/help-format.md +4 -7
- 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/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 +7 -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 +63 -48
- package/dist/help/topics/help-format.md +4 -7
- 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/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 +7 -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/managed-host/serve-web-autostart.js +1 -1
- package/dist/managed-host/serve-web-host.cjs +193 -79
- package/dist/observability/config.js +1 -1
- package/dist/payloads/read-stdin-json.js +1 -1
- package/dist/runtime/managed-runtime-provisioning.js +1 -1
- package/dist/runtime/run-command.js +1 -1
- package/dist/session/server.js +7 -5
- package/dist/shared/diagnostic-catalog.js +1 -1
- package/dist/shared/errors.js +17 -15
- package/dist/shared/stdin-examples.js +3 -0
- package/dist/tracing/trace.js +5 -3
- package/extension/vscode-refactor-bridge-extension.vsix +0 -0
- package/package.json +1 -1
- package/runtimes/launcher/linux-x64/aib +0 -0
- package/runtimes/launcher/win-x64/aib.exe +0 -0
- package/scripts/provision-runtime.cjs +25 -1
package/dist/help/json/full.md
CHANGED
|
@@ -13,13 +13,10 @@ session prefs get
|
|
|
13
13
|
Run:
|
|
14
14
|
aib session prefs get
|
|
15
15
|
|
|
16
|
-
Stdin examples show command and input separately to avoid shell-specific syntax.
|
|
17
|
-
Stdin Run lines include the aib prefix to avoid confusion.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
@'
|
|
21
|
-
<input>
|
|
22
|
-
'@ | aib <command> --stdin
|
|
16
|
+
Stdin examples show command and input separately to avoid shell-specific syntax.
|
|
17
|
+
Stdin Run lines include the aib prefix to avoid confusion.
|
|
18
|
+
|
|
19
|
+
{{stdin.examples}}
|
|
23
20
|
|
|
24
21
|
Basics
|
|
25
22
|
|
|
@@ -37,9 +34,28 @@ Use one-off commands only for small checks/changes.
|
|
|
37
34
|
For mutations, aib asks TS/IDE refactors to update affected references and imports.
|
|
38
35
|
After a successful mutation, do not manually patch the same imports unless aib reports a follow-up or the build/checks show a real issue.
|
|
39
36
|
|
|
40
|
-
Working patterns
|
|
41
|
-
|
|
37
|
+
Working patterns
|
|
38
|
+
|
|
39
|
+
Help refresh
|
|
40
|
+
|
|
41
|
+
After context compaction, always run:
|
|
42
|
+
aib help help-protocol quick-map
|
|
43
|
+
aib config aliases
|
|
44
|
+
|
|
45
|
+
Use focused help when you would otherwise guess how a known AIB capability works.
|
|
46
|
+
|
|
47
|
+
Reread bootstrap when you need to restore the overall AIB workflow faster than piecing it together from focused topics.
|
|
48
|
+
If you just reread bootstrap, do not also read focused topics unless you need details that bootstrap does not cover.
|
|
49
|
+
|
|
50
|
+
Do not reread bootstrap automatically if focused help is enough.
|
|
51
|
+
When refreshing multiple areas, request them together instead of one by one.
|
|
52
|
+
|
|
53
|
+
Example:
|
|
54
|
+
aib help patterns mutation inspect inspect.file inspect.code imports.normalize
|
|
55
|
+
|
|
42
56
|
Use aib before broad file reads when the question is about TS/JS structure, references, dependencies, or focused code.
|
|
57
|
+
Use qr for cross-OS quick reads of text files, logs, JSON, scripts, and line windows.
|
|
58
|
+
It is not a replacement for inspect.
|
|
43
59
|
Use normal text search when the question is just text.
|
|
44
60
|
|
|
45
61
|
For a first pass in a new codebase, map directories before reading files:
|
|
@@ -53,9 +69,9 @@ If output hides data and shows `view: aib:res_<id>`, use `aib view ...` to fetch
|
|
|
53
69
|
|
|
54
70
|
Compact output is a starting point, not a substitute for needed code.
|
|
55
71
|
Fetch exact code when correctness depends on implementation details.
|
|
56
|
-
|
|
57
|
-
Use prefs when the current phase repeats the same output shape.
|
|
58
|
-
Turn details off when they stop helping.
|
|
72
|
+
|
|
73
|
+
Use prefs when the current phase repeats the same output shape.
|
|
74
|
+
Turn details off when they stop helping.
|
|
59
75
|
Turn them back on when they matter.
|
|
60
76
|
|
|
61
77
|
For mutation commands, set the shell/tool harness timeout to 3 minutes.
|
|
@@ -66,15 +82,30 @@ aib execution status last
|
|
|
66
82
|
|
|
67
83
|
This is an escape hatch for recovering the latest mutation status/result.
|
|
68
84
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
aib config
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
After reading bootstrap for the first time in a repo, run:
|
|
86
|
+
|
|
87
|
+
aib config
|
|
88
|
+
|
|
89
|
+
Use the output as the repo-local AIB map:
|
|
90
|
+
- pathAliases show short paths to use in AIB requests;
|
|
91
|
+
- importRules show how move/modulePlan should create imports;
|
|
92
|
+
- importNormalize shows defaults for explicit imports normalize;
|
|
93
|
+
- excludes show which noise is intentionally hidden from tree/graph/sync.
|
|
94
|
+
|
|
95
|
+
If pathAliases are missing, stale, or weak for repeated paths, run:
|
|
96
|
+
aib help config-setup.aliases
|
|
97
|
+
|
|
98
|
+
If move/modulePlan imports do not match the repo style, run:
|
|
99
|
+
aib help config-setup.import-rules
|
|
100
|
+
|
|
101
|
+
If you are about to change import style across files, add or adopt tsconfig aliases, or clean imports repeatedly, run:
|
|
102
|
+
aib help config-setup.import-normalize
|
|
103
|
+
|
|
104
|
+
If tree/graph output includes known repo noise, run:
|
|
105
|
+
aib help config-setup.excludes
|
|
106
|
+
|
|
107
|
+
If sync or reveal shows too many visible TypeScript configs, run:
|
|
108
|
+
aib help config-setup.tsconfigs
|
|
78
109
|
|
|
79
110
|
Example aib.json config:
|
|
80
111
|
|
|
@@ -111,72 +142,18 @@ Use them to reduce input tokens for repeated inspect and mutation work.
|
|
|
111
142
|
Aliases are for aib request paths. They do not change TypeScript imports by themselves.
|
|
112
143
|
For import style after mutations, use importRules.
|
|
113
144
|
|
|
114
|
-
importRules control imports created or expanded by move/modulePlan mutation cleanup.
|
|
115
|
-
They do not rewrite the whole project.
|
|
116
|
-
|
|
117
|
-
AIB starts from IDE/TS import preferences.
|
|
118
|
-
For mutation cleanup, matching importRules in aib.json take priority.
|
|
119
|
-
|
|
120
|
-
Do not assume IDE/TS defaults match the repo style.
|
|
121
|
-
Set importRules before large move/modulePlan work so imports do not need manual cleanup.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
ending auto|minimal|index|js
|
|
127
|
-
builtin node|bare
|
|
128
|
-
unusedImports remove|preserve
|
|
129
|
-
|
|
130
|
-
Defaults:
|
|
131
|
-
specifier omitted IDE/TS decides
|
|
132
|
-
ending omitted IDE/TS decides
|
|
133
|
-
builtin omitted keep TS/project builtin style
|
|
134
|
-
unusedImports omitted keep unused imports
|
|
135
|
-
|
|
136
|
-
specifier:
|
|
137
|
-
relative best for local relative imports
|
|
138
|
-
shortest best for shortest valid alias/path output
|
|
139
|
-
project-relative best for root-relative project imports
|
|
140
|
-
non-relative best for package or alias imports
|
|
141
|
-
|
|
142
|
-
ending:
|
|
143
|
-
minimal best for extensionless TS imports
|
|
144
|
-
js best for ESM-style TS projects that require .js
|
|
145
|
-
auto leaves the decision to TypeScript
|
|
146
|
-
index best for explicit index import style
|
|
147
|
-
|
|
148
|
-
builtin:
|
|
149
|
-
node path -> node:path; best for explicit Node builtin imports
|
|
150
|
-
bare node:path -> path; best for bare Node builtin imports
|
|
151
|
-
omit field keeps TypeScript/project output; add builtin if agents keep fixing this manually
|
|
152
|
-
|
|
153
|
-
unusedImports:
|
|
154
|
-
remove clean unused imports in mutation-touched files
|
|
155
|
-
preserve keep unused imports
|
|
156
|
-
omit same as preserve
|
|
157
|
-
|
|
158
|
-
Mutation-touched files are files where TS produced edits: source/target files and any reference/update files TS changed.
|
|
159
|
-
Recommended value: remove
|
|
160
|
-
|
|
161
|
-
importNormalize defines reusable defaults for aib imports normalize.
|
|
162
|
-
Use it when the same normalize request would otherwise be repeated.
|
|
163
|
-
|
|
164
|
-
It affects explicit import normalize commands only.
|
|
165
|
-
It does not run automatically during move/modulePlan; use importRules for mutation-time cleanup.
|
|
166
|
-
|
|
167
|
-
Fields:
|
|
168
|
-
scope repo-relative file or directory scope; most specific scope wins
|
|
169
|
-
to relative|alias|shortestAlias
|
|
170
|
-
preferAlias tsconfig paths pattern used when to=alias
|
|
171
|
-
exclude files, directories, or glob-like patterns to skip
|
|
172
|
-
|
|
173
|
-
to:
|
|
174
|
-
relative rewrite resolved local imports to relative paths
|
|
175
|
-
alias rewrite resolved local imports to a matching tsconfig alias
|
|
176
|
-
shortestAlias rewrite to the shortest valid alias specifier
|
|
177
|
-
|
|
178
|
-
preferAlias:
|
|
179
|
-
@shared/* prefer one alias pattern when several aliases can resolve the same file
|
|
145
|
+
importRules control imports created or expanded by move/modulePlan mutation cleanup.
|
|
146
|
+
They do not rewrite the whole project.
|
|
147
|
+
|
|
148
|
+
AIB starts from IDE/TS import preferences.
|
|
149
|
+
For mutation cleanup, matching importRules in aib.json take priority.
|
|
150
|
+
|
|
151
|
+
Do not assume IDE/TS defaults match the repo style.
|
|
152
|
+
Set importRules before large move/modulePlan work so imports do not need manual cleanup.
|
|
153
|
+
|
|
154
|
+
importNormalize defines default rules for explicit aib imports normalize commands.
|
|
155
|
+
|
|
156
|
+
It does not run automatically during move/modulePlan; use importRules for mutation-time cleanup.
|
|
180
157
|
|
|
181
158
|
AIB has four config exclude fields:
|
|
182
159
|
inspect.graph.exclude
|
|
@@ -190,9 +167,10 @@ Use config excludes for generated files, backups, local copies, nested workspace
|
|
|
190
167
|
|
|
191
168
|
Graph excludes affect graph counts, hubs, entrypoints, leaves, edges, imports, importedBy, and saved graph files.
|
|
192
169
|
Tree excludes affect directory/file discovery output.
|
|
193
|
-
|
|
170
|
+
AIB syncs and watches visible tsconfigs.
|
|
171
|
+
sync.tsconfig.exclude affects which TypeScript configs AIB syncs and watches.
|
|
194
172
|
|
|
195
|
-
|
|
173
|
+
Important: leave feedback while working.
|
|
196
174
|
|
|
197
175
|
aib is built for agents. Agent feedback is the main signal for improving output, docs, mutations, and token efficiency.
|
|
198
176
|
|
|
@@ -371,6 +349,10 @@ incoming references/callers usages
|
|
|
371
349
|
file/module connectivity graph
|
|
372
350
|
compact directory layout tree
|
|
373
351
|
repeated declarations/helpers duplicates
|
|
352
|
+
local import cycles cycles
|
|
353
|
+
|
|
354
|
+
Cycles are available but not expanded in bootstrap:
|
|
355
|
+
aib help inspect.cycles
|
|
374
356
|
|
|
375
357
|
Prefer one batch JSON request for related questions.
|
|
376
358
|
Top-level fields are defaults for every request.
|
|
@@ -808,6 +790,9 @@ Successful mutations update affected references and imports.
|
|
|
808
790
|
|
|
809
791
|
After a successful mutation, do not manually patch the same imports unless aib reports a follow-up or checks show a real issue.
|
|
810
792
|
|
|
793
|
+
If move/modulePlan imports do not match the repo style, run:
|
|
794
|
+
aib help config-setup.import-rules
|
|
795
|
+
|
|
811
796
|
AIB mutations are designed to reduce manual checking.
|
|
812
797
|
Your job is to express the intent in DSL.
|
|
813
798
|
AIB's job is to convert that intent into code changes.
|
|
@@ -877,6 +862,9 @@ Move is semantic; it moves supported declarations and updates affected imports/r
|
|
|
877
862
|
Use it for focused extraction into a single target file.
|
|
878
863
|
For large file splitting across several target files, use modulePlan.
|
|
879
864
|
|
|
865
|
+
If imports created by move do not match the repo style, run:
|
|
866
|
+
aib help config-setup.import-rules
|
|
867
|
+
|
|
880
868
|
Move several entities into one target:
|
|
881
869
|
Run:
|
|
882
870
|
aib move toFile execute --stdin
|
|
@@ -895,6 +883,9 @@ Use it when a large file should be refactored into several target files.
|
|
|
895
883
|
|
|
896
884
|
modulePlan orchestrates semantic moves and updates affected references/imports.
|
|
897
885
|
|
|
886
|
+
If imports created by modulePlan do not match the repo style, run:
|
|
887
|
+
aib help config-setup.import-rules
|
|
888
|
+
|
|
898
889
|
Use expectEmpty when your modulePlan intent is to move all declarations out of the source file.
|
|
899
890
|
It does not change the move behavior; it only asks output to report remaining source declarations if any remain.
|
|
900
891
|
Use it only when remaining declarations would mean the split did not match your intent.
|
|
@@ -1051,12 +1042,16 @@ aib view aib:res_<id_2> --except ClassB.bigB --except ClassC.bigC
|
|
|
1051
1042
|
|
|
1052
1043
|
Quick Read
|
|
1053
1044
|
|
|
1054
|
-
Use qr
|
|
1045
|
+
Use qr for cross-OS quick reads of text files: ts, js, cmd, sh, json, log, txt, ndjson, etc.
|
|
1046
|
+
Use it for compact line windows and batching.
|
|
1055
1047
|
qr supports AIB path aliases.
|
|
1056
1048
|
|
|
1057
|
-
|
|
1049
|
+
It is not a replacement for inspect.
|
|
1058
1050
|
Use it as a token-efficient way to read text data when semantic inspect is not needed.
|
|
1059
1051
|
|
|
1052
|
+
For focused text reads, prefer qr over cat/Get-Content/type, especially when aliases, line windows, or batching help.
|
|
1053
|
+
Use shell reads only when piping into shell tooling or qr is unavailable.
|
|
1054
|
+
|
|
1060
1055
|
Controls:
|
|
1061
1056
|
-h N head; first N lines
|
|
1062
1057
|
-t N tail; last N lines
|
|
@@ -1082,3 +1077,9 @@ aib qr @scripts/b.py -o 300 -l 50
|
|
|
1082
1077
|
aib qr @logs/app.log -a
|
|
1083
1078
|
|
|
1084
1079
|
Use stdin for several reads.
|
|
1080
|
+
|
|
1081
|
+
Need to see TypeScript configs in the repo:
|
|
1082
|
+
aib reveal tsconfigs
|
|
1083
|
+
|
|
1084
|
+
Need to see TypeScript aliases across the repo:
|
|
1085
|
+
aib reveal tsaliases
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
If you have not just checked the full config, check current aliases:
|
|
2
|
+
|
|
3
|
+
aib config aliases
|
|
4
|
+
|
|
5
|
+
pathAliases define short request aliases for paths agents repeat in AIB commands.
|
|
6
|
+
Use them to reduce input tokens for repeated inspect and mutation work.
|
|
7
|
+
|
|
8
|
+
Aliases are for AIB request paths.
|
|
9
|
+
They do not change TypeScript imports by themselves.
|
|
10
|
+
For import style after mutations, use importRules.
|
|
11
|
+
|
|
12
|
+
Check TypeScript aliases for hints:
|
|
13
|
+
|
|
14
|
+
aib reveal tsaliases
|
|
15
|
+
|
|
16
|
+
Use this to see existing tsconfig paths and baseUrl values.
|
|
17
|
+
They can reveal stable work areas, but they are not a list to copy.
|
|
18
|
+
|
|
19
|
+
Add pathAliases for long paths that are likely to appear repeatedly in AIB requests.
|
|
20
|
+
Prefer aliases for real work areas, package roots, or deep directories.
|
|
21
|
+
|
|
22
|
+
A good alias:
|
|
23
|
+
- saves meaningful path tokens;
|
|
24
|
+
- points to a stable work area;
|
|
25
|
+
- is easy to recognize later.
|
|
26
|
+
|
|
27
|
+
A bad alias:
|
|
28
|
+
- duplicates a short path like "src": "src", "packages": "packages", "scripts": "scripts";
|
|
29
|
+
- points to a rarely used folder;
|
|
30
|
+
- mirrors the directory tree without a workflow reason.
|
|
31
|
+
|
|
32
|
+
Having 20-30 good aliases is fine for a large repo or monorepo.
|
|
33
|
+
|
|
34
|
+
Example:
|
|
35
|
+
|
|
36
|
+
"pathAliases": {
|
|
37
|
+
"wstore": "apps/web/src/shared/store",
|
|
38
|
+
"wapi": "apps/web/src/shared/api",
|
|
39
|
+
"whooks": "apps/web/src/shared/utils/hooks",
|
|
40
|
+
"pmail": "packages/email/src",
|
|
41
|
+
"putils": "packages/utils/src",
|
|
42
|
+
"arules": "docs/agent/rules"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
After editing aib.json, run:
|
|
46
|
+
|
|
47
|
+
aib sync
|
|
48
|
+
|
|
49
|
+
Verify aliases with a small tree or inspect request:
|
|
50
|
+
|
|
51
|
+
aib inspect --stdin
|
|
52
|
+
|
|
53
|
+
Input:
|
|
54
|
+
tree @<alias> depth=3 +onlyDirs limit=80
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Tree excludes affect directory and file discovery output.
|
|
2
|
+
Graph excludes affect graph counts, hubs, entrypoints, leaves, edges, imports, importedBy, and saved graph views.
|
|
3
|
+
|
|
4
|
+
Built-in excludes already skip common noise such as node_modules, .git, dist, build, out, and .tmp.
|
|
5
|
+
Add config excludes for repository-specific noise.
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
Exclude them explicitly:
|
|
9
|
+
|
|
10
|
+
"inspect.tree.onlyDirs.exclude": [
|
|
11
|
+
"**/*copy",
|
|
12
|
+
"**/*copy/**"
|
|
13
|
+
],
|
|
14
|
+
"inspect.tree.files.exclude": [
|
|
15
|
+
"**/* copy.ts",
|
|
16
|
+
"**/*.generated.ts"
|
|
17
|
+
],
|
|
18
|
+
"inspect.graph.exclude": [
|
|
19
|
+
"**/* copy.ts",
|
|
20
|
+
"**/*.generated.ts",
|
|
21
|
+
"src/generated/**"
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
Prefer narrow patterns for known noise:
|
|
25
|
+
- generated files;
|
|
26
|
+
- local copy/backup folders;
|
|
27
|
+
- build artifacts not already skipped by defaults;
|
|
28
|
+
- vendored or checked-in output.
|
|
29
|
+
|
|
30
|
+
These are common cases, not mandatory rules.
|
|
31
|
+
If the repository needs one of these areas for reasoning or mutation impact checks, do not exclude it.
|
|
32
|
+
|
|
33
|
+
Do not exclude broad source areas to make output smaller.
|
|
34
|
+
If output is too large, use scope, depth, limit, graph view, or graph toggles first.
|
|
35
|
+
|
|
36
|
+
After editing aib.json, run:
|
|
37
|
+
|
|
38
|
+
aib sync
|
|
39
|
+
|
|
40
|
+
Then verify with a compact tree request and the graph view that was noisy.
|
|
41
|
+
|
|
42
|
+
If excluded paths still appear, check the glob pattern against repo-relative paths.
|
|
43
|
+
If important source disappeared, narrow or remove the exclude.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Configure import normalization intent.
|
|
2
|
+
|
|
3
|
+
importNormalize defines default normalization rules for explicit aib imports normalize commands.
|
|
4
|
+
Use it before broad or important import cleanup so the scope, target style, preferred alias, and excludes are stored in aib.json instead of repeated in command arguments.
|
|
5
|
+
|
|
6
|
+
It does not run automatically during move/modulePlan.
|
|
7
|
+
Use importRules for mutation-time import cleanup.
|
|
8
|
+
|
|
9
|
+
Set importNormalize when the intended cleanup has project meaning:
|
|
10
|
+
- adopting a new tsconfig alias across a project area;
|
|
11
|
+
- converting an area to aliases;
|
|
12
|
+
- converting scripts/tools or extracted modules to relative imports;
|
|
13
|
+
- excluding generated or bundled output from normalization.
|
|
14
|
+
|
|
15
|
+
For tiny one-file checks, inline options are fine.
|
|
16
|
+
Before wider cleanup, put the intended rule in config and preview the smallest useful scope.
|
|
17
|
+
|
|
18
|
+
Fields:
|
|
19
|
+
scope repo-relative file or directory scope; most specific scope wins
|
|
20
|
+
to relative|alias|shortestAlias
|
|
21
|
+
preferAlias tsconfig paths pattern used when to=alias
|
|
22
|
+
exclude files, directories, or glob-like patterns to skip
|
|
23
|
+
|
|
24
|
+
to:
|
|
25
|
+
relative rewrite resolved local imports to relative paths
|
|
26
|
+
alias rewrite resolved local imports to a matching tsconfig alias
|
|
27
|
+
shortestAlias rewrite to the shortest valid alias specifier
|
|
28
|
+
|
|
29
|
+
preferAlias:
|
|
30
|
+
@shared/* prefer one alias pattern when several aliases can resolve the same file
|
|
31
|
+
|
|
32
|
+
Alias cleanup:
|
|
33
|
+
|
|
34
|
+
"importNormalize": [
|
|
35
|
+
{
|
|
36
|
+
"scope": "src",
|
|
37
|
+
"to": "shortestAlias",
|
|
38
|
+
"preferAlias": "@/*",
|
|
39
|
+
"exclude": [
|
|
40
|
+
"src/generated",
|
|
41
|
+
"src/**/dist"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
Relative cleanup for scripts/tools:
|
|
47
|
+
|
|
48
|
+
"importNormalize": [
|
|
49
|
+
{
|
|
50
|
+
"scope": "scripts",
|
|
51
|
+
"to": "relative",
|
|
52
|
+
"exclude": [
|
|
53
|
+
"scripts/**/*.cjs",
|
|
54
|
+
"scripts/**/*.mjs"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
If you have not just checked config rules, run:
|
|
60
|
+
|
|
61
|
+
aib config rules
|
|
62
|
+
|
|
63
|
+
After editing aib.json, run:
|
|
64
|
+
|
|
65
|
+
aib sync
|
|
66
|
+
|
|
67
|
+
Then preview the smallest useful scope before applying:
|
|
68
|
+
|
|
69
|
+
aib imports normalize preview <scope>
|
|
70
|
+
|
|
71
|
+
Preview shows counts, sample import rewrites, a planId, and the apply command.
|
|
72
|
+
It does not change project files.
|
|
73
|
+
|
|
74
|
+
If preview changes imports outside the intended area, narrow scope or add exclude.
|
|
75
|
+
|
|
76
|
+
If preview does not use the expected alias, check tsconfig aliases:
|
|
77
|
+
|
|
78
|
+
aib reveal tsaliases
|
|
79
|
+
|
|
80
|
+
If the config and aliases look correct but preview still looks stale or strange, run:
|
|
81
|
+
|
|
82
|
+
aib sync
|
|
83
|
+
|
|
84
|
+
Then preview again.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Use this when move/modulePlan creates imports that do not match the repository style.
|
|
2
|
+
|
|
3
|
+
Do not keep fixing the same generated import style by hand.
|
|
4
|
+
Tune importRules, sync config, then retry the smallest useful mutation before continuing larger mutation work.
|
|
5
|
+
|
|
6
|
+
Check current config:
|
|
7
|
+
|
|
8
|
+
aib config rules
|
|
9
|
+
|
|
10
|
+
importRules control imports created or expanded by move/modulePlan mutation cleanup.
|
|
11
|
+
They do not rewrite the whole project.
|
|
12
|
+
|
|
13
|
+
AIB starts from IDE/TS import preferences.
|
|
14
|
+
For mutation cleanup, matching importRules in aib.json take priority.
|
|
15
|
+
Do not assume IDE/TS defaults match the repo style.
|
|
16
|
+
|
|
17
|
+
Fields:
|
|
18
|
+
scope repo-relative file or directory scope; most specific scope wins
|
|
19
|
+
specifier relative|shortest|project-relative|non-relative
|
|
20
|
+
ending auto|minimal|index|js
|
|
21
|
+
builtin node|bare
|
|
22
|
+
unusedImports remove|preserve
|
|
23
|
+
|
|
24
|
+
Defaults:
|
|
25
|
+
specifier omitted IDE/TS decides
|
|
26
|
+
ending omitted IDE/TS decides
|
|
27
|
+
builtin omitted keep TS/project builtin style
|
|
28
|
+
unusedImports omitted keep unused imports
|
|
29
|
+
|
|
30
|
+
specifier:
|
|
31
|
+
relative best for local relative imports
|
|
32
|
+
shortest best for shortest valid alias/path output
|
|
33
|
+
project-relative best for root-relative project imports
|
|
34
|
+
non-relative best for package or alias imports
|
|
35
|
+
|
|
36
|
+
ending:
|
|
37
|
+
minimal best for extensionless TS imports
|
|
38
|
+
js best for ESM-style TS projects that require .js
|
|
39
|
+
auto leaves the decision to TypeScript
|
|
40
|
+
index best for explicit index import style
|
|
41
|
+
|
|
42
|
+
builtin:
|
|
43
|
+
node path -> node:path; best for explicit Node builtin imports
|
|
44
|
+
bare node:path -> path; best for bare Node builtin imports
|
|
45
|
+
omit field keeps TypeScript/project output; add builtin if agents keep fixing this manually
|
|
46
|
+
|
|
47
|
+
unusedImports:
|
|
48
|
+
remove clean unused imports in mutation-touched files
|
|
49
|
+
preserve keep unused imports
|
|
50
|
+
omit same as preserve
|
|
51
|
+
|
|
52
|
+
Mutation-touched files are files where TS produced edits: source/target files and any reference/update files TS changed.
|
|
53
|
+
Recommended value: remove
|
|
54
|
+
|
|
55
|
+
If the repository has one import style, use one broad rule:
|
|
56
|
+
|
|
57
|
+
"importRules": [
|
|
58
|
+
{
|
|
59
|
+
"scope": ".",
|
|
60
|
+
"specifier": "shortest",
|
|
61
|
+
"ending": "auto",
|
|
62
|
+
"builtin": "node",
|
|
63
|
+
"unusedImports": "remove"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
Use scoped rules only when areas differ by style, for example packages use aliases but scripts use relative imports:
|
|
68
|
+
|
|
69
|
+
"importRules": [
|
|
70
|
+
{
|
|
71
|
+
"scope": "packages",
|
|
72
|
+
"specifier": "shortest",
|
|
73
|
+
"ending": "auto",
|
|
74
|
+
"builtin": "node",
|
|
75
|
+
"unusedImports": "remove"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"scope": "scripts",
|
|
79
|
+
"specifier": "relative",
|
|
80
|
+
"ending": "auto",
|
|
81
|
+
"builtin": "node",
|
|
82
|
+
"unusedImports": "remove"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
|
|
86
|
+
Use the most specific scope that matches the real convention.
|
|
87
|
+
Do not add scoped rules just because directories exist.
|
|
88
|
+
|
|
89
|
+
After editing aib.json, run:
|
|
90
|
+
|
|
91
|
+
aib sync
|
|
92
|
+
|
|
93
|
+
Then rerun the smallest affected move/modulePlan preview or execute request.
|
|
94
|
+
If imports are still wrong, update importRules again before doing more manual cleanup.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
AIB syncs and watches visible tsconfigs.
|
|
2
|
+
Keep real app/package configs visible.
|
|
3
|
+
Exclude nested workspaces, seed projects, snapshots, backups, copied apps, or other non-primary projects.
|
|
4
|
+
|
|
5
|
+
Do not exclude real package/app configs just to reduce output.
|
|
6
|
+
|
|
7
|
+
Check which TypeScript configs AIB will sync and watch:
|
|
8
|
+
|
|
9
|
+
aib reveal tsconfigs +all
|
|
10
|
+
|
|
11
|
+
If output includes non-primary projects, exclude them:
|
|
12
|
+
|
|
13
|
+
"sync.tsconfig.exclude": [
|
|
14
|
+
"dev-seed/**",
|
|
15
|
+
"snapshots/**"
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
After editing aib.json, run:
|
|
19
|
+
|
|
20
|
+
aib sync
|
|
21
|
+
|
|
22
|
+
Then check again:
|
|
23
|
+
|
|
24
|
+
aib reveal tsconfigs +all
|
|
25
|
+
|
|
26
|
+
Visible tsconfigs should describe the active project surface.
|
|
27
|
+
Excluded tsconfigs should be things the agent should not use for setup decisions.
|
|
28
|
+
|
|
29
|
+
Use +nec only when you need to compare visible configs with config-excluded configs:
|
|
30
|
+
|
|
31
|
+
aib reveal tsconfigs +nec
|