@automaton-labs/aib 0.0.5 → 0.0.7
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 +4 -2
- package/dist/commands/apply-module-plan.js +3 -3
- package/dist/commands/background-command.js +2 -0
- package/dist/commands/captured-input.js +1 -2
- package/dist/commands/config-command.js +2 -1
- package/dist/commands/config-output.js +10 -8
- package/dist/commands/control-plane-command.js +1 -0
- package/dist/commands/declaration-command.js +7 -0
- package/dist/commands/declaration-execution-cache.js +1 -0
- package/dist/commands/declaration-format.js +1 -0
- package/dist/commands/declaration-preview-cache.js +2 -0
- package/dist/commands/doctor.js +3 -1
- package/dist/commands/execution-command.js +1 -1
- package/dist/commands/file-command.js +1 -0
- package/dist/commands/file-move-to-dir-execution-cache.js +1 -0
- package/dist/commands/file-move-to-dir-preview-cache.js +2 -0
- package/dist/commands/file-move-to-dir.js +5 -0
- package/dist/commands/file-mutation-runtime.js +1 -0
- package/dist/commands/file-refactor-batch-execution-cache.js +1 -0
- package/dist/commands/file-refactor-batch-preview-cache.js +2 -0
- package/dist/commands/file-refactor-batch.js +5 -0
- package/dist/commands/file-rename-execution-cache.js +1 -0
- package/dist/commands/file-rename-preview-cache.js +2 -0
- package/dist/commands/file-rename.js +5 -0
- package/dist/commands/help-command.js +5 -5
- package/dist/commands/host-command.js +1 -0
- package/dist/commands/inspect-cycles.js +3 -3
- package/dist/commands/inspect-format.js +15 -15
- package/dist/commands/inspect-tree.js +2 -2
- package/dist/commands/inspect.js +12 -12
- package/dist/commands/move-to-file.js +2 -2
- package/dist/commands/ota-command.js +2 -0
- package/dist/commands/quick-read.js +8 -8
- package/dist/commands/refactor-batch.js +4 -4
- package/dist/commands/rename-entities.js +4 -4
- package/dist/commands/result-view.js +6 -5
- package/dist/commands/session-workspace.js +7 -7
- package/dist/commands/worker-command.js +1 -0
- package/dist/config/defaults.js +1 -1
- package/dist/config/env-vars.js +1 -1
- package/dist/config/path-aliases.js +1 -1
- package/dist/config/resolve-command-alias.js +1 -1
- package/dist/config/workspace-root.js +3 -3
- package/dist/content/content-bundle.js +1 -1
- package/dist/dsl/aib-dsl.js +1 -1
- package/dist/dsl/declaration-dsl.js +1 -0
- package/dist/dsl/file-move-to-dir-dsl.js +1 -0
- package/dist/dsl/file-refactor-batch-dsl.js +1 -0
- package/dist/dsl/file-rename-dsl.js +1 -0
- package/dist/help/bootstrap.bash.md +907 -0
- package/dist/help/bootstrap.md +105 -144
- package/dist/help/{json/bootstrap.md → bootstrap.pwsh.md} +216 -397
- package/dist/help/docs/dsl.md +4 -3
- package/dist/help/docs/file.move.md +46 -0
- package/dist/help/docs/file.rename.md +35 -0
- package/dist/help/docs/help-format.md +4 -7
- package/dist/help/docs/inspect.code.md +5 -5
- package/dist/help/docs/inspect.deps.md +7 -7
- package/dist/help/docs/inspect.file.md +2 -1
- package/dist/help/docs/inspect.graph.md +3 -3
- package/dist/help/docs/inspect.md +5 -5
- package/dist/help/docs/mutation.md +23 -13
- package/dist/help/docs/patterns.md +1 -5
- package/dist/help/docs/qr.md +7 -22
- package/dist/help/docs/quick-map.md +1 -0
- package/dist/help/docs/recipe.file-layout.md +15 -0
- package/dist/help/docs/rg.md +22 -0
- package/dist/help/docs/selectors.md +3 -2
- package/dist/help/docs/session.md +1 -1
- package/dist/help/dsl/bootstrap.bash.md +907 -0
- package/dist/help/dsl/bootstrap.md +105 -144
- package/dist/help/{json/full.md → dsl/bootstrap.pwsh.md} +216 -397
- package/dist/help/dsl/docs/dsl.md +4 -3
- package/dist/help/dsl/docs/file.move.md +46 -0
- package/dist/help/dsl/docs/file.rename.md +35 -0
- package/dist/help/dsl/docs/help-format.md +4 -7
- package/dist/help/dsl/docs/inspect.code.md +5 -5
- package/dist/help/dsl/docs/inspect.deps.md +7 -7
- package/dist/help/dsl/docs/inspect.file.md +2 -1
- package/dist/help/dsl/docs/inspect.graph.md +3 -3
- package/dist/help/dsl/docs/inspect.md +5 -5
- package/dist/help/dsl/docs/mutation.md +23 -13
- package/dist/help/dsl/docs/patterns.md +1 -5
- package/dist/help/dsl/docs/qr.md +7 -22
- package/dist/help/dsl/docs/quick-map.md +1 -0
- package/dist/help/dsl/docs/recipe.file-layout.md +15 -0
- package/dist/help/dsl/docs/rg.md +22 -0
- package/dist/help/dsl/docs/selectors.md +3 -2
- package/dist/help/dsl/docs/session.md +1 -1
- package/dist/help/dsl/full.md +105 -144
- package/dist/help/dsl/help-index.md +44 -0
- package/dist/help/dsl/tokens/qr.inline.examples.md +2 -0
- package/dist/help/dsl/tokens/stdin.examples.bash.md +8 -0
- package/dist/help/dsl/tokens/stdin.examples.pwsh.md +8 -0
- package/dist/help/dsl/tokens/stdin.examples.with-qr.bash.md +12 -0
- package/dist/help/dsl/tokens/stdin.examples.with-qr.pwsh.md +12 -0
- package/dist/help/dsl/topics/dsl.md +4 -3
- package/dist/help/dsl/topics/file.move.md +44 -0
- package/dist/help/dsl/topics/file.rename.md +33 -0
- package/dist/help/dsl/topics/help-format.md +4 -7
- package/dist/help/dsl/topics/inspect.code.md +5 -5
- package/dist/help/dsl/topics/inspect.deps.md +7 -7
- package/dist/help/dsl/topics/inspect.file.md +2 -1
- package/dist/help/dsl/topics/inspect.graph.md +3 -3
- package/dist/help/dsl/topics/inspect.md +5 -5
- package/dist/help/dsl/topics/mutation.md +23 -13
- package/dist/help/dsl/topics/patterns.md +1 -5
- package/dist/help/dsl/topics/qr.md +7 -22
- package/dist/help/dsl/topics/quick-map.md +1 -0
- package/dist/help/dsl/topics/recipe.file-layout.md +13 -0
- package/dist/help/dsl/topics/rg.md +20 -0
- package/dist/help/dsl/topics/selectors.md +3 -2
- package/dist/help/dsl/topics/session.md +1 -1
- package/dist/help/full.md +105 -144
- package/dist/help/help-index.md +44 -0
- package/dist/help/help-meta.json +45 -29
- package/dist/help/index.md +32 -75
- package/dist/help/tokens/qr.inline.examples.md +2 -0
- package/dist/help/tokens/stdin.examples.bash.md +8 -0
- package/dist/help/tokens/stdin.examples.pwsh.md +8 -0
- package/dist/help/tokens/stdin.examples.with-qr.bash.md +12 -0
- package/dist/help/tokens/stdin.examples.with-qr.pwsh.md +12 -0
- package/dist/help/topics/dsl.md +4 -3
- package/dist/help/topics/file.move.md +44 -0
- package/dist/help/topics/file.rename.md +33 -0
- package/dist/help/topics/help-format.md +4 -7
- package/dist/help/topics/inspect.code.md +5 -5
- package/dist/help/topics/inspect.deps.md +7 -7
- package/dist/help/topics/inspect.file.md +2 -1
- package/dist/help/topics/inspect.graph.md +3 -3
- package/dist/help/topics/inspect.md +5 -5
- package/dist/help/topics/mutation.md +23 -13
- package/dist/help/topics/patterns.md +1 -5
- package/dist/help/topics/qr.md +7 -22
- package/dist/help/topics/quick-map.md +1 -0
- package/dist/help/topics/recipe.file-layout.md +13 -0
- package/dist/help/topics/rg.md +20 -0
- package/dist/help/topics/selectors.md +3 -2
- package/dist/help/topics/session.md +1 -1
- package/dist/host/capabilities.js +1 -0
- package/dist/ide-launch/common.cjs +162 -162
- package/dist/managed-host/extension-vsix-resolver.js +1 -1
- package/dist/managed-host/manage-serve-web-host.cjs +141 -141
- package/dist/managed-host/serve-web-autostart.js +1 -1
- package/dist/managed-host/serve-web-host.cjs +1985 -1660
- package/dist/observability/config.js +1 -1
- package/dist/payloads/read-stdin-json.js +1 -1
- package/dist/rg-wrapper/core.js +6 -0
- package/dist/rg-wrapper/options.js +1 -0
- package/dist/rtk-wrapper/core.js +2 -0
- package/dist/runtime/input-source.js +1 -1
- package/dist/runtime/managed-runtime-provisioning.js +1 -1
- package/dist/runtime/run-command.js +1 -1
- package/dist/selectors/parse-entities.js +1 -1
- package/dist/session/daemon-state.js +2 -0
- package/dist/session/server.js +7 -6
- package/dist/shared/errors.js +14 -13
- package/dist/shared/operations.js +1 -1
- package/dist/shared/protocol.js +1 -1
- package/dist/shared/routes.js +1 -1
- package/dist/shared/stdin-examples.js +1 -0
- package/dist/shared/types.js +1 -1
- package/dist/tool-runtime/runtime-tools.js +1 -0
- package/dist/tracing/trace.js +5 -3
- package/dist/workers/control-plane/aib-control-plane-worker.cjs +80 -0
- package/dist/workers/control-plane/client-config.default.json +3 -0
- package/dist/workers/product-storage.js +1 -0
- package/dist/workers/registry.js +1 -0
- package/extension/vscode-refactor-bridge-extension.vsix +0 -0
- package/package.json +6 -4
- package/runtimes/launcher/linux-x64/aib +0 -0
- package/runtimes/launcher/win-x64/aib.exe +0 -0
- package/runtimes/tools/rg/darwin-arm64/rg +0 -0
- package/runtimes/tools/rg/darwin-x64/rg +0 -0
- package/runtimes/tools/rg/linux-arm64/rg +0 -0
- package/runtimes/tools/rg/linux-x64/rg +0 -0
- package/runtimes/tools/rg/manifest.json +36 -0
- package/runtimes/tools/rg/win32-x64/rg.exe +0 -0
- package/runtimes/tools/rtk/darwin-arm64/rtk +0 -0
- package/runtimes/tools/rtk/darwin-x64/rtk +0 -0
- package/runtimes/tools/rtk/linux-arm64/rtk +0 -0
- package/runtimes/tools/rtk/linux-x64/rtk +0 -0
- package/runtimes/tools/rtk/manifest.json +36 -0
- package/runtimes/tools/rtk/win32-x64/rtk.exe +0 -0
- package/scripts/provision-runtime.cjs +25 -1
- package/dist/help/json/docs/basics.md +0 -15
- package/dist/help/json/docs/config-setup.aliases.md +0 -56
- package/dist/help/json/docs/config-setup.excludes.md +0 -45
- package/dist/help/json/docs/config-setup.import-normalize.md +0 -86
- package/dist/help/json/docs/config-setup.import-rules.md +0 -96
- package/dist/help/json/docs/config-setup.tsconfigs.md +0 -33
- package/dist/help/json/docs/dsl.md +0 -25
- package/dist/help/json/docs/first-setup.md +0 -292
- package/dist/help/json/docs/help-format.md +0 -12
- package/dist/help/json/docs/help-protocol.md +0 -26
- package/dist/help/json/docs/imports.normalize.md +0 -47
- package/dist/help/json/docs/inspect.code.md +0 -41
- package/dist/help/json/docs/inspect.cycles.md +0 -38
- package/dist/help/json/docs/inspect.deps.md +0 -46
- package/dist/help/json/docs/inspect.duplicates.md +0 -65
- package/dist/help/json/docs/inspect.exports.md +0 -40
- package/dist/help/json/docs/inspect.file.md +0 -38
- package/dist/help/json/docs/inspect.graph.md +0 -139
- package/dist/help/json/docs/inspect.imports.md +0 -15
- package/dist/help/json/docs/inspect.md +0 -88
- package/dist/help/json/docs/inspect.members.md +0 -32
- package/dist/help/json/docs/inspect.tree.md +0 -32
- package/dist/help/json/docs/inspect.usages.md +0 -61
- package/dist/help/json/docs/modulePlan.md +0 -73
- package/dist/help/json/docs/move.md +0 -56
- package/dist/help/json/docs/mutation.md +0 -65
- package/dist/help/json/docs/patterns.md +0 -76
- package/dist/help/json/docs/prefs.md +0 -40
- package/dist/help/json/docs/qr.md +0 -37
- package/dist/help/json/docs/quick-map.md +0 -30
- package/dist/help/json/docs/refactor.batch.md +0 -72
- package/dist/help/json/docs/rename.md +0 -47
- package/dist/help/json/docs/reveal.md +0 -30
- package/dist/help/json/docs/selectors.md +0 -23
- package/dist/help/json/docs/session.md +0 -77
- package/dist/help/json/docs/view.md +0 -30
- package/dist/help/json/snippets/agents.md +0 -14
- package/dist/help/json/topics/basics.md +0 -13
- package/dist/help/json/topics/config-setup.aliases.md +0 -54
- package/dist/help/json/topics/config-setup.excludes.md +0 -43
- package/dist/help/json/topics/config-setup.import-normalize.md +0 -84
- package/dist/help/json/topics/config-setup.import-rules.md +0 -94
- package/dist/help/json/topics/config-setup.tsconfigs.md +0 -31
- package/dist/help/json/topics/dsl.md +0 -23
- package/dist/help/json/topics/first-setup.md +0 -290
- package/dist/help/json/topics/help-format.md +0 -10
- package/dist/help/json/topics/help-protocol.md +0 -24
- package/dist/help/json/topics/imports.normalize.md +0 -45
- package/dist/help/json/topics/inspect.code.md +0 -39
- package/dist/help/json/topics/inspect.cycles.md +0 -36
- package/dist/help/json/topics/inspect.deps.md +0 -44
- package/dist/help/json/topics/inspect.duplicates.md +0 -37
- package/dist/help/json/topics/inspect.exports.md +0 -38
- package/dist/help/json/topics/inspect.file.md +0 -36
- package/dist/help/json/topics/inspect.graph.md +0 -137
- package/dist/help/json/topics/inspect.imports.md +0 -13
- package/dist/help/json/topics/inspect.md +0 -86
- package/dist/help/json/topics/inspect.members.md +0 -30
- package/dist/help/json/topics/inspect.tree.md +0 -22
- package/dist/help/json/topics/inspect.usages.md +0 -59
- package/dist/help/json/topics/modulePlan.md +0 -60
- package/dist/help/json/topics/move.md +0 -46
- package/dist/help/json/topics/mutation.md +0 -63
- package/dist/help/json/topics/patterns.md +0 -74
- package/dist/help/json/topics/prefs.md +0 -38
- package/dist/help/json/topics/qr.md +0 -35
- package/dist/help/json/topics/quick-map.md +0 -28
- package/dist/help/json/topics/refactor.batch.md +0 -61
- package/dist/help/json/topics/rename.md +0 -42
- package/dist/help/json/topics/reveal.md +0 -28
- package/dist/help/json/topics/selectors.md +0 -21
- package/dist/help/json/topics/session.md +0 -59
- package/dist/help/json/topics/view.md +0 -28
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
AIB
|
|
2
|
-
|
|
3
|
-
aib is a local CLI for TS/JS code work backed by IDE and TypeScript APIs.
|
|
4
|
-
It can inspect symbols, usages, dependencies, duplicates, focused code, and run IDE-backed mutations.
|
|
5
|
-
|
|
6
|
-
aib is designed for agent workflows:
|
|
7
|
-
batch requests, compact text output, session handles, captured inputs, and reusable outputs.
|
|
8
|
-
|
|
9
|
-
Inline commands omit the aib prefix.
|
|
10
|
-
When you see:
|
|
11
|
-
session prefs get
|
|
1
|
+
AIB
|
|
12
2
|
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
aib is a local CLI for TS/JS code work backed by IDE and TypeScript APIs.
|
|
4
|
+
It can inspect symbols, usages, dependencies, duplicates, focused code, and run IDE-backed mutations.
|
|
15
5
|
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
aib is designed for agent workflows:
|
|
7
|
+
batch requests, compact text output, session handles, and reusable artifacts.
|
|
8
|
+
|
|
9
|
+
Inline commands omit the aib prefix.
|
|
10
|
+
When you see:
|
|
11
|
+
session clear
|
|
12
|
+
|
|
13
|
+
Run:
|
|
14
|
+
aib session clear
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
+
PowerShell:
|
|
20
|
+
@'
|
|
21
|
+
<input>
|
|
22
22
|
'@ | aib <command> --stdin
|
|
23
23
|
|
|
24
|
+
@'
|
|
25
|
+
tree . +onlyDirs limit=20
|
|
26
|
+
'@ | aib inspect --stdin
|
|
27
|
+
|
|
24
28
|
Basics
|
|
25
29
|
|
|
26
|
-
Use the active session while you work.
|
|
27
|
-
Reuse captured inputs when editing them is cheaper than rebuilding large JSON.
|
|
30
|
+
Use the active session while you work.
|
|
28
31
|
|
|
29
32
|
Examples are patterns, not limits.
|
|
30
33
|
Feature sections show common high-value uses, not every valid use.
|
|
31
34
|
Adapt requests to the task: combine features, batch related questions, and skip steps when you already have enough context.
|
|
32
35
|
|
|
33
|
-
Prefer batch
|
|
34
|
-
One request can inspect/mutate several files/entities and save reusable
|
|
36
|
+
Prefer batch DSL instead of one-off inline calls.
|
|
37
|
+
One request can inspect/mutate several files/entities and save reusable artifacts when supported.
|
|
35
38
|
Use one-off commands only for small checks/changes.
|
|
36
39
|
|
|
37
40
|
For mutations, aib asks TS/IDE refactors to update affected references and imports.
|
|
@@ -63,7 +66,7 @@ Use normal text search when the question is just text.
|
|
|
63
66
|
|
|
64
67
|
For a first pass in a new codebase, map directories before reading files:
|
|
65
68
|
|
|
66
|
-
tree src depth
|
|
69
|
+
aib inspect tree src --depth 5 --only-dirs --limit 200
|
|
67
70
|
|
|
68
71
|
Start compact for broad scans.
|
|
69
72
|
Use summary, locations, or local graph views first when output could be large.
|
|
@@ -73,10 +76,6 @@ If output hides data and shows `view: aib:res_<id>`, use `aib view ...` to fetch
|
|
|
73
76
|
Compact output is a starting point, not a substitute for needed code.
|
|
74
77
|
Fetch exact code when correctness depends on implementation details.
|
|
75
78
|
|
|
76
|
-
Use prefs when the current phase repeats the same output shape.
|
|
77
|
-
Turn details off when they stop helping.
|
|
78
|
-
Turn them back on when they matter.
|
|
79
|
-
|
|
80
79
|
For mutation commands, set the shell/tool harness timeout to 3 minutes.
|
|
81
80
|
|
|
82
81
|
If a mutation command times out or returns no final output, use:
|
|
@@ -102,7 +101,7 @@ If move/modulePlan imports do not match the repo style, run:
|
|
|
102
101
|
aib help config-setup.import-rules
|
|
103
102
|
|
|
104
103
|
If you are about to change import style across files, add or adopt tsconfig aliases, or clean imports repeatedly, run:
|
|
105
|
-
aib help config-setup.import-normalize
|
|
104
|
+
aib help config-setup.import-normalize imports.normalize
|
|
106
105
|
|
|
107
106
|
If tree/graph output includes known repo noise, run:
|
|
108
107
|
aib help config-setup.excludes
|
|
@@ -197,7 +196,7 @@ Start by creating or selecting your session.
|
|
|
197
196
|
Create it once, then reuse it.
|
|
198
197
|
Do not create a new session for every command or subtask.
|
|
199
198
|
|
|
200
|
-
Session stores
|
|
199
|
+
Session stores saved artifacts and aliases.
|
|
201
200
|
|
|
202
201
|
Prefer short session names:
|
|
203
202
|
aa, tr, qa, a2
|
|
@@ -212,7 +211,7 @@ aib -s <name> <command>
|
|
|
212
211
|
Or bind this shell:
|
|
213
212
|
AIB=<name>
|
|
214
213
|
|
|
215
|
-
If you want to prune session
|
|
214
|
+
If you want to prune session data, use:
|
|
216
215
|
session clear
|
|
217
216
|
|
|
218
217
|
After clear, keep using the same session.
|
|
@@ -225,62 +224,6 @@ Reusable index handles look like:
|
|
|
225
224
|
|
|
226
225
|
Pass index handles back to the matching inspect command with `--from-file` or `from` in DSL.
|
|
227
226
|
|
|
228
|
-
Every JSON stdin/from request is captured in the active session.
|
|
229
|
-
|
|
230
|
-
Latest captured input:
|
|
231
|
-
<session-dir>/inputs/<kind>/_last.json
|
|
232
|
-
|
|
233
|
-
Handle:
|
|
234
|
-
aib:input:<kind>:last
|
|
235
|
-
|
|
236
|
-
Use --from when editing the captured input costs less than rebuilding the request.
|
|
237
|
-
This is usually true for large batches, partial failures, or multi-step mutation plans.
|
|
238
|
-
For small one-off requests, write a corrected request instead.
|
|
239
|
-
|
|
240
|
-
Example:
|
|
241
|
-
A refactor batch moves symbols into 5 files.
|
|
242
|
-
The first 2 moves are done, and the 3rd fails in TypeScript.
|
|
243
|
-
Edit <session-dir>/inputs/refactor/_last.json:
|
|
244
|
-
- remove the already completed moves
|
|
245
|
-
- change or remove the failed move
|
|
246
|
-
- keep the remaining moves
|
|
247
|
-
|
|
248
|
-
Then rerun:
|
|
249
|
-
aib refactor batch <command> --from aib:input:refactor:last
|
|
250
|
-
|
|
251
|
-
Prefs
|
|
252
|
-
|
|
253
|
-
Prefs change defaults for the active session.
|
|
254
|
-
Use them when you want repeated CLI behavior without repeating request fields.
|
|
255
|
-
|
|
256
|
-
Set prefs:
|
|
257
|
-
session prefs set <name> <value> [<name> <value>...]
|
|
258
|
-
|
|
259
|
-
Example:
|
|
260
|
-
session prefs set inspect.graph.hubs false inspect.graph.leaves false
|
|
261
|
-
|
|
262
|
-
Show prefs:
|
|
263
|
-
session prefs get [prefix] [--all]
|
|
264
|
-
|
|
265
|
-
By default, get shows session overrides.
|
|
266
|
-
--all includes defaults.
|
|
267
|
-
prefix filters keys.
|
|
268
|
-
|
|
269
|
-
boolean = true|false
|
|
270
|
-
N = integer
|
|
271
|
-
|
|
272
|
-
Available prefs:
|
|
273
|
-
inspect.code.maxNonEmptyLines N
|
|
274
|
-
inspect.usages.maxLocations N
|
|
275
|
-
inspect.usages.maxCodeBlocks N
|
|
276
|
-
inspect.members.maxItems N
|
|
277
|
-
inspect.members.all boolean
|
|
278
|
-
inspect.graph.hubs boolean
|
|
279
|
-
inspect.graph.entrypoints boolean
|
|
280
|
-
inspect.graph.leaves boolean
|
|
281
|
-
inspect.graph.edges boolean
|
|
282
|
-
inspect.graph.symbolUsage boolean
|
|
283
|
-
|
|
284
227
|
Selectors identify symbols when names are ambiguous.
|
|
285
228
|
Use plain names when they are unambiguous.
|
|
286
229
|
Use selectors when aib reports ambiguity or when different symbol kinds share a name.
|
|
@@ -299,9 +242,10 @@ c-Name class
|
|
|
299
242
|
i-Name interface
|
|
300
243
|
t-Name type
|
|
301
244
|
v-name variable
|
|
302
|
-
e-Name enum
|
|
303
|
-
|
|
304
|
-
|
|
245
|
+
e-Name enum
|
|
246
|
+
ns-Name namespace
|
|
247
|
+
m-name method, usually with parent
|
|
248
|
+
p-name property, usually with parent
|
|
305
249
|
|
|
306
250
|
DSL request model:
|
|
307
251
|
- directives set defaults for following requests
|
|
@@ -313,9 +257,10 @@ DSL request model:
|
|
|
313
257
|
- For one-off file operations, pass the path directly.
|
|
314
258
|
|
|
315
259
|
Syntax:
|
|
316
|
-
@file <path> default file
|
|
317
|
-
@source <path> default sourceFile for mutations
|
|
318
|
-
|
|
260
|
+
@file <path> default file
|
|
261
|
+
@source <path> default sourceFile for mutations
|
|
262
|
+
@base <dir> default base dir for file mutations
|
|
263
|
+
op arg arg key=value request
|
|
319
264
|
+flag boolean true
|
|
320
265
|
-flag boolean false
|
|
321
266
|
>name save reusable artifact when supported
|
|
@@ -357,67 +302,51 @@ local import cycles cycles
|
|
|
357
302
|
Cycles are available but not expanded in bootstrap:
|
|
358
303
|
aib help inspect.cycles
|
|
359
304
|
|
|
360
|
-
Prefer one batch
|
|
361
|
-
Top-level fields are defaults for every request.
|
|
362
|
-
A request without op uses the top-level op.
|
|
363
|
-
A request without file/scope/target uses the top-level value when applicable.
|
|
364
|
-
Each request may override any default.
|
|
365
|
-
|
|
366
|
-
Batch example:
|
|
367
|
-
|
|
368
|
-
Run:
|
|
369
|
-
aib inspect --stdin
|
|
370
|
-
|
|
371
|
-
Input:
|
|
372
|
-
{
|
|
373
|
-
"file": "src/service.ts",
|
|
374
|
-
"requests": [
|
|
375
|
-
{ "op": "file" },
|
|
376
|
-
{ "op": "members", "entity": "Service" },
|
|
377
|
-
{
|
|
378
|
-
"op": "code",
|
|
379
|
-
"entities": [
|
|
380
|
-
{ "parent": "Service", "entities": ["render", "reset"] },
|
|
381
|
-
"normalize"
|
|
382
|
-
],
|
|
383
|
-
"show": true,
|
|
384
|
-
"save": "service-focus"
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
"op": "usages",
|
|
388
|
-
"target": "src/service.ts",
|
|
389
|
-
"entity": "normalize",
|
|
390
|
-
"scope": "src",
|
|
391
|
-
"detail": "locations"
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
"op": "duplicates",
|
|
395
|
-
"scope": "src/scripts",
|
|
396
|
-
"detail": "summary",
|
|
397
|
-
"limit": 20
|
|
398
|
-
}
|
|
399
|
-
]
|
|
400
|
-
}
|
|
305
|
+
Prefer one batch DSL request for related questions.
|
|
401
306
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
307
|
+
Batch example:
|
|
308
|
+
|
|
309
|
+
Run:
|
|
310
|
+
aib inspect --stdin
|
|
311
|
+
|
|
312
|
+
Input:
|
|
313
|
+
@file @svc/service.ts
|
|
314
|
+
file
|
|
315
|
+
file @svc/serviceB.ts
|
|
316
|
+
members Service
|
|
317
|
+
code entities=[Service.{render,reset},normalize,default,IIFE#1]
|
|
318
|
+
code @svc/serviceC.ts ServiceC -ranges
|
|
319
|
+
usages target=@svc/service.ts normalize scope=src detail=loc
|
|
320
|
+
duplicates scope=src/scripts detail=sum limit=20
|
|
321
|
+
|
|
322
|
+
How inheritance works above:
|
|
323
|
+
@file sets the default file for following file-like inspect requests.
|
|
324
|
+
file uses @svc/service.ts.
|
|
325
|
+
file @svc/serviceB.ts overrides the default for that one request.
|
|
326
|
+
members Service uses @svc/service.ts because it has no file override.
|
|
327
|
+
code entities=[...] also uses @svc/service.ts.
|
|
328
|
+
code @svc/serviceC.ts ServiceC overrides the file and disables ranges for that request.
|
|
329
|
+
usages sets its own target/scope/detail because it searches references instead of reading the default file.
|
|
330
|
+
duplicates sets its own scope because it scans a directory.
|
|
331
|
+
|
|
332
|
+
Inspect request fields:
|
|
333
|
+
|
|
334
|
+
file source file; first positional path, @file path, or file=path
|
|
335
|
+
target file or directory to analyze; target=path
|
|
336
|
+
scope where to search; scope=path or scope=[a,b]
|
|
337
|
+
entity one symbol selector; entity=name or positional selector
|
|
338
|
+
entities several symbol selectors; entities=[...] or positional selectors
|
|
339
|
+
parent parent class/interface for methods/properties; Parent.member or parent=Name
|
|
340
|
+
ranges include line/range metadata
|
|
341
|
+
exclude skip paths or names depending on operation; exclude=[...]
|
|
342
|
+
detail output level; detail=sum|loc|code
|
|
343
|
+
all return all items; +all
|
|
344
|
+
limit max items in one page; limit=N
|
|
345
|
+
offset page offset; offset=N
|
|
346
|
+
save save reusable artifact where supported; >name
|
|
347
|
+
|
|
348
|
+
Operation sections list their supported controls.
|
|
349
|
+
Specific explains controls whose meaning is local to that operation.
|
|
421
350
|
|
|
422
351
|
Inspect File
|
|
423
352
|
|
|
@@ -426,8 +355,9 @@ Exported declarations are marked in the output.
|
|
|
426
355
|
It shows what lives in the file before you decide whether to read code.
|
|
427
356
|
|
|
428
357
|
Good for:
|
|
429
|
-
- mapping
|
|
358
|
+
- mapping a file
|
|
430
359
|
- listing top-level declarations
|
|
360
|
+
- seeing default exports, decorators, IIFEs, and runtime calls
|
|
431
361
|
- checking whether a file contains real declarations or mostly re-exports
|
|
432
362
|
|
|
433
363
|
Do not add limit just in case.
|
|
@@ -446,15 +376,9 @@ Use -ranges to show names without ranges.
|
|
|
446
376
|
Run:
|
|
447
377
|
aib inspect --stdin
|
|
448
378
|
|
|
449
|
-
Input:
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
"file": "src/service.ts",
|
|
453
|
-
"requests": [
|
|
454
|
-
{ "ranges": true },
|
|
455
|
-
{ "file": "src/index.ts", "localOnly": true }
|
|
456
|
-
]
|
|
457
|
-
}
|
|
379
|
+
Input:
|
|
380
|
+
file @svc/service.ts +localOnly
|
|
381
|
+
file src/index.ts
|
|
458
382
|
|
|
459
383
|
inspect file src/service.ts [--ranges] [--local-only]
|
|
460
384
|
|
|
@@ -504,14 +428,8 @@ Run:
|
|
|
504
428
|
aib inspect --stdin
|
|
505
429
|
|
|
506
430
|
Input:
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
"file": "src/service.ts",
|
|
510
|
-
"requests": [
|
|
511
|
-
{ "ranges": true },
|
|
512
|
-
{ "file": "src/index.ts", "resolveStar": true }
|
|
513
|
-
]
|
|
514
|
-
}
|
|
431
|
+
exports src/service.ts +ranges
|
|
432
|
+
exports src/index.ts +resolveStar
|
|
515
433
|
|
|
516
434
|
inspect exports src/service.ts [--ranges] [--resolve-star]
|
|
517
435
|
|
|
@@ -531,16 +449,8 @@ file, entity, entities, ranges, limit, offset, all
|
|
|
531
449
|
Run:
|
|
532
450
|
aib inspect --stdin
|
|
533
451
|
|
|
534
|
-
Input:
|
|
535
|
-
|
|
536
|
-
"file": "src/service.ts",
|
|
537
|
-
"op": "members",
|
|
538
|
-
"limit": 12,
|
|
539
|
-
"requests": [
|
|
540
|
-
{ "entity": "Service" },
|
|
541
|
-
{ "entities": ["ServiceOptions", "WsOptions"], "all": true }
|
|
542
|
-
]
|
|
543
|
-
}
|
|
452
|
+
Input:
|
|
453
|
+
members @svc/service.ts entities=[Service,ServiceOptions] +all +ranges
|
|
544
454
|
|
|
545
455
|
inspect members src/service.ts Service [--limit N] [--offset N] [--all] [--ranges]
|
|
546
456
|
|
|
@@ -550,7 +460,7 @@ Use code to fetch exact declarations or members.
|
|
|
550
460
|
It returns focused code without reading the whole file.
|
|
551
461
|
|
|
552
462
|
Good for:
|
|
553
|
-
- reading a known function, class, method, or
|
|
463
|
+
- reading a known function, class, method, declaration, `default`, or `IIFE#N`
|
|
554
464
|
- fetching several related code blocks in one request
|
|
555
465
|
- keeping context focused on code needed for the current task
|
|
556
466
|
|
|
@@ -564,55 +474,33 @@ Defaults: +show +ranges
|
|
|
564
474
|
Use -show for names/ranges only.
|
|
565
475
|
Use -ranges for source without ranges.
|
|
566
476
|
|
|
567
|
-
Run:
|
|
568
|
-
aib inspect --stdin
|
|
569
|
-
|
|
570
|
-
Input:
|
|
571
|
-
{
|
|
572
|
-
|
|
573
|
-
"op": "code",
|
|
574
|
-
"requests": [
|
|
575
|
-
{
|
|
576
|
-
"entities": [
|
|
577
|
-
{ "parent": "Service", "entities": ["render", "reset"] },
|
|
578
|
-
"normalize"
|
|
579
|
-
],
|
|
580
|
-
"show": true,
|
|
581
|
-
"save": "service-focus"
|
|
582
|
-
}
|
|
583
|
-
]
|
|
584
|
-
}
|
|
477
|
+
Run:
|
|
478
|
+
aib inspect --stdin
|
|
479
|
+
|
|
480
|
+
Input:
|
|
481
|
+
code @svc/service.ts Service.{render,reset} normalize
|
|
482
|
+
code @svc/serviceB.ts ServiceB.{constructor} default IIFE#1
|
|
585
483
|
|
|
586
484
|
Inspect Deps
|
|
587
485
|
|
|
588
486
|
Use deps to see what one entity depends on inside its file.
|
|
589
487
|
It separates type-only dependencies from runtime value dependencies.
|
|
590
488
|
|
|
591
|
-
Good for:
|
|
592
|
-
- checking what a symbol may need when moved or extracted
|
|
593
|
-
- spotting nearby types, constants, or helpers tied to one entity
|
|
594
|
-
- deciding whether one symbol is standalone or tied to nearby declarations
|
|
489
|
+
Good for:
|
|
490
|
+
- checking what a symbol may need when moved or extracted
|
|
491
|
+
- spotting nearby types, constants, or helpers tied to one entity
|
|
492
|
+
- deciding whether one symbol is standalone or tied to nearby declarations
|
|
595
493
|
- debugging mutation failures caused by local dependency shape
|
|
596
494
|
|
|
597
495
|
Controls:
|
|
598
496
|
file, entity, entities, parent
|
|
599
497
|
|
|
600
|
-
Run:
|
|
601
|
-
aib inspect --stdin
|
|
602
|
-
|
|
603
|
-
Input:
|
|
604
|
-
{
|
|
605
|
-
|
|
606
|
-
"op": "deps",
|
|
607
|
-
"requests": [
|
|
608
|
-
{ "entity": "createService" },
|
|
609
|
-
{
|
|
610
|
-
"entities": [
|
|
611
|
-
{ "parent": "Service", "entities": ["render", "reset"] }
|
|
612
|
-
]
|
|
613
|
-
}
|
|
614
|
-
]
|
|
615
|
-
}
|
|
498
|
+
Run:
|
|
499
|
+
aib inspect --stdin
|
|
500
|
+
|
|
501
|
+
Input:
|
|
502
|
+
deps @svc/service.ts entities=[createService,normalize,Service.{render,reset}]
|
|
503
|
+
deps @svc/serviceB.ts ServiceB.{constructor} getConfig
|
|
616
504
|
|
|
617
505
|
Inspect Usages
|
|
618
506
|
|
|
@@ -627,8 +515,8 @@ Good for:
|
|
|
627
515
|
- confirming whether extracted or renamed code still has callers
|
|
628
516
|
- getting caller locations or caller code without broad file scans
|
|
629
517
|
|
|
630
|
-
Use
|
|
631
|
-
Use
|
|
518
|
+
Use detail=code directly when you already need caller code.
|
|
519
|
+
Use detail=loc + save when the first question is impact shape and you may expand only part of it later.
|
|
632
520
|
|
|
633
521
|
Controls:
|
|
634
522
|
target, scope, entity, entities, parent, detail, limit, all, save, includeTarget
|
|
@@ -640,17 +528,10 @@ Run:
|
|
|
640
528
|
aib inspect --stdin
|
|
641
529
|
|
|
642
530
|
Input:
|
|
643
|
-
{
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
"createService",
|
|
648
|
-
{ "parent": "Service", "entities": ["render", "reset"] }
|
|
649
|
-
],
|
|
650
|
-
"scope": ["src/app", "src/tests"],
|
|
651
|
-
"detail": "locations",
|
|
652
|
-
"save": "service-usages"
|
|
653
|
-
}
|
|
531
|
+
usages target=@svc/service.ts entities=[createService,normalize,Service.{render,reset}] scope=[src/app,src/tests] detail=loc >service-usages
|
|
532
|
+
|
|
533
|
+
Expand saved usages when needed:
|
|
534
|
+
inspect usages --from-file aib:usages:service-usages --focus createService --detail code --limit 20
|
|
654
535
|
|
|
655
536
|
Inspect Graph
|
|
656
537
|
|
|
@@ -670,7 +551,7 @@ Use graph for file-level connectivity.
|
|
|
670
551
|
|
|
671
552
|
Model:
|
|
672
553
|
build graph: scope + view + save
|
|
673
|
-
query graph:
|
|
554
|
+
query graph: from + focus + output toggles
|
|
674
555
|
|
|
675
556
|
view controls what enters the saved graph.
|
|
676
557
|
focus only expands details for files already inside it.
|
|
@@ -679,7 +560,7 @@ If focus misses a file, rebuild with wider scope or view.
|
|
|
679
560
|
Default view:
|
|
680
561
|
directory scope -> local
|
|
681
562
|
file or multiple scopes -> neighbors
|
|
682
|
-
|
|
563
|
+
from -> uses the saved graph
|
|
683
564
|
|
|
684
565
|
Views:
|
|
685
566
|
local only files inside scope; best directory map
|
|
@@ -687,11 +568,11 @@ neighbors direct import neighborhood; best file-centered map
|
|
|
687
568
|
expanded wider neighborhood; more output
|
|
688
569
|
|
|
689
570
|
Scope choice:
|
|
690
|
-
scope
|
|
691
|
-
scope
|
|
692
|
-
scope
|
|
571
|
+
scope=src creates a broad reusable map for src.
|
|
572
|
+
scope=src/services is cheaper for local work.
|
|
573
|
+
scope=[src/services,src/components] compares known areas without mapping all src.
|
|
693
574
|
|
|
694
|
-
After you understand which graph sections matter, hide the rest with
|
|
575
|
+
After you understand which graph sections matter, hide the rest with flags.
|
|
695
576
|
Graph can be noisy; shape it for the current task.
|
|
696
577
|
|
|
697
578
|
Controls:
|
|
@@ -709,29 +590,14 @@ Run:
|
|
|
709
590
|
aib inspect --stdin
|
|
710
591
|
|
|
711
592
|
Input:
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
"requests": [
|
|
715
|
-
{
|
|
716
|
-
"scope": "src/services",
|
|
717
|
-
"view": "local",
|
|
718
|
-
"save": "services-graph"
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
"fromFile": "aib:graph:services-graph",
|
|
722
|
-
"focus": ["src/services/users.ts", "src/services/admins.ts"],
|
|
723
|
-
"symbolUsage": true,
|
|
724
|
-
"edges": false
|
|
725
|
-
}
|
|
726
|
-
]
|
|
727
|
-
}
|
|
593
|
+
graph scope=@svc view=local >services-graph
|
|
594
|
+
graph from=aib:graph:services-graph focus=[@svc/users.ts,@svc/admins.ts] +symbolUsage -edges
|
|
728
595
|
|
|
729
596
|
Focus saved graph later:
|
|
730
|
-
inspect graph --from-file aib:graph:services-graph --focus
|
|
597
|
+
inspect graph --from-file aib:graph:services-graph --focus @svc/messages.ts --focus @svc/posts.ts --symbol-usage
|
|
731
598
|
|
|
732
|
-
Inline graph focus can add focus and symbolUsage.
|
|
733
|
-
|
|
734
|
-
Use JSON request fields or prefs for section control.
|
|
599
|
+
Inline graph focus can add focus and symbolUsage.
|
|
600
|
+
Use DSL or request flags to hide sections such as edges/hubs/entrypoints/leaves.
|
|
735
601
|
|
|
736
602
|
Inspect Tree
|
|
737
603
|
|
|
@@ -780,30 +646,37 @@ Run:
|
|
|
780
646
|
aib inspect --stdin
|
|
781
647
|
|
|
782
648
|
Input:
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
"detail": "summary",
|
|
786
|
-
"limit": 20
|
|
787
|
-
}
|
|
649
|
+
duplicates scope=src detail=sum exclude=[config,baseUrl] kinds=[t,i] limit=20
|
|
650
|
+
duplicates scope=@svc detail=loc pathExclude=[src/generated,"**/* copy.ts"] limit=20
|
|
788
651
|
|
|
789
652
|
Mutation
|
|
790
653
|
|
|
791
|
-
Mutation commands change code through TS/IDE
|
|
792
|
-
Successful mutations update affected references and imports.
|
|
793
|
-
|
|
654
|
+
Mutation commands change code and files through TS/IDE-backed operations.
|
|
655
|
+
Successful mutations update affected references and imports.
|
|
656
|
+
|
|
657
|
+
Semantic mutations change TypeScript symbols/declarations.
|
|
658
|
+
File mutations change file layout.
|
|
659
|
+
|
|
794
660
|
After a successful mutation, do not manually patch the same imports unless aib reports a follow-up or checks show a real issue.
|
|
795
661
|
|
|
796
|
-
If
|
|
662
|
+
If mutation imports do not match the repo style, run:
|
|
797
663
|
aib help config-setup.import-rules
|
|
798
664
|
|
|
799
|
-
AIB mutations are designed to reduce manual checking.
|
|
800
|
-
Your job is to express the intent in DSL.
|
|
801
|
-
AIB's job is to convert that intent into code changes.
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
665
|
+
AIB mutations are designed to reduce manual checking.
|
|
666
|
+
Your job is to express the intent in DSL.
|
|
667
|
+
AIB's job is to convert that intent into code changes.
|
|
668
|
+
|
|
669
|
+
Choose the mutation by intent:
|
|
670
|
+
rename - rename TypeScript symbols
|
|
671
|
+
move toFile - move TypeScript declarations into one file
|
|
672
|
+
modulePlan - split one source file into several modules
|
|
673
|
+
file move toDir - move whole files into directories
|
|
674
|
+
file rename - rename whole files.
|
|
675
|
+
|
|
676
|
+
Do not read all changed files just because a mutation touched them.
|
|
677
|
+
That defeats the purpose of using AIB for mechanical refactors.
|
|
678
|
+
|
|
679
|
+
If the command succeeds, the requested mechanical change was applied.
|
|
807
680
|
After failure or partial success, use the output to decide the next request.
|
|
808
681
|
|
|
809
682
|
When running mutation commands, set the harness timeout to 3 minutes.
|
|
@@ -816,7 +689,7 @@ preview inspect planned edits, then apply by id
|
|
|
816
689
|
apply write a previewed change
|
|
817
690
|
execute write immediately
|
|
818
691
|
|
|
819
|
-
Use execute for routine
|
|
692
|
+
Use execute for routine requests.
|
|
820
693
|
|
|
821
694
|
Use preview/apply when you are learning a mutation command, or when one request contains a large multi-step change that you want to inspect before writing files.
|
|
822
695
|
Typical examples: a huge modulePlan or refactor batch.
|
|
@@ -825,13 +698,10 @@ preview/apply uses more tool calls and more output tokens.
|
|
|
825
698
|
preview validates input and planned edits, but writing files can still hit a TS/IDE refactor error.
|
|
826
699
|
execute writes immediately and reports what changed.
|
|
827
700
|
|
|
828
|
-
If a mutation cannot be completed, aib reports the failed part
|
|
829
|
-
For large or partial requests, edit the captured input and rerun the remaining or changed intent.
|
|
830
|
-
For small requests, write a corrected request instead.
|
|
701
|
+
If a mutation cannot be completed, aib reports the failed part.
|
|
831
702
|
|
|
832
|
-
Prefer batch
|
|
833
|
-
One request can describe several related changes.
|
|
834
|
-
aib captures JSON input automatically so large failed or partial requests can be edited and rerun.
|
|
703
|
+
Prefer batch DSL for related mutations.
|
|
704
|
+
One request can describe several related changes.
|
|
835
705
|
|
|
836
706
|
When a batch mutation partly fails, split the next request by failure type.
|
|
837
707
|
|
|
@@ -850,13 +720,8 @@ Run:
|
|
|
850
720
|
aib rename execute --stdin
|
|
851
721
|
|
|
852
722
|
Input:
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
"renames": {
|
|
856
|
-
"oldName": "newName",
|
|
857
|
-
"OldService": "NewService"
|
|
858
|
-
}
|
|
859
|
-
}
|
|
723
|
+
@file src/service.ts
|
|
724
|
+
rename oldName->newName OldService->NewService
|
|
860
725
|
|
|
861
726
|
Move
|
|
862
727
|
|
|
@@ -872,12 +737,9 @@ Move several entities into one target:
|
|
|
872
737
|
Run:
|
|
873
738
|
aib move toFile execute --stdin
|
|
874
739
|
|
|
875
|
-
Input:
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
"targetFile": "src/service.helpers.ts",
|
|
879
|
-
"entities": ["oldHelper", "OtherHelper"]
|
|
880
|
-
}
|
|
740
|
+
Input:
|
|
741
|
+
@source src/service.ts
|
|
742
|
+
move src/service.helpers.ts: oldHelper OtherHelper
|
|
881
743
|
|
|
882
744
|
Module Plan
|
|
883
745
|
|
|
@@ -889,7 +751,7 @@ modulePlan orchestrates semantic moves and updates affected references/imports.
|
|
|
889
751
|
If imports created by modulePlan do not match the repo style, run:
|
|
890
752
|
aib help config-setup.import-rules
|
|
891
753
|
|
|
892
|
-
Use expectEmpty when your modulePlan intent is to move all declarations out of the source file.
|
|
754
|
+
Use +expectEmpty when your modulePlan intent is to move all declarations out of the source file.
|
|
893
755
|
It does not change the move behavior; it only asks output to report remaining source declarations if any remain.
|
|
894
756
|
Use it only when remaining declarations would mean the split did not match your intent.
|
|
895
757
|
Do not use it for partial extractions.
|
|
@@ -898,21 +760,15 @@ Split one large source file into several targets:
|
|
|
898
760
|
Run:
|
|
899
761
|
aib modulePlan execute --stdin
|
|
900
762
|
|
|
901
|
-
Input:
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
{
|
|
911
|
-
"target": "src/large-service.core.ts",
|
|
912
|
-
"entities": ["LargeService", "createLargeService"]
|
|
913
|
-
}
|
|
914
|
-
]
|
|
915
|
-
}
|
|
763
|
+
Input:
|
|
764
|
+
@source src/large-service.ts +expectEmpty
|
|
765
|
+
module src/large-service.types.ts: ServiceOptions ServiceMode
|
|
766
|
+
module src/large-service.core.ts: LargeService createLargeService
|
|
767
|
+
|
|
768
|
+
How inheritance works above:
|
|
769
|
+
@source sets the source file once.
|
|
770
|
+
+expectEmpty says no declarations should remain in the source after the plan.
|
|
771
|
+
Each module line declares one target and the entities that should move there.
|
|
916
772
|
|
|
917
773
|
Refactor Batch
|
|
918
774
|
|
|
@@ -927,77 +783,33 @@ Example: rename and move in one request
|
|
|
927
783
|
Run:
|
|
928
784
|
aib refactor batch execute --stdin
|
|
929
785
|
|
|
930
|
-
Input:
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
"op": "rename",
|
|
936
|
-
"renames": {
|
|
937
|
-
"oldHelper": "newHelper",
|
|
938
|
-
"oldType": "newType"
|
|
939
|
-
}
|
|
940
|
-
},
|
|
941
|
-
{
|
|
942
|
-
"op": "move",
|
|
943
|
-
"targetFile": "src/service.helpers.ts",
|
|
944
|
-
"entities": ["newHelper"]
|
|
945
|
-
},
|
|
946
|
-
{
|
|
947
|
-
"op": "move",
|
|
948
|
-
"targetFile": "src/service.types.ts",
|
|
949
|
-
"entities": ["newType"]
|
|
950
|
-
}
|
|
951
|
-
]
|
|
952
|
-
}
|
|
786
|
+
Input:
|
|
787
|
+
@source src/service.ts
|
|
788
|
+
rename oldHelper->newHelper oldType->newType
|
|
789
|
+
move src/service.helpers.ts: newHelper
|
|
790
|
+
move src/service.types.ts: newType
|
|
953
791
|
|
|
954
|
-
|
|
792
|
+
This keeps related mutation intent together:
|
|
793
|
+
rename first, then move the renamed symbols.
|
|
955
794
|
|
|
956
|
-
|
|
957
|
-
It rewrites resolved local import/export specifiers inside a chosen file or directory.
|
|
958
|
-
|
|
959
|
-
Use importNormalize in aib.json for repeated defaults.
|
|
795
|
+
File Move and File Rename
|
|
960
796
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
- cleaning import style after manual edits or broad refactors
|
|
964
|
-
- applying the same import style to a directory without hand-editing files
|
|
965
|
-
- applying new tsconfig aliases after they are added
|
|
966
|
-
|
|
967
|
-
Controls:
|
|
968
|
-
scope file/dir scope to normalize
|
|
969
|
-
to relative|alias|shortestAlias
|
|
970
|
-
preferAlias select one tsconfig paths pattern when several aliases can resolve the same file
|
|
971
|
-
exclude files, directories, or glob-like patterns to skip
|
|
972
|
-
all show all planned edits; avoid on broad directory scopes
|
|
797
|
+
Use file move/rename when the filesystem layout is the intent.
|
|
798
|
+
Do not change filesystem layout manually.
|
|
973
799
|
|
|
974
|
-
|
|
975
|
-
aib
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
Run:
|
|
988
|
-
aib imports normalize preview --stdin
|
|
989
|
-
|
|
990
|
-
Input:
|
|
991
|
-
{
|
|
992
|
-
"scope": "src/core",
|
|
993
|
-
"to": "alias",
|
|
994
|
-
"preferAlias": "@features/*"
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
With matching importNormalize config for this scope or a parent scope, use inline CLI commands:
|
|
998
|
-
|
|
999
|
-
imports normalize preview @svc
|
|
1000
|
-
imports normalize execute @svc
|
|
800
|
+
Focused topics:
|
|
801
|
+
aib help file.move file.rename
|
|
802
|
+
|
|
803
|
+
Layout smell trigger:
|
|
804
|
+
If a directory has many related files sharing a prefix, mixed responsibilities, or files that should be grouped by feature, read:
|
|
805
|
+
aib help recipe.file-layout
|
|
806
|
+
|
|
807
|
+
Imports Normalize
|
|
808
|
+
|
|
809
|
+
Use imports normalize for explicit import-style cleanup.
|
|
810
|
+
|
|
811
|
+
Focused topic:
|
|
812
|
+
aib help imports.normalize
|
|
1001
813
|
|
|
1002
814
|
JS/TS compatibility
|
|
1003
815
|
|
|
@@ -1056,30 +868,37 @@ For focused text reads, prefer qr over cat/Get-Content/type, especially when ali
|
|
|
1056
868
|
Use shell reads only when piping into shell tooling or qr is unavailable.
|
|
1057
869
|
|
|
1058
870
|
Controls:
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
-a all; whole file
|
|
871
|
+
h=N head; first N lines
|
|
872
|
+
t=N tail; last N lines
|
|
873
|
+
o=N l=N range; starting line and line count
|
|
874
|
+
all whole file
|
|
1064
875
|
|
|
1065
|
-
If no window is provided, qr uses
|
|
1066
|
-
If
|
|
876
|
+
If no window is provided, qr uses h=80.
|
|
877
|
+
If all is present, it wins over other window flags.
|
|
1067
878
|
|
|
1068
|
-
|
|
1069
|
-
aib qr
|
|
879
|
+
Inline:
|
|
880
|
+
aib qr @scripts/a.txt h=80 @scripts/b.py o=300 l=50 @logs/app.log all
|
|
1070
881
|
|
|
1071
|
-
|
|
1072
|
-
qr @scripts/a.txt h=80
|
|
1073
|
-
qr @scripts/b.py o=300 l=50
|
|
1074
|
-
qr @scripts/c.md t=120
|
|
1075
|
-
qr @logs/app.log all
|
|
882
|
+
aib rg
|
|
1076
883
|
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
884
|
+
Run ripgrep through AIB.
|
|
885
|
+
|
|
886
|
+
Regular rg:
|
|
887
|
+
rg <args>
|
|
888
|
+
|
|
889
|
+
AIB rg:
|
|
890
|
+
aib rg -- <args>
|
|
891
|
+
|
|
892
|
+
Everything after `--` is passed as normal ripgrep arguments.
|
|
893
|
+
Use the same args you would pass to `rg`.
|
|
894
|
+
Use normal paths in input. Do not use AIB path aliases here.
|
|
895
|
+
|
|
896
|
+
Examples:
|
|
897
|
+
rg -n "TODO" src/core
|
|
898
|
+
aib rg -- -n "TODO" src/core
|
|
1081
899
|
|
|
1082
|
-
|
|
900
|
+
rg -n --column "SomeValue" ws/commands ws/config
|
|
901
|
+
aib rg -- -n --column "SomeValue" ws/commands ws/config
|
|
1083
902
|
|
|
1084
903
|
Need to see TypeScript configs in the repo:
|
|
1085
904
|
aib reveal tsconfigs
|