@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.
Files changed (258) hide show
  1. package/dist/bin/cli.js +4 -2
  2. package/dist/commands/apply-module-plan.js +3 -3
  3. package/dist/commands/background-command.js +2 -0
  4. package/dist/commands/captured-input.js +1 -2
  5. package/dist/commands/config-command.js +2 -1
  6. package/dist/commands/config-output.js +10 -8
  7. package/dist/commands/control-plane-command.js +1 -0
  8. package/dist/commands/declaration-command.js +7 -0
  9. package/dist/commands/declaration-execution-cache.js +1 -0
  10. package/dist/commands/declaration-format.js +1 -0
  11. package/dist/commands/declaration-preview-cache.js +2 -0
  12. package/dist/commands/doctor.js +3 -1
  13. package/dist/commands/execution-command.js +1 -1
  14. package/dist/commands/file-command.js +1 -0
  15. package/dist/commands/file-move-to-dir-execution-cache.js +1 -0
  16. package/dist/commands/file-move-to-dir-preview-cache.js +2 -0
  17. package/dist/commands/file-move-to-dir.js +5 -0
  18. package/dist/commands/file-mutation-runtime.js +1 -0
  19. package/dist/commands/file-refactor-batch-execution-cache.js +1 -0
  20. package/dist/commands/file-refactor-batch-preview-cache.js +2 -0
  21. package/dist/commands/file-refactor-batch.js +5 -0
  22. package/dist/commands/file-rename-execution-cache.js +1 -0
  23. package/dist/commands/file-rename-preview-cache.js +2 -0
  24. package/dist/commands/file-rename.js +5 -0
  25. package/dist/commands/help-command.js +5 -5
  26. package/dist/commands/host-command.js +1 -0
  27. package/dist/commands/inspect-cycles.js +3 -3
  28. package/dist/commands/inspect-format.js +15 -15
  29. package/dist/commands/inspect-tree.js +2 -2
  30. package/dist/commands/inspect.js +12 -12
  31. package/dist/commands/move-to-file.js +2 -2
  32. package/dist/commands/ota-command.js +2 -0
  33. package/dist/commands/quick-read.js +8 -8
  34. package/dist/commands/refactor-batch.js +4 -4
  35. package/dist/commands/rename-entities.js +4 -4
  36. package/dist/commands/result-view.js +6 -5
  37. package/dist/commands/session-workspace.js +7 -7
  38. package/dist/commands/worker-command.js +1 -0
  39. package/dist/config/defaults.js +1 -1
  40. package/dist/config/env-vars.js +1 -1
  41. package/dist/config/path-aliases.js +1 -1
  42. package/dist/config/resolve-command-alias.js +1 -1
  43. package/dist/config/workspace-root.js +3 -3
  44. package/dist/content/content-bundle.js +1 -1
  45. package/dist/dsl/aib-dsl.js +1 -1
  46. package/dist/dsl/declaration-dsl.js +1 -0
  47. package/dist/dsl/file-move-to-dir-dsl.js +1 -0
  48. package/dist/dsl/file-refactor-batch-dsl.js +1 -0
  49. package/dist/dsl/file-rename-dsl.js +1 -0
  50. package/dist/help/bootstrap.bash.md +907 -0
  51. package/dist/help/bootstrap.md +105 -144
  52. package/dist/help/{json/bootstrap.md → bootstrap.pwsh.md} +216 -397
  53. package/dist/help/docs/dsl.md +4 -3
  54. package/dist/help/docs/file.move.md +46 -0
  55. package/dist/help/docs/file.rename.md +35 -0
  56. package/dist/help/docs/help-format.md +4 -7
  57. package/dist/help/docs/inspect.code.md +5 -5
  58. package/dist/help/docs/inspect.deps.md +7 -7
  59. package/dist/help/docs/inspect.file.md +2 -1
  60. package/dist/help/docs/inspect.graph.md +3 -3
  61. package/dist/help/docs/inspect.md +5 -5
  62. package/dist/help/docs/mutation.md +23 -13
  63. package/dist/help/docs/patterns.md +1 -5
  64. package/dist/help/docs/qr.md +7 -22
  65. package/dist/help/docs/quick-map.md +1 -0
  66. package/dist/help/docs/recipe.file-layout.md +15 -0
  67. package/dist/help/docs/rg.md +22 -0
  68. package/dist/help/docs/selectors.md +3 -2
  69. package/dist/help/docs/session.md +1 -1
  70. package/dist/help/dsl/bootstrap.bash.md +907 -0
  71. package/dist/help/dsl/bootstrap.md +105 -144
  72. package/dist/help/{json/full.md → dsl/bootstrap.pwsh.md} +216 -397
  73. package/dist/help/dsl/docs/dsl.md +4 -3
  74. package/dist/help/dsl/docs/file.move.md +46 -0
  75. package/dist/help/dsl/docs/file.rename.md +35 -0
  76. package/dist/help/dsl/docs/help-format.md +4 -7
  77. package/dist/help/dsl/docs/inspect.code.md +5 -5
  78. package/dist/help/dsl/docs/inspect.deps.md +7 -7
  79. package/dist/help/dsl/docs/inspect.file.md +2 -1
  80. package/dist/help/dsl/docs/inspect.graph.md +3 -3
  81. package/dist/help/dsl/docs/inspect.md +5 -5
  82. package/dist/help/dsl/docs/mutation.md +23 -13
  83. package/dist/help/dsl/docs/patterns.md +1 -5
  84. package/dist/help/dsl/docs/qr.md +7 -22
  85. package/dist/help/dsl/docs/quick-map.md +1 -0
  86. package/dist/help/dsl/docs/recipe.file-layout.md +15 -0
  87. package/dist/help/dsl/docs/rg.md +22 -0
  88. package/dist/help/dsl/docs/selectors.md +3 -2
  89. package/dist/help/dsl/docs/session.md +1 -1
  90. package/dist/help/dsl/full.md +105 -144
  91. package/dist/help/dsl/help-index.md +44 -0
  92. package/dist/help/dsl/tokens/qr.inline.examples.md +2 -0
  93. package/dist/help/dsl/tokens/stdin.examples.bash.md +8 -0
  94. package/dist/help/dsl/tokens/stdin.examples.pwsh.md +8 -0
  95. package/dist/help/dsl/tokens/stdin.examples.with-qr.bash.md +12 -0
  96. package/dist/help/dsl/tokens/stdin.examples.with-qr.pwsh.md +12 -0
  97. package/dist/help/dsl/topics/dsl.md +4 -3
  98. package/dist/help/dsl/topics/file.move.md +44 -0
  99. package/dist/help/dsl/topics/file.rename.md +33 -0
  100. package/dist/help/dsl/topics/help-format.md +4 -7
  101. package/dist/help/dsl/topics/inspect.code.md +5 -5
  102. package/dist/help/dsl/topics/inspect.deps.md +7 -7
  103. package/dist/help/dsl/topics/inspect.file.md +2 -1
  104. package/dist/help/dsl/topics/inspect.graph.md +3 -3
  105. package/dist/help/dsl/topics/inspect.md +5 -5
  106. package/dist/help/dsl/topics/mutation.md +23 -13
  107. package/dist/help/dsl/topics/patterns.md +1 -5
  108. package/dist/help/dsl/topics/qr.md +7 -22
  109. package/dist/help/dsl/topics/quick-map.md +1 -0
  110. package/dist/help/dsl/topics/recipe.file-layout.md +13 -0
  111. package/dist/help/dsl/topics/rg.md +20 -0
  112. package/dist/help/dsl/topics/selectors.md +3 -2
  113. package/dist/help/dsl/topics/session.md +1 -1
  114. package/dist/help/full.md +105 -144
  115. package/dist/help/help-index.md +44 -0
  116. package/dist/help/help-meta.json +45 -29
  117. package/dist/help/index.md +32 -75
  118. package/dist/help/tokens/qr.inline.examples.md +2 -0
  119. package/dist/help/tokens/stdin.examples.bash.md +8 -0
  120. package/dist/help/tokens/stdin.examples.pwsh.md +8 -0
  121. package/dist/help/tokens/stdin.examples.with-qr.bash.md +12 -0
  122. package/dist/help/tokens/stdin.examples.with-qr.pwsh.md +12 -0
  123. package/dist/help/topics/dsl.md +4 -3
  124. package/dist/help/topics/file.move.md +44 -0
  125. package/dist/help/topics/file.rename.md +33 -0
  126. package/dist/help/topics/help-format.md +4 -7
  127. package/dist/help/topics/inspect.code.md +5 -5
  128. package/dist/help/topics/inspect.deps.md +7 -7
  129. package/dist/help/topics/inspect.file.md +2 -1
  130. package/dist/help/topics/inspect.graph.md +3 -3
  131. package/dist/help/topics/inspect.md +5 -5
  132. package/dist/help/topics/mutation.md +23 -13
  133. package/dist/help/topics/patterns.md +1 -5
  134. package/dist/help/topics/qr.md +7 -22
  135. package/dist/help/topics/quick-map.md +1 -0
  136. package/dist/help/topics/recipe.file-layout.md +13 -0
  137. package/dist/help/topics/rg.md +20 -0
  138. package/dist/help/topics/selectors.md +3 -2
  139. package/dist/help/topics/session.md +1 -1
  140. package/dist/host/capabilities.js +1 -0
  141. package/dist/ide-launch/common.cjs +162 -162
  142. package/dist/managed-host/extension-vsix-resolver.js +1 -1
  143. package/dist/managed-host/manage-serve-web-host.cjs +141 -141
  144. package/dist/managed-host/serve-web-autostart.js +1 -1
  145. package/dist/managed-host/serve-web-host.cjs +1985 -1660
  146. package/dist/observability/config.js +1 -1
  147. package/dist/payloads/read-stdin-json.js +1 -1
  148. package/dist/rg-wrapper/core.js +6 -0
  149. package/dist/rg-wrapper/options.js +1 -0
  150. package/dist/rtk-wrapper/core.js +2 -0
  151. package/dist/runtime/input-source.js +1 -1
  152. package/dist/runtime/managed-runtime-provisioning.js +1 -1
  153. package/dist/runtime/run-command.js +1 -1
  154. package/dist/selectors/parse-entities.js +1 -1
  155. package/dist/session/daemon-state.js +2 -0
  156. package/dist/session/server.js +7 -6
  157. package/dist/shared/errors.js +14 -13
  158. package/dist/shared/operations.js +1 -1
  159. package/dist/shared/protocol.js +1 -1
  160. package/dist/shared/routes.js +1 -1
  161. package/dist/shared/stdin-examples.js +1 -0
  162. package/dist/shared/types.js +1 -1
  163. package/dist/tool-runtime/runtime-tools.js +1 -0
  164. package/dist/tracing/trace.js +5 -3
  165. package/dist/workers/control-plane/aib-control-plane-worker.cjs +80 -0
  166. package/dist/workers/control-plane/client-config.default.json +3 -0
  167. package/dist/workers/product-storage.js +1 -0
  168. package/dist/workers/registry.js +1 -0
  169. package/extension/vscode-refactor-bridge-extension.vsix +0 -0
  170. package/package.json +6 -4
  171. package/runtimes/launcher/linux-x64/aib +0 -0
  172. package/runtimes/launcher/win-x64/aib.exe +0 -0
  173. package/runtimes/tools/rg/darwin-arm64/rg +0 -0
  174. package/runtimes/tools/rg/darwin-x64/rg +0 -0
  175. package/runtimes/tools/rg/linux-arm64/rg +0 -0
  176. package/runtimes/tools/rg/linux-x64/rg +0 -0
  177. package/runtimes/tools/rg/manifest.json +36 -0
  178. package/runtimes/tools/rg/win32-x64/rg.exe +0 -0
  179. package/runtimes/tools/rtk/darwin-arm64/rtk +0 -0
  180. package/runtimes/tools/rtk/darwin-x64/rtk +0 -0
  181. package/runtimes/tools/rtk/linux-arm64/rtk +0 -0
  182. package/runtimes/tools/rtk/linux-x64/rtk +0 -0
  183. package/runtimes/tools/rtk/manifest.json +36 -0
  184. package/runtimes/tools/rtk/win32-x64/rtk.exe +0 -0
  185. package/scripts/provision-runtime.cjs +25 -1
  186. package/dist/help/json/docs/basics.md +0 -15
  187. package/dist/help/json/docs/config-setup.aliases.md +0 -56
  188. package/dist/help/json/docs/config-setup.excludes.md +0 -45
  189. package/dist/help/json/docs/config-setup.import-normalize.md +0 -86
  190. package/dist/help/json/docs/config-setup.import-rules.md +0 -96
  191. package/dist/help/json/docs/config-setup.tsconfigs.md +0 -33
  192. package/dist/help/json/docs/dsl.md +0 -25
  193. package/dist/help/json/docs/first-setup.md +0 -292
  194. package/dist/help/json/docs/help-format.md +0 -12
  195. package/dist/help/json/docs/help-protocol.md +0 -26
  196. package/dist/help/json/docs/imports.normalize.md +0 -47
  197. package/dist/help/json/docs/inspect.code.md +0 -41
  198. package/dist/help/json/docs/inspect.cycles.md +0 -38
  199. package/dist/help/json/docs/inspect.deps.md +0 -46
  200. package/dist/help/json/docs/inspect.duplicates.md +0 -65
  201. package/dist/help/json/docs/inspect.exports.md +0 -40
  202. package/dist/help/json/docs/inspect.file.md +0 -38
  203. package/dist/help/json/docs/inspect.graph.md +0 -139
  204. package/dist/help/json/docs/inspect.imports.md +0 -15
  205. package/dist/help/json/docs/inspect.md +0 -88
  206. package/dist/help/json/docs/inspect.members.md +0 -32
  207. package/dist/help/json/docs/inspect.tree.md +0 -32
  208. package/dist/help/json/docs/inspect.usages.md +0 -61
  209. package/dist/help/json/docs/modulePlan.md +0 -73
  210. package/dist/help/json/docs/move.md +0 -56
  211. package/dist/help/json/docs/mutation.md +0 -65
  212. package/dist/help/json/docs/patterns.md +0 -76
  213. package/dist/help/json/docs/prefs.md +0 -40
  214. package/dist/help/json/docs/qr.md +0 -37
  215. package/dist/help/json/docs/quick-map.md +0 -30
  216. package/dist/help/json/docs/refactor.batch.md +0 -72
  217. package/dist/help/json/docs/rename.md +0 -47
  218. package/dist/help/json/docs/reveal.md +0 -30
  219. package/dist/help/json/docs/selectors.md +0 -23
  220. package/dist/help/json/docs/session.md +0 -77
  221. package/dist/help/json/docs/view.md +0 -30
  222. package/dist/help/json/snippets/agents.md +0 -14
  223. package/dist/help/json/topics/basics.md +0 -13
  224. package/dist/help/json/topics/config-setup.aliases.md +0 -54
  225. package/dist/help/json/topics/config-setup.excludes.md +0 -43
  226. package/dist/help/json/topics/config-setup.import-normalize.md +0 -84
  227. package/dist/help/json/topics/config-setup.import-rules.md +0 -94
  228. package/dist/help/json/topics/config-setup.tsconfigs.md +0 -31
  229. package/dist/help/json/topics/dsl.md +0 -23
  230. package/dist/help/json/topics/first-setup.md +0 -290
  231. package/dist/help/json/topics/help-format.md +0 -10
  232. package/dist/help/json/topics/help-protocol.md +0 -24
  233. package/dist/help/json/topics/imports.normalize.md +0 -45
  234. package/dist/help/json/topics/inspect.code.md +0 -39
  235. package/dist/help/json/topics/inspect.cycles.md +0 -36
  236. package/dist/help/json/topics/inspect.deps.md +0 -44
  237. package/dist/help/json/topics/inspect.duplicates.md +0 -37
  238. package/dist/help/json/topics/inspect.exports.md +0 -38
  239. package/dist/help/json/topics/inspect.file.md +0 -36
  240. package/dist/help/json/topics/inspect.graph.md +0 -137
  241. package/dist/help/json/topics/inspect.imports.md +0 -13
  242. package/dist/help/json/topics/inspect.md +0 -86
  243. package/dist/help/json/topics/inspect.members.md +0 -30
  244. package/dist/help/json/topics/inspect.tree.md +0 -22
  245. package/dist/help/json/topics/inspect.usages.md +0 -59
  246. package/dist/help/json/topics/modulePlan.md +0 -60
  247. package/dist/help/json/topics/move.md +0 -46
  248. package/dist/help/json/topics/mutation.md +0 -63
  249. package/dist/help/json/topics/patterns.md +0 -74
  250. package/dist/help/json/topics/prefs.md +0 -38
  251. package/dist/help/json/topics/qr.md +0 -35
  252. package/dist/help/json/topics/quick-map.md +0 -28
  253. package/dist/help/json/topics/refactor.batch.md +0 -61
  254. package/dist/help/json/topics/rename.md +0 -42
  255. package/dist/help/json/topics/reveal.md +0 -28
  256. package/dist/help/json/topics/selectors.md +0 -21
  257. package/dist/help/json/topics/session.md +0 -59
  258. package/dist/help/json/topics/view.md +0 -28
@@ -0,0 +1,3 @@
1
+ {
2
+ "schemaVersion": 1
3
+ }
@@ -0,0 +1 @@
1
+ "use strict";var o=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.productStorageRoot=u;const n=o(require("node:os")),t=o(require("node:path")),r="aib",s="AIB_PRODUCT_STORAGE_DIR";function u(){const e=process.env[s];return e?.trim()?t.default.resolve(e):process.platform==="win32"&&process.env.LOCALAPPDATA?t.default.join(process.env.LOCALAPPDATA,r):process.env.XDG_STATE_HOME?t.default.join(process.env.XDG_STATE_HOME,r):t.default.join(n.default.homedir(),".local","state",r)}
@@ -0,0 +1 @@
1
+ "use strict";var w=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.defaultWorkerRegistryPath=E,exports.readWorkerRegistry=p,exports.resolveWorkerRoute=g,exports.parseWorkerRegistry=h;const d=w(require("node:fs")),c=w(require("node:path")),u=require("../shared/errors"),_=require("./product-storage");function E(){return c.default.join((0,_.productStorageRoot)(),"workers","worker-routes.json")}function p(e=E()){if(!d.default.existsSync(e))throw new u.CliError("WORKER_REGISTRY_NOT_FOUND","Worker registry was not found.",{registryPath:e,hint:"Run the control-plane worker with --manifest to fetch and activate remote worker routes."});let r;try{r=JSON.parse(d.default.readFileSync(e,"utf8"))}catch(t){throw new u.CliError("WORKER_REGISTRY_MALFORMED","Worker registry is not valid JSON.",{registryPath:e,error:t instanceof Error?t.message:String(t)})}return h(r,e)}function g(e){const r=c.default.resolve(e.registryPath??E()),t=p(r),o=t.routes.find(s=>s.route===e.route);if(!o)throw new u.CliError("WORKER_ROUTE_NOT_FOUND",`Worker route was not found: ${e.route}`,{route:e.route,registryPath:r,availableRoutes:t.routes.map(s=>s.route).sort()});if(!o.enabled)throw new u.CliError("WORKER_ROUTE_DISABLED",`Worker route is disabled: ${e.route}`,{route:e.route,registryPath:r});if(o.minCliVersion&&!v(e.cliVersion,o.minCliVersion))throw new u.CliError("WORKER_ROUTE_INCOMPATIBLE",`Worker route requires AIB ${o.minCliVersion}.`,{route:e.route,registryPath:r,cliVersion:e.cliVersion,minCliVersion:o.minCliVersion});const i=(0,_.productStorageRoot)(),n=O(i,o,r);if(!d.default.existsSync(n)||!d.default.statSync(n).isFile())throw new u.CliError("WORKER_ENTRY_NOT_FOUND","Worker entry file was not found.",{route:e.route,registryPath:r,entry:o.entry,script:n});return{registryPath:r,productStorageRoot:i,route:o,script:n}}function O(e,r,t){if(r.entry.startsWith("worker-bundle:")){const i=r.entry.slice(14);if(!i||!/^[a-zA-Z0-9._-]+$/.test(i))throw new u.CliError("WORKER_BUNDLE_ENTRY_INVALID","Worker bundle entry is invalid.",{route:r.route,registryPath:t,entry:r.entry});const n=c.default.join(e,"workers","bundles",i,"activation-status.json"),s=I(n),a=s?.active&&typeof s.active=="object"&&!Array.isArray(s.active)?s.active:null,l=typeof a?.entry=="string"?a.entry:null;if(!l)throw new u.CliError("WORKER_BUNDLE_NOT_ACTIVE","Worker bundle has no active version.",{route:r.route,workerId:i,statusPath:n});const f=m(e,l);if(!f)throw new u.CliError("WORKER_BUNDLE_ENTRY_UNSAFE","Worker bundle active entry must resolve inside product storage.",{route:r.route,workerId:i,statusPath:n,activeEntry:l});return f}const o=m(e,r.entry);if(!o)throw new u.CliError("WORKER_ENTRY_UNSAFE","Worker entry must resolve inside product storage.",{route:r.route,registryPath:t,entry:r.entry,productStorageRoot:e});return o}function h(e,r="<memory>"){const t=W(e,"worker registry");if(t.schemaVersion!==1)throw new u.CliError("WORKER_REGISTRY_INVALID","Worker registry schemaVersion must be 1.",{registryPath:r});const o=t.routes;if(!Array.isArray(o))throw new u.CliError("WORKER_REGISTRY_INVALID","Worker registry routes must be an array.",{registryPath:r});const i=o.map((s,a)=>b(s,a,r)),n=new Set;for(const s of i){if(n.has(s.route))throw new u.CliError("WORKER_REGISTRY_INVALID",`Duplicate worker route: ${s.route}`,{registryPath:r,route:s.route});n.add(s.route)}return{schemaVersion:1,...typeof t.generatedAt=="string"?{generatedAt:t.generatedAt}:{},...typeof t.registryVersion=="string"?{registryVersion:t.registryVersion}:{},routes:i}}function b(e,r,t){const o=W(e,`worker route ${r}`),i=R(o.route,"route",r,t),n=R(o.workerId,"workerId",r,t),s=R(o.version,"version",r,t),a=R(o.entry,"entry",r,t),l=o.argsMode===void 0?"passthrough":o.argsMode,f=o.output===void 0?"json":o.output;if(l!=="passthrough")throw y("argsMode must be passthrough",r,t);if(f!=="json")throw y("output must be json",r,t);return{route:i,workerId:n,version:s,entry:a,argsMode:"passthrough",output:"json",enabled:o.enabled!==!1,...typeof o.minCliVersion=="string"&&o.minCliVersion.trim()?{minCliVersion:o.minCliVersion}:{},capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(k=>typeof k=="string"):[]}}function W(e,r){if(!e||typeof e!="object"||Array.isArray(e))throw new u.CliError("WORKER_REGISTRY_INVALID",`${r} must be an object.`);return e}function R(e,r,t,o){if(typeof e=="string"&&e.trim())return e;throw y(`${r} is required`,t,o)}function y(e,r,t){return new u.CliError("WORKER_REGISTRY_INVALID",`Invalid worker route at index ${r}: ${e}.`,{registryPath:t,index:r})}function m(e,r){const t=r.replace(/\\/g,"/");if(!t||t.startsWith("/")||t.split("/").includes(".."))return null;const o=c.default.resolve(e),i=c.default.resolve(o,t),n=c.default.relative(o,i);return n&&!n.startsWith("..")&&!c.default.isAbsolute(n)?i:null}function I(e){try{const r=JSON.parse(d.default.readFileSync(e,"utf8"));return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function v(e,r){const t=r.match(/^>=\s*(\d+)\.(\d+)\.(\d+)$/);if(!t)return e===r;const o=N(e),i=t.slice(1).map(n=>Number(n));for(let n=0;n<3;n+=1){const s=o[n]??0,a=i[n]??0;if(s>a)return!0;if(s<a)return!1}return!0}function N(e){const r=e.match(/(\d+)\.(\d+)\.(\d+)/);return r?r.slice(1).map(t=>Number(t)):[0,0,0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automaton-labs/aib",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "CLI for discovering and calling the local aib IDE extension runtime.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,14 +15,16 @@
15
15
  "scripts/postinstall.cjs",
16
16
  "scripts/provision-runtime.cjs",
17
17
  "runtimes/launcher",
18
+ "runtimes/tools",
18
19
  "README.md",
19
20
  "package.json"
20
21
  ],
21
22
  "scripts": {
22
- "build": "tsc -p . && node scripts/copy-managed-host-assets.cjs",
23
- "build:package": "node ../../scripts/package/clean-paths.cjs dist && tsc -p tsconfig.package.json && node scripts/copy-managed-host-assets.cjs && node ../../scripts/package/minify-js.cjs dist",
24
- "typecheck": "tsc -p . --noEmit",
23
+ "build": "npm --silent --prefix ../control-plane-contracts run build && tsc -p . && node scripts/copy-managed-host-assets.cjs && node scripts/copy-control-plane-worker.cjs",
24
+ "build:package": "npm --silent --prefix ../control-plane-contracts run build && node ../../scripts/package/clean-paths.cjs dist && tsc -p tsconfig.package.json && node scripts/copy-managed-host-assets.cjs && node scripts/copy-control-plane-worker.cjs --minify && node ../../scripts/package/minify-js.cjs dist",
25
+ "typecheck": "npm --silent --prefix ../control-plane-contracts run build && tsc -p . --noEmit",
25
26
  "postinstall": "node scripts/postinstall.cjs",
27
+ "sync:tool-runtimes": "node ../../scripts/runtime/sync-tool-runtimes.cjs",
26
28
  "prepack": "npm run build:package && node scripts/copy-extension-vsix.cjs",
27
29
  "pack:local": "npm pack --pack-destination ../../.tmp"
28
30
  },
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,36 @@
1
+ {
2
+ "schema": 1,
3
+ "tool": "rg",
4
+ "version": "15.1.0",
5
+ "source": {
6
+ "repo": "BurntSushi/ripgrep",
7
+ "tag": "15.1.0"
8
+ },
9
+ "platforms": {
10
+ "win32-x64": {
11
+ "asset": "ripgrep-15.1.0-x86_64-pc-windows-msvc.zip",
12
+ "sha256": "124510b94b6baa3380d051fdf4650eaa80a302c876d611e9dba0b2e18d87493a",
13
+ "executable": "rg.exe"
14
+ },
15
+ "linux-x64": {
16
+ "asset": "ripgrep-15.1.0-x86_64-unknown-linux-musl.tar.gz",
17
+ "sha256": "1c9297be4a084eea7ecaedf93eb03d058d6faae29bbc57ecdaf5063921491599",
18
+ "executable": "rg"
19
+ },
20
+ "linux-arm64": {
21
+ "asset": "ripgrep-15.1.0-aarch64-unknown-linux-gnu.tar.gz",
22
+ "sha256": "2b661c6ef508e902f388e9098d9c4c5aca72c87b55922d94abdba830b4dc885e",
23
+ "executable": "rg"
24
+ },
25
+ "darwin-x64": {
26
+ "asset": "ripgrep-15.1.0-x86_64-apple-darwin.tar.gz",
27
+ "sha256": "64811cb24e77cac3057d6c40b63ac9becf9082eedd54ca411b475b755d334882",
28
+ "executable": "rg"
29
+ },
30
+ "darwin-arm64": {
31
+ "asset": "ripgrep-15.1.0-aarch64-apple-darwin.tar.gz",
32
+ "sha256": "378e973289176ca0c6054054ee7f631a065874a352bf43f0fa60ef079b6ba715",
33
+ "executable": "rg"
34
+ }
35
+ }
36
+ }
Binary file
@@ -0,0 +1,36 @@
1
+ {
2
+ "schema": 1,
3
+ "tool": "rtk",
4
+ "version": "0.42.3",
5
+ "source": {
6
+ "repo": "rtk-ai/rtk",
7
+ "tag": "v0.42.3"
8
+ },
9
+ "platforms": {
10
+ "win32-x64": {
11
+ "asset": "rtk-x86_64-pc-windows-msvc.zip",
12
+ "sha256": "334d05a6662576a84a78b771aee0749202eacabd87acbb9fd266e6a5466f700a",
13
+ "executable": "rtk.exe"
14
+ },
15
+ "linux-x64": {
16
+ "asset": "rtk-x86_64-unknown-linux-musl.tar.gz",
17
+ "sha256": "5df764a633709cb85d248258d085d24ec95faa8bca0e6835a93cd57cadc4eb9e",
18
+ "executable": "rtk"
19
+ },
20
+ "linux-arm64": {
21
+ "asset": "rtk-aarch64-unknown-linux-gnu.tar.gz",
22
+ "sha256": "2b7fa09d06f8dbf334c55482fad2e7ce4a1f8564bc9ed1f65d9f5992db8e5527",
23
+ "executable": "rtk"
24
+ },
25
+ "darwin-x64": {
26
+ "asset": "rtk-x86_64-apple-darwin.tar.gz",
27
+ "sha256": "7c72d05cfc71b7e2f20755b3754b728acecc7c0b1fbbb08757828f9e7bedd81a",
28
+ "executable": "rtk"
29
+ },
30
+ "darwin-arm64": {
31
+ "asset": "rtk-aarch64-apple-darwin.tar.gz",
32
+ "sha256": "d47823afb25919e4e60838c5622e88ffa6536bc0b36a34a3f928bdccac40f614",
33
+ "executable": "rtk"
34
+ }
35
+ }
36
+ }
@@ -223,7 +223,31 @@ function defaultManifestUrl() {
223
223
  function runtimeComplete() {
224
224
  return fs.existsSync(path.join(runtimesDir, "code-server", "node_modules", "code-server", "out", "node", "entry.js"))
225
225
  && Boolean(findPackagedBrowserRuntime())
226
- && Boolean(findPackagedNodeRuntime());
226
+ && Boolean(findPackagedNodeRuntime())
227
+ && runtimePlatformStatus().ok;
228
+ }
229
+
230
+ function runtimePlatformStatus() {
231
+ const markerPath = path.join(runtimesDir, ".aib-runtime-platform.json");
232
+ if (!fs.existsSync(markerPath)) {
233
+ return { ok: true, reason: "missing", expectedPlatformKey: platformKey, actualPlatformKey: null };
234
+ }
235
+ try {
236
+ const marker = JSON.parse(fs.readFileSync(markerPath, "utf8"));
237
+ const actualPlatformKey = typeof marker.platformKey === "string"
238
+ ? marker.platformKey
239
+ : typeof marker.platform === "string" && typeof marker.arch === "string"
240
+ ? `${marker.platform}-${marker.arch}`
241
+ : null;
242
+ return {
243
+ ok: actualPlatformKey === platformKey,
244
+ reason: actualPlatformKey === platformKey ? "ok" : "mismatch",
245
+ expectedPlatformKey: platformKey,
246
+ actualPlatformKey
247
+ };
248
+ } catch {
249
+ return { ok: false, reason: "invalid", expectedPlatformKey: platformKey, actualPlatformKey: null };
250
+ }
227
251
  }
228
252
 
229
253
  function findPackagedNodeRuntime() {
@@ -1,15 +0,0 @@
1
- # Basics
2
-
3
- Use the active session while you work.
4
- Reuse captured inputs when editing them is cheaper than rebuilding large JSON.
5
-
6
- Examples are patterns, not limits.
7
- Feature sections show common high-value uses, not every valid use.
8
- Adapt requests to the task: combine features, batch related questions, and skip steps when you already have enough context.
9
-
10
- Prefer batch JSON instead of inline calls.
11
- One request can inspect/mutate several files/entities and save reusable outputs.
12
- Use one-off commands only for small checks/changes.
13
-
14
- For mutations, aib asks TS/IDE refactors to update affected references and imports.
15
- 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.
@@ -1,56 +0,0 @@
1
- # Config Setup: Aliases
2
-
3
- If you have not just checked the full config, check current aliases:
4
-
5
- aib config aliases
6
-
7
- pathAliases define short request aliases for paths agents repeat in AIB commands.
8
- Use them to reduce input tokens for repeated inspect and mutation work.
9
-
10
- Aliases are for AIB request paths.
11
- They do not change TypeScript imports by themselves.
12
- For import style after mutations, use importRules.
13
-
14
- Check TypeScript aliases for hints:
15
-
16
- aib reveal tsaliases
17
-
18
- Use this to see existing tsconfig paths and baseUrl values.
19
- They can reveal stable work areas, but they are not a list to copy.
20
-
21
- Add pathAliases for long paths that are likely to appear repeatedly in AIB requests.
22
- Prefer aliases for real work areas, package roots, or deep directories.
23
-
24
- A good alias:
25
- - saves meaningful path tokens;
26
- - points to a stable work area;
27
- - is easy to recognize later.
28
-
29
- A bad alias:
30
- - duplicates a short path like "src": "src", "packages": "packages", "scripts": "scripts";
31
- - points to a rarely used folder;
32
- - mirrors the directory tree without a workflow reason.
33
-
34
- Having 20-30 good aliases is fine for a large repo or monorepo.
35
-
36
- Example:
37
-
38
- "pathAliases": {
39
- "wstore": "apps/web/src/shared/store",
40
- "wapi": "apps/web/src/shared/api",
41
- "whooks": "apps/web/src/shared/utils/hooks",
42
- "pmail": "packages/email/src",
43
- "putils": "packages/utils/src",
44
- "arules": "docs/agent/rules"
45
- }
46
-
47
- After editing aib.json, run:
48
-
49
- aib sync
50
-
51
- Verify aliases with a small tree or inspect request:
52
-
53
- aib inspect --stdin
54
-
55
- Input:
56
- tree @<alias> depth=3 +onlyDirs limit=80
@@ -1,45 +0,0 @@
1
- # Config Setup: Excludes
2
-
3
- Tree excludes affect directory and file discovery output.
4
- Graph excludes affect graph counts, hubs, entrypoints, leaves, edges, imports, importedBy, and saved graph views.
5
-
6
- Built-in excludes already skip common noise such as node_modules, .git, dist, build, out, and .tmp.
7
- Add config excludes for repository-specific noise.
8
-
9
- 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.
10
- Exclude them explicitly:
11
-
12
- "inspect.tree.onlyDirs.exclude": [
13
- "**/*copy",
14
- "**/*copy/**"
15
- ],
16
- "inspect.tree.files.exclude": [
17
- "**/* copy.ts",
18
- "**/*.generated.ts"
19
- ],
20
- "inspect.graph.exclude": [
21
- "**/* copy.ts",
22
- "**/*.generated.ts",
23
- "src/generated/**"
24
- ]
25
-
26
- Prefer narrow patterns for known noise:
27
- - generated files;
28
- - local copy/backup folders;
29
- - build artifacts not already skipped by defaults;
30
- - vendored or checked-in output.
31
-
32
- These are common cases, not mandatory rules.
33
- If the repository needs one of these areas for reasoning or mutation impact checks, do not exclude it.
34
-
35
- Do not exclude broad source areas to make output smaller.
36
- If output is too large, use scope, depth, limit, graph view, or graph toggles first.
37
-
38
- After editing aib.json, run:
39
-
40
- aib sync
41
-
42
- Then verify with a compact tree request and the graph view that was noisy.
43
-
44
- If excluded paths still appear, check the glob pattern against repo-relative paths.
45
- If important source disappeared, narrow or remove the exclude.
@@ -1,86 +0,0 @@
1
- # Config Setup: Import Normalize
2
-
3
- Configure import normalization intent.
4
-
5
- importNormalize defines default normalization rules for explicit aib imports normalize commands.
6
- Use it before broad or important import cleanup so the scope, target style, preferred alias, and excludes are stored in aib.json instead of repeated in command arguments.
7
-
8
- It does not run automatically during move/modulePlan.
9
- Use importRules for mutation-time import cleanup.
10
-
11
- Set importNormalize when the intended cleanup has project meaning:
12
- - adopting a new tsconfig alias across a project area;
13
- - converting an area to aliases;
14
- - converting scripts/tools or extracted modules to relative imports;
15
- - excluding generated or bundled output from normalization.
16
-
17
- For tiny one-file checks, inline options are fine.
18
- Before wider cleanup, put the intended rule in config and preview the smallest useful scope.
19
-
20
- Fields:
21
- scope repo-relative file or directory scope; most specific scope wins
22
- to relative|alias|shortestAlias
23
- preferAlias tsconfig paths pattern used when to=alias
24
- exclude files, directories, or glob-like patterns to skip
25
-
26
- to:
27
- relative rewrite resolved local imports to relative paths
28
- alias rewrite resolved local imports to a matching tsconfig alias
29
- shortestAlias rewrite to the shortest valid alias specifier
30
-
31
- preferAlias:
32
- @shared/* prefer one alias pattern when several aliases can resolve the same file
33
-
34
- Alias cleanup:
35
-
36
- "importNormalize": [
37
- {
38
- "scope": "src",
39
- "to": "shortestAlias",
40
- "preferAlias": "@/*",
41
- "exclude": [
42
- "src/generated",
43
- "src/**/dist"
44
- ]
45
- }
46
- ]
47
-
48
- Relative cleanup for scripts/tools:
49
-
50
- "importNormalize": [
51
- {
52
- "scope": "scripts",
53
- "to": "relative",
54
- "exclude": [
55
- "scripts/**/*.cjs",
56
- "scripts/**/*.mjs"
57
- ]
58
- }
59
- ]
60
-
61
- If you have not just checked config rules, run:
62
-
63
- aib config rules
64
-
65
- After editing aib.json, run:
66
-
67
- aib sync
68
-
69
- Then preview the smallest useful scope before applying:
70
-
71
- aib imports normalize preview <scope>
72
-
73
- Preview shows counts, sample import rewrites, a planId, and the apply command.
74
- It does not change project files.
75
-
76
- If preview changes imports outside the intended area, narrow scope or add exclude.
77
-
78
- If preview does not use the expected alias, check tsconfig aliases:
79
-
80
- aib reveal tsaliases
81
-
82
- If the config and aliases look correct but preview still looks stale or strange, run:
83
-
84
- aib sync
85
-
86
- Then preview again.
@@ -1,96 +0,0 @@
1
- # Config Setup: Import Rules
2
-
3
- Use this when move/modulePlan creates imports that do not match the repository style.
4
-
5
- Do not keep fixing the same generated import style by hand.
6
- Tune importRules, sync config, then retry the smallest useful mutation before continuing larger mutation work.
7
-
8
- Check current config:
9
-
10
- aib config rules
11
-
12
- importRules control imports created or expanded by move/modulePlan mutation cleanup.
13
- They do not rewrite the whole project.
14
-
15
- AIB starts from IDE/TS import preferences.
16
- For mutation cleanup, matching importRules in aib.json take priority.
17
- Do not assume IDE/TS defaults match the repo style.
18
-
19
- Fields:
20
- scope repo-relative file or directory scope; most specific scope wins
21
- specifier relative|shortest|project-relative|non-relative
22
- ending auto|minimal|index|js
23
- builtin node|bare
24
- unusedImports remove|preserve
25
-
26
- Defaults:
27
- specifier omitted IDE/TS decides
28
- ending omitted IDE/TS decides
29
- builtin omitted keep TS/project builtin style
30
- unusedImports omitted keep unused imports
31
-
32
- specifier:
33
- relative best for local relative imports
34
- shortest best for shortest valid alias/path output
35
- project-relative best for root-relative project imports
36
- non-relative best for package or alias imports
37
-
38
- ending:
39
- minimal best for extensionless TS imports
40
- js best for ESM-style TS projects that require .js
41
- auto leaves the decision to TypeScript
42
- index best for explicit index import style
43
-
44
- builtin:
45
- node path -> node:path; best for explicit Node builtin imports
46
- bare node:path -> path; best for bare Node builtin imports
47
- omit field keeps TypeScript/project output; add builtin if agents keep fixing this manually
48
-
49
- unusedImports:
50
- remove clean unused imports in mutation-touched files
51
- preserve keep unused imports
52
- omit same as preserve
53
-
54
- Mutation-touched files are files where TS produced edits: source/target files and any reference/update files TS changed.
55
- Recommended value: remove
56
-
57
- If the repository has one import style, use one broad rule:
58
-
59
- "importRules": [
60
- {
61
- "scope": ".",
62
- "specifier": "shortest",
63
- "ending": "auto",
64
- "builtin": "node",
65
- "unusedImports": "remove"
66
- }
67
- ]
68
-
69
- Use scoped rules only when areas differ by style, for example packages use aliases but scripts use relative imports:
70
-
71
- "importRules": [
72
- {
73
- "scope": "packages",
74
- "specifier": "shortest",
75
- "ending": "auto",
76
- "builtin": "node",
77
- "unusedImports": "remove"
78
- },
79
- {
80
- "scope": "scripts",
81
- "specifier": "relative",
82
- "ending": "auto",
83
- "builtin": "node",
84
- "unusedImports": "remove"
85
- }
86
- ]
87
-
88
- Use the most specific scope that matches the real convention.
89
- Do not add scoped rules just because directories exist.
90
-
91
- After editing aib.json, run:
92
-
93
- aib sync
94
-
95
- Then rerun the smallest affected move/modulePlan preview or execute request.
96
- If imports are still wrong, update importRules again before doing more manual cleanup.
@@ -1,33 +0,0 @@
1
- # Config Setup: TypeScript Configs
2
-
3
- AIB syncs and watches visible tsconfigs.
4
- Keep real app/package configs visible.
5
- Exclude nested workspaces, seed projects, snapshots, backups, copied apps, or other non-primary projects.
6
-
7
- Do not exclude real package/app configs just to reduce output.
8
-
9
- Check which TypeScript configs AIB will sync and watch:
10
-
11
- aib reveal tsconfigs +all
12
-
13
- If output includes non-primary projects, exclude them:
14
-
15
- "sync.tsconfig.exclude": [
16
- "dev-seed/**",
17
- "snapshots/**"
18
- ]
19
-
20
- After editing aib.json, run:
21
-
22
- aib sync
23
-
24
- Then check again:
25
-
26
- aib reveal tsconfigs +all
27
-
28
- Visible tsconfigs should describe the active project surface.
29
- Excluded tsconfigs should be things the agent should not use for setup decisions.
30
-
31
- Use +nec only when you need to compare visible configs with config-excluded configs:
32
-
33
- aib reveal tsconfigs +nec
@@ -1,25 +0,0 @@
1
- # DSL
2
-
3
- DSL request model:
4
- - directives set defaults for following requests
5
- - each request line can override defaults with key=value
6
- - +flag means true
7
- - -flag means false
8
- - file/imports/exports/members/code/deps accept a path as the first positional argument; examples below use this shape.
9
- - Use @file when several following operations share the same file.
10
- - For one-off file operations, pass the path directly.
11
-
12
- Syntax:
13
- @file <path> default file
14
- @source <path> default sourceFile for mutations
15
- op arg arg key=value request
16
- +flag boolean true
17
- -flag boolean false
18
- >name save reusable artifact when supported
19
- old->new rename pair
20
- Parent.member parent-qualified member
21
- Parent.{a,b} several members under one parent
22
- key=[a,b] list value for repeatable fields
23
- file="path with spaces.ts" quote values with spaces
24
- detail=sum|loc|code aliases for summary|locations|code
25
- from=... alias for fromFile