@build-astron-co/nimbus 0.4.2 → 0.4.3

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 (430) hide show
  1. package/dist/src/agent/compaction-agent.js +24 -12
  2. package/dist/src/agent/context-manager.js +2 -1
  3. package/dist/src/agent/expand-files.js +2 -1
  4. package/dist/src/agent/loop.js +71 -33
  5. package/dist/src/agent/permissions.js +4 -2
  6. package/dist/src/agent/system-prompt.js +34 -17
  7. package/dist/src/app.js +1 -1
  8. package/dist/src/auth/keychain.js +8 -4
  9. package/dist/src/auth/store.js +70 -107
  10. package/dist/src/cli/init.js +35 -19
  11. package/dist/src/cli/run.js +18 -10
  12. package/dist/src/cli/serve.js +4 -2
  13. package/dist/src/cli.js +52 -11
  14. package/dist/src/commands/alias.js +5 -3
  15. package/dist/src/commands/audit/index.js +2 -1
  16. package/dist/src/commands/aws-terraform.js +36 -18
  17. package/dist/src/commands/completions.js +1 -1
  18. package/dist/src/commands/config.js +3 -2
  19. package/dist/src/commands/connect-github.js +92 -0
  20. package/dist/src/commands/cost/index.js +3 -2
  21. package/dist/src/commands/deploy.js +15 -10
  22. package/dist/src/commands/doctor.js +6 -3
  23. package/dist/src/commands/drift/index.js +2 -1
  24. package/dist/src/commands/export.js +5 -3
  25. package/dist/src/commands/generate-terraform.js +110 -2
  26. package/dist/src/commands/import.js +3 -3
  27. package/dist/src/commands/incident.js +10 -5
  28. package/dist/src/commands/login.js +8 -93
  29. package/dist/src/commands/logs.js +16 -8
  30. package/dist/src/commands/onboarding.js +6 -4
  31. package/dist/src/commands/pipeline.js +6 -3
  32. package/dist/src/commands/plugin.js +3 -2
  33. package/dist/src/commands/profile.js +27 -14
  34. package/dist/src/commands/questionnaire.js +1 -1
  35. package/dist/src/commands/rollback.js +3 -2
  36. package/dist/src/commands/rollout.js +5 -3
  37. package/dist/src/commands/runbook.js +17 -10
  38. package/dist/src/commands/schedule.js +10 -5
  39. package/dist/src/commands/status.js +2 -1
  40. package/dist/src/commands/team-context.js +12 -7
  41. package/dist/src/commands/template.js +1 -1
  42. package/dist/src/commands/tf/index.js +6 -3
  43. package/dist/src/commands/version.js +6 -3
  44. package/dist/src/commands/watch.js +6 -3
  45. package/dist/src/compat/sqlite.js +5 -3
  46. package/dist/src/config/mode-store.js +2 -1
  47. package/dist/src/config/profiles.js +4 -2
  48. package/dist/src/config/types.js +2 -1
  49. package/dist/src/engine/executor.js +8 -4
  50. package/dist/src/engine/planner.js +9 -5
  51. package/dist/src/llm/providers/anthropic.js +6 -3
  52. package/dist/src/llm/providers/ollama.js +1 -1
  53. package/dist/src/llm/router.js +22 -7
  54. package/dist/src/sessions/manager.js +6 -3
  55. package/dist/src/sharing/viewer.js +2 -1
  56. package/dist/src/tools/file-ops.js +1 -2
  57. package/dist/src/tools/schemas/devops.js +197 -108
  58. package/dist/src/tools/schemas/standard.js +1 -1
  59. package/dist/src/ui/App.js +25 -13
  60. package/dist/src/ui/FileDiffModal.js +22 -11
  61. package/dist/src/ui/HelpModal.js +2 -1
  62. package/dist/src/ui/InputBox.js +6 -3
  63. package/dist/src/ui/MessageList.js +40 -20
  64. package/dist/src/ui/TerminalPane.js +2 -1
  65. package/dist/src/ui/ToolCallDisplay.js +12 -6
  66. package/dist/src/ui/TreePane.js +2 -1
  67. package/dist/src/ui/ink/index.js +37 -21
  68. package/dist/src/watcher/index.js +8 -4
  69. package/package.json +3 -5
  70. package/src/__tests__/alias.test.ts +0 -133
  71. package/src/__tests__/app.test.ts +0 -76
  72. package/src/__tests__/audit.test.ts +0 -877
  73. package/src/__tests__/circuit-breaker.test.ts +0 -116
  74. package/src/__tests__/cli-run.test.ts +0 -351
  75. package/src/__tests__/compat-sqlite.test.ts +0 -68
  76. package/src/__tests__/context-manager.test.ts +0 -632
  77. package/src/__tests__/context.test.ts +0 -242
  78. package/src/__tests__/devops-terminal-gaps.test.ts +0 -718
  79. package/src/__tests__/doctor.test.ts +0 -48
  80. package/src/__tests__/enterprise.test.ts +0 -401
  81. package/src/__tests__/export.test.ts +0 -236
  82. package/src/__tests__/gap-11-18-20.test.ts +0 -958
  83. package/src/__tests__/generator.test.ts +0 -433
  84. package/src/__tests__/helm-streaming.test.ts +0 -127
  85. package/src/__tests__/hooks.test.ts +0 -582
  86. package/src/__tests__/incident.test.ts +0 -179
  87. package/src/__tests__/init.test.ts +0 -487
  88. package/src/__tests__/intent-parser.test.ts +0 -229
  89. package/src/__tests__/llm-router.test.ts +0 -209
  90. package/src/__tests__/logs.test.ts +0 -107
  91. package/src/__tests__/loop-errors.test.ts +0 -244
  92. package/src/__tests__/lsp.test.ts +0 -293
  93. package/src/__tests__/modes.test.ts +0 -336
  94. package/src/__tests__/perf-optimizations.test.ts +0 -847
  95. package/src/__tests__/permissions.test.ts +0 -338
  96. package/src/__tests__/pipeline.test.ts +0 -50
  97. package/src/__tests__/polish-phase3.test.ts +0 -340
  98. package/src/__tests__/profile.test.ts +0 -237
  99. package/src/__tests__/rollback.test.ts +0 -83
  100. package/src/__tests__/runbook.test.ts +0 -219
  101. package/src/__tests__/schedule.test.ts +0 -206
  102. package/src/__tests__/serve.test.ts +0 -275
  103. package/src/__tests__/sessions.test.ts +0 -322
  104. package/src/__tests__/sharing.test.ts +0 -340
  105. package/src/__tests__/snapshots.test.ts +0 -581
  106. package/src/__tests__/standalone-migration.test.ts +0 -199
  107. package/src/__tests__/state-db.test.ts +0 -334
  108. package/src/__tests__/status.test.ts +0 -158
  109. package/src/__tests__/stream-with-tools.test.ts +0 -778
  110. package/src/__tests__/subagents.test.ts +0 -176
  111. package/src/__tests__/system-prompt.test.ts +0 -248
  112. package/src/__tests__/terminal-gap-v2.test.ts +0 -395
  113. package/src/__tests__/terminal-parity.test.ts +0 -393
  114. package/src/__tests__/tf-apply.test.ts +0 -187
  115. package/src/__tests__/tool-converter.test.ts +0 -256
  116. package/src/__tests__/tool-schemas.test.ts +0 -602
  117. package/src/__tests__/tools.test.ts +0 -144
  118. package/src/__tests__/version-json.test.ts +0 -184
  119. package/src/__tests__/version.test.ts +0 -49
  120. package/src/__tests__/watch.test.ts +0 -129
  121. package/src/agent/compaction-agent.ts +0 -266
  122. package/src/agent/context-manager.ts +0 -499
  123. package/src/agent/context.ts +0 -427
  124. package/src/agent/deploy-preview.ts +0 -487
  125. package/src/agent/expand-files.ts +0 -108
  126. package/src/agent/index.ts +0 -68
  127. package/src/agent/loop.ts +0 -1998
  128. package/src/agent/modes.ts +0 -429
  129. package/src/agent/permissions.ts +0 -513
  130. package/src/agent/subagents/base.ts +0 -116
  131. package/src/agent/subagents/cost.ts +0 -51
  132. package/src/agent/subagents/explore.ts +0 -42
  133. package/src/agent/subagents/general.ts +0 -54
  134. package/src/agent/subagents/index.ts +0 -102
  135. package/src/agent/subagents/infra.ts +0 -59
  136. package/src/agent/subagents/security.ts +0 -69
  137. package/src/agent/system-prompt.ts +0 -990
  138. package/src/app.ts +0 -180
  139. package/src/audit/activity-log.ts +0 -290
  140. package/src/audit/compliance-checker.ts +0 -540
  141. package/src/audit/cost-tracker.ts +0 -318
  142. package/src/audit/index.ts +0 -23
  143. package/src/audit/security-scanner.ts +0 -641
  144. package/src/auth/guard.ts +0 -75
  145. package/src/auth/index.ts +0 -56
  146. package/src/auth/keychain.ts +0 -82
  147. package/src/auth/oauth.ts +0 -465
  148. package/src/auth/providers.ts +0 -470
  149. package/src/auth/sso.ts +0 -113
  150. package/src/auth/store.ts +0 -505
  151. package/src/auth/types.ts +0 -187
  152. package/src/build.ts +0 -141
  153. package/src/cli/index.ts +0 -16
  154. package/src/cli/init.ts +0 -1227
  155. package/src/cli/openapi-spec.ts +0 -356
  156. package/src/cli/run.ts +0 -628
  157. package/src/cli/serve-auth.ts +0 -80
  158. package/src/cli/serve.ts +0 -539
  159. package/src/cli/web.ts +0 -71
  160. package/src/cli.ts +0 -1728
  161. package/src/clients/core-engine-client.ts +0 -227
  162. package/src/clients/enterprise-client.ts +0 -334
  163. package/src/clients/generator-client.ts +0 -351
  164. package/src/clients/git-client.ts +0 -627
  165. package/src/clients/github-client.ts +0 -410
  166. package/src/clients/helm-client.ts +0 -504
  167. package/src/clients/index.ts +0 -80
  168. package/src/clients/k8s-client.ts +0 -497
  169. package/src/clients/llm-client.ts +0 -161
  170. package/src/clients/rest-client.ts +0 -130
  171. package/src/clients/service-discovery.ts +0 -38
  172. package/src/clients/terraform-client.ts +0 -482
  173. package/src/clients/tools-client.ts +0 -1843
  174. package/src/clients/ws-client.ts +0 -115
  175. package/src/commands/alias.ts +0 -100
  176. package/src/commands/analyze/index.ts +0 -352
  177. package/src/commands/apply/helm.ts +0 -473
  178. package/src/commands/apply/index.ts +0 -213
  179. package/src/commands/apply/k8s.ts +0 -454
  180. package/src/commands/apply/terraform.ts +0 -582
  181. package/src/commands/ask.ts +0 -167
  182. package/src/commands/audit/index.ts +0 -357
  183. package/src/commands/auth-cloud.ts +0 -407
  184. package/src/commands/auth-list.ts +0 -134
  185. package/src/commands/auth-profile.ts +0 -121
  186. package/src/commands/auth-refresh.ts +0 -187
  187. package/src/commands/auth-status.ts +0 -141
  188. package/src/commands/aws/ec2.ts +0 -501
  189. package/src/commands/aws/iam.ts +0 -397
  190. package/src/commands/aws/index.ts +0 -133
  191. package/src/commands/aws/lambda.ts +0 -396
  192. package/src/commands/aws/rds.ts +0 -439
  193. package/src/commands/aws/s3.ts +0 -439
  194. package/src/commands/aws/vpc.ts +0 -393
  195. package/src/commands/aws-discover.ts +0 -542
  196. package/src/commands/aws-terraform.ts +0 -755
  197. package/src/commands/azure/aks.ts +0 -376
  198. package/src/commands/azure/functions.ts +0 -253
  199. package/src/commands/azure/index.ts +0 -116
  200. package/src/commands/azure/storage.ts +0 -478
  201. package/src/commands/azure/vm.ts +0 -355
  202. package/src/commands/billing/index.ts +0 -256
  203. package/src/commands/chat.ts +0 -320
  204. package/src/commands/completions.ts +0 -268
  205. package/src/commands/config.ts +0 -372
  206. package/src/commands/cost/cloud-cost-estimator.ts +0 -266
  207. package/src/commands/cost/estimator.ts +0 -79
  208. package/src/commands/cost/index.ts +0 -810
  209. package/src/commands/cost/parsers/terraform.ts +0 -273
  210. package/src/commands/cost/parsers/types.ts +0 -25
  211. package/src/commands/cost/pricing/aws.ts +0 -544
  212. package/src/commands/cost/pricing/azure.ts +0 -499
  213. package/src/commands/cost/pricing/gcp.ts +0 -396
  214. package/src/commands/cost/pricing/index.ts +0 -40
  215. package/src/commands/demo.ts +0 -250
  216. package/src/commands/deploy.ts +0 -260
  217. package/src/commands/doctor.ts +0 -1386
  218. package/src/commands/drift/index.ts +0 -787
  219. package/src/commands/explain.ts +0 -277
  220. package/src/commands/export.ts +0 -146
  221. package/src/commands/feedback.ts +0 -389
  222. package/src/commands/fix.ts +0 -324
  223. package/src/commands/fs/index.ts +0 -402
  224. package/src/commands/gcp/compute.ts +0 -325
  225. package/src/commands/gcp/functions.ts +0 -271
  226. package/src/commands/gcp/gke.ts +0 -438
  227. package/src/commands/gcp/iam.ts +0 -344
  228. package/src/commands/gcp/index.ts +0 -129
  229. package/src/commands/gcp/storage.ts +0 -284
  230. package/src/commands/generate-helm.ts +0 -1249
  231. package/src/commands/generate-k8s.ts +0 -1508
  232. package/src/commands/generate-terraform.ts +0 -1202
  233. package/src/commands/gh/index.ts +0 -863
  234. package/src/commands/git/index.ts +0 -1343
  235. package/src/commands/helm/index.ts +0 -1126
  236. package/src/commands/help.ts +0 -715
  237. package/src/commands/history.ts +0 -149
  238. package/src/commands/import.ts +0 -868
  239. package/src/commands/incident.ts +0 -166
  240. package/src/commands/index.ts +0 -367
  241. package/src/commands/init.ts +0 -1051
  242. package/src/commands/k8s/index.ts +0 -1137
  243. package/src/commands/login.ts +0 -716
  244. package/src/commands/logout.ts +0 -83
  245. package/src/commands/logs.ts +0 -167
  246. package/src/commands/onboarding.ts +0 -405
  247. package/src/commands/pipeline.ts +0 -186
  248. package/src/commands/plan/display.ts +0 -279
  249. package/src/commands/plan/index.ts +0 -599
  250. package/src/commands/plugin.ts +0 -398
  251. package/src/commands/preview.ts +0 -452
  252. package/src/commands/profile.ts +0 -342
  253. package/src/commands/questionnaire.ts +0 -1172
  254. package/src/commands/resume.ts +0 -47
  255. package/src/commands/rollback.ts +0 -315
  256. package/src/commands/rollout.ts +0 -88
  257. package/src/commands/runbook.ts +0 -346
  258. package/src/commands/schedule.ts +0 -236
  259. package/src/commands/status.ts +0 -252
  260. package/src/commands/team/index.ts +0 -346
  261. package/src/commands/team-context.ts +0 -220
  262. package/src/commands/template.ts +0 -233
  263. package/src/commands/tf/index.ts +0 -1093
  264. package/src/commands/upgrade.ts +0 -609
  265. package/src/commands/usage/index.ts +0 -134
  266. package/src/commands/version.ts +0 -174
  267. package/src/commands/watch.ts +0 -153
  268. package/src/compat/index.ts +0 -2
  269. package/src/compat/runtime.ts +0 -12
  270. package/src/compat/sqlite.ts +0 -177
  271. package/src/config/index.ts +0 -17
  272. package/src/config/manager.ts +0 -530
  273. package/src/config/mode-store.ts +0 -62
  274. package/src/config/profiles.ts +0 -84
  275. package/src/config/safety-policy.ts +0 -358
  276. package/src/config/schema.ts +0 -125
  277. package/src/config/types.ts +0 -609
  278. package/src/config/workspace-state.ts +0 -53
  279. package/src/context/context-db.ts +0 -199
  280. package/src/demo/index.ts +0 -349
  281. package/src/demo/scenarios/full-journey.ts +0 -229
  282. package/src/demo/scenarios/getting-started.ts +0 -127
  283. package/src/demo/scenarios/helm-release.ts +0 -341
  284. package/src/demo/scenarios/k8s-deployment.ts +0 -194
  285. package/src/demo/scenarios/terraform-vpc.ts +0 -170
  286. package/src/demo/types.ts +0 -92
  287. package/src/engine/cost-estimator.ts +0 -480
  288. package/src/engine/diagram-generator.ts +0 -256
  289. package/src/engine/drift-detector.ts +0 -902
  290. package/src/engine/executor.ts +0 -1066
  291. package/src/engine/index.ts +0 -76
  292. package/src/engine/orchestrator.ts +0 -636
  293. package/src/engine/planner.ts +0 -787
  294. package/src/engine/safety.ts +0 -743
  295. package/src/engine/verifier.ts +0 -770
  296. package/src/enterprise/audit.ts +0 -348
  297. package/src/enterprise/auth.ts +0 -270
  298. package/src/enterprise/billing.ts +0 -822
  299. package/src/enterprise/index.ts +0 -17
  300. package/src/enterprise/teams.ts +0 -443
  301. package/src/generator/best-practices.ts +0 -1608
  302. package/src/generator/helm.ts +0 -630
  303. package/src/generator/index.ts +0 -37
  304. package/src/generator/intent-parser.ts +0 -514
  305. package/src/generator/kubernetes.ts +0 -976
  306. package/src/generator/terraform.ts +0 -1875
  307. package/src/history/index.ts +0 -8
  308. package/src/history/manager.ts +0 -250
  309. package/src/history/types.ts +0 -34
  310. package/src/hooks/config.ts +0 -432
  311. package/src/hooks/engine.ts +0 -392
  312. package/src/hooks/index.ts +0 -4
  313. package/src/llm/auth-bridge.ts +0 -198
  314. package/src/llm/circuit-breaker.ts +0 -140
  315. package/src/llm/config-loader.ts +0 -201
  316. package/src/llm/cost-calculator.ts +0 -171
  317. package/src/llm/index.ts +0 -8
  318. package/src/llm/model-aliases.ts +0 -115
  319. package/src/llm/provider-registry.ts +0 -63
  320. package/src/llm/providers/anthropic.ts +0 -462
  321. package/src/llm/providers/bedrock.ts +0 -477
  322. package/src/llm/providers/google.ts +0 -405
  323. package/src/llm/providers/ollama.ts +0 -767
  324. package/src/llm/providers/openai-compatible.ts +0 -340
  325. package/src/llm/providers/openai.ts +0 -328
  326. package/src/llm/providers/openrouter.ts +0 -338
  327. package/src/llm/router.ts +0 -1104
  328. package/src/llm/types.ts +0 -232
  329. package/src/lsp/client.ts +0 -298
  330. package/src/lsp/languages.ts +0 -119
  331. package/src/lsp/manager.ts +0 -294
  332. package/src/mcp/client.ts +0 -402
  333. package/src/mcp/index.ts +0 -5
  334. package/src/mcp/manager.ts +0 -133
  335. package/src/nimbus.ts +0 -234
  336. package/src/plugins/index.ts +0 -27
  337. package/src/plugins/loader.ts +0 -334
  338. package/src/plugins/manager.ts +0 -376
  339. package/src/plugins/types.ts +0 -284
  340. package/src/scanners/cicd-scanner.ts +0 -258
  341. package/src/scanners/cloud-scanner.ts +0 -466
  342. package/src/scanners/framework-scanner.ts +0 -469
  343. package/src/scanners/iac-scanner.ts +0 -388
  344. package/src/scanners/index.ts +0 -539
  345. package/src/scanners/language-scanner.ts +0 -276
  346. package/src/scanners/package-manager-scanner.ts +0 -277
  347. package/src/scanners/types.ts +0 -172
  348. package/src/sessions/manager.ts +0 -472
  349. package/src/sessions/types.ts +0 -44
  350. package/src/sharing/sync.ts +0 -300
  351. package/src/sharing/viewer.ts +0 -163
  352. package/src/snapshots/index.ts +0 -2
  353. package/src/snapshots/manager.ts +0 -530
  354. package/src/state/artifacts.ts +0 -147
  355. package/src/state/audit.ts +0 -137
  356. package/src/state/billing.ts +0 -240
  357. package/src/state/checkpoints.ts +0 -117
  358. package/src/state/config.ts +0 -67
  359. package/src/state/conversations.ts +0 -14
  360. package/src/state/credentials.ts +0 -154
  361. package/src/state/db.ts +0 -58
  362. package/src/state/index.ts +0 -26
  363. package/src/state/messages.ts +0 -115
  364. package/src/state/projects.ts +0 -123
  365. package/src/state/schema.ts +0 -236
  366. package/src/state/sessions.ts +0 -147
  367. package/src/state/teams.ts +0 -200
  368. package/src/telemetry.ts +0 -108
  369. package/src/tools/aws-ops.ts +0 -952
  370. package/src/tools/azure-ops.ts +0 -579
  371. package/src/tools/file-ops.ts +0 -615
  372. package/src/tools/gcp-ops.ts +0 -625
  373. package/src/tools/git-ops.ts +0 -773
  374. package/src/tools/github-ops.ts +0 -799
  375. package/src/tools/helm-ops.ts +0 -943
  376. package/src/tools/index.ts +0 -17
  377. package/src/tools/k8s-ops.ts +0 -819
  378. package/src/tools/schemas/converter.ts +0 -184
  379. package/src/tools/schemas/devops.ts +0 -3502
  380. package/src/tools/schemas/index.ts +0 -73
  381. package/src/tools/schemas/standard.ts +0 -1148
  382. package/src/tools/schemas/types.ts +0 -735
  383. package/src/tools/spawn-exec.ts +0 -148
  384. package/src/tools/terraform-ops.ts +0 -862
  385. package/src/types/ambient.d.ts +0 -193
  386. package/src/types/config.ts +0 -83
  387. package/src/types/drift.ts +0 -116
  388. package/src/types/enterprise.ts +0 -335
  389. package/src/types/index.ts +0 -20
  390. package/src/types/plan.ts +0 -44
  391. package/src/types/request.ts +0 -65
  392. package/src/types/response.ts +0 -54
  393. package/src/types/service.ts +0 -51
  394. package/src/ui/App.tsx +0 -2114
  395. package/src/ui/DeployPreview.tsx +0 -174
  396. package/src/ui/FileDiffModal.tsx +0 -162
  397. package/src/ui/Header.tsx +0 -131
  398. package/src/ui/HelpModal.tsx +0 -57
  399. package/src/ui/InputBox.tsx +0 -503
  400. package/src/ui/MessageList.tsx +0 -1032
  401. package/src/ui/PermissionPrompt.tsx +0 -163
  402. package/src/ui/StatusBar.tsx +0 -277
  403. package/src/ui/TerminalPane.tsx +0 -84
  404. package/src/ui/ToolCallDisplay.tsx +0 -643
  405. package/src/ui/TreePane.tsx +0 -132
  406. package/src/ui/chat-ui.ts +0 -850
  407. package/src/ui/index.ts +0 -33
  408. package/src/ui/ink/index.ts +0 -1444
  409. package/src/ui/streaming.ts +0 -176
  410. package/src/ui/theme.ts +0 -104
  411. package/src/ui/types.ts +0 -75
  412. package/src/utils/analytics.ts +0 -72
  413. package/src/utils/cost-warning.ts +0 -27
  414. package/src/utils/env.ts +0 -46
  415. package/src/utils/errors.ts +0 -69
  416. package/src/utils/event-bus.ts +0 -38
  417. package/src/utils/index.ts +0 -24
  418. package/src/utils/logger.ts +0 -171
  419. package/src/utils/rate-limiter.ts +0 -121
  420. package/src/utils/service-auth.ts +0 -49
  421. package/src/utils/validation.ts +0 -53
  422. package/src/version.ts +0 -4
  423. package/src/watcher/index.ts +0 -214
  424. package/src/wizard/approval.ts +0 -383
  425. package/src/wizard/index.ts +0 -25
  426. package/src/wizard/prompts.ts +0 -338
  427. package/src/wizard/types.ts +0 -172
  428. package/src/wizard/ui.ts +0 -556
  429. package/src/wizard/wizard.ts +0 -304
  430. package/tsconfig.json +0 -24
package/src/cli/init.ts DELETED
@@ -1,1227 +0,0 @@
1
- /**
2
- * Project Initialization & Auto-Detection
3
- *
4
- * Scaffolds a new Nimbus project by detecting the existing project type,
5
- * infrastructure tooling, cloud providers, and development conventions.
6
- * Generates a NIMBUS.md file and .nimbus/ configuration directory.
7
- *
8
- * Usage:
9
- * nimbus init
10
- * nimbus init --force # overwrite existing NIMBUS.md
11
- * nimbus init --quiet # suppress console output
12
- */
13
-
14
- import * as fs from 'node:fs';
15
- import * as path from 'node:path';
16
- import { exec } from 'node:child_process';
17
- import { promisify } from 'node:util';
18
-
19
- const _execAsync = promisify(exec);
20
-
21
- // ---------------------------------------------------------------------------
22
- // Types
23
- // ---------------------------------------------------------------------------
24
-
25
- /** Detected language / runtime of the project */
26
- export type ProjectType =
27
- | 'typescript'
28
- | 'javascript'
29
- | 'go'
30
- | 'python'
31
- | 'rust'
32
- | 'java'
33
- | 'unknown';
34
-
35
- /** Infrastructure tool category */
36
- export type InfraType = 'terraform' | 'kubernetes' | 'helm' | 'docker' | 'cicd';
37
-
38
- /** Cloud provider identifier */
39
- export type CloudProvider = 'aws' | 'gcp' | 'azure';
40
-
41
- /** Complete detection result for a project directory */
42
- export interface ProjectDetection {
43
- /** Inferred project name (directory basename) */
44
- projectName: string;
45
- /** Primary language / runtime */
46
- projectType: ProjectType;
47
- /** Infrastructure tools found */
48
- infraTypes: InfraType[];
49
- /** Cloud providers detected from config or Terraform */
50
- cloudProviders: CloudProvider[];
51
- /** Whether the directory is a git repository */
52
- hasGit: boolean;
53
- /** Node.js package manager, if applicable */
54
- packageManager?: 'npm' | 'yarn' | 'pnpm' | 'bun';
55
- /** Test framework name, if detected */
56
- testFramework?: string;
57
- /** Linter name, if detected */
58
- linter?: string;
59
- /** Formatter name, if detected */
60
- formatter?: string;
61
- }
62
-
63
- /** Options accepted by {@link runInit} */
64
- export interface InitOptions {
65
- /** Working directory (defaults to `process.cwd()`) */
66
- cwd?: string;
67
- /** Overwrite an existing NIMBUS.md without prompting */
68
- force?: boolean;
69
- /** Suppress all console output */
70
- quiet?: boolean;
71
- /**
72
- * Merge mode (M2): append a ## Local Overrides section to an existing
73
- * NIMBUS.md and create .nimbus/local.md instead of overwriting the file.
74
- */
75
- merge?: boolean;
76
- }
77
-
78
- /** Value returned by {@link runInit} on success */
79
- export interface InitResult {
80
- /** Full detection results */
81
- detection: ProjectDetection;
82
- /** Absolute paths of files created during init */
83
- filesCreated: string[];
84
- /** Absolute path to the generated NIMBUS.md */
85
- nimbusmdPath: string;
86
- }
87
-
88
- // ---------------------------------------------------------------------------
89
- // Internal helpers
90
- // ---------------------------------------------------------------------------
91
-
92
- /**
93
- * Check whether a file or directory exists at `filePath`.
94
- * Swallows all errors and returns `false` on failure.
95
- */
96
- function exists(filePath: string): boolean {
97
- try {
98
- return fs.existsSync(filePath);
99
- } catch {
100
- return false;
101
- }
102
- }
103
-
104
- /**
105
- * List immediate children of `dir`, returning an empty array when the
106
- * directory does not exist or is unreadable.
107
- */
108
- function listDir(dir: string): string[] {
109
- try {
110
- return fs.readdirSync(dir);
111
- } catch {
112
- return [];
113
- }
114
- }
115
-
116
- /**
117
- * Read a file as UTF-8 text. Returns an empty string on failure.
118
- */
119
- function readText(filePath: string): string {
120
- try {
121
- return fs.readFileSync(filePath, 'utf-8');
122
- } catch {
123
- return '';
124
- }
125
- }
126
-
127
- /**
128
- * Recursively collect file names matching a predicate.
129
- * Searches at most `maxDepth` levels deep and stops after `limit` matches.
130
- */
131
- function findFiles(
132
- dir: string,
133
- predicate: (name: string) => boolean,
134
- maxDepth = 3,
135
- limit = 50
136
- ): string[] {
137
- const results: string[] = [];
138
-
139
- function walk(current: string, depth: number): void {
140
- if (depth > maxDepth || results.length >= limit) {
141
- return;
142
- }
143
-
144
- for (const entry of listDir(current)) {
145
- if (results.length >= limit) {
146
- return;
147
- }
148
-
149
- // Skip heavy directories that would slow detection
150
- if (entry === 'node_modules' || entry === '.git' || entry === 'dist' || entry === 'vendor') {
151
- continue;
152
- }
153
-
154
- const full = path.join(current, entry);
155
-
156
- try {
157
- const stat = fs.statSync(full);
158
- if (stat.isDirectory()) {
159
- walk(full, depth + 1);
160
- } else if (predicate(entry)) {
161
- results.push(full);
162
- }
163
- } catch {
164
- // Permission or broken symlink -- skip
165
- }
166
- }
167
- }
168
-
169
- walk(dir, 0);
170
- return results;
171
- }
172
-
173
- // ---------------------------------------------------------------------------
174
- // Detection functions
175
- // ---------------------------------------------------------------------------
176
-
177
- /**
178
- * Detect the primary project type from marker files in `dir`.
179
- *
180
- * Priority order: TypeScript > JavaScript > Go > Python > Rust > Java > unknown
181
- */
182
- export function detectProjectType(dir: string): ProjectType {
183
- try {
184
- if (exists(path.join(dir, 'tsconfig.json'))) {
185
- return 'typescript';
186
- }
187
- if (exists(path.join(dir, 'package.json'))) {
188
- return 'javascript';
189
- }
190
- if (exists(path.join(dir, 'go.mod'))) {
191
- return 'go';
192
- }
193
- if (
194
- exists(path.join(dir, 'pyproject.toml')) ||
195
- exists(path.join(dir, 'setup.py')) ||
196
- exists(path.join(dir, 'requirements.txt'))
197
- ) {
198
- return 'python';
199
- }
200
- if (exists(path.join(dir, 'Cargo.toml'))) {
201
- return 'rust';
202
- }
203
- if (
204
- exists(path.join(dir, 'pom.xml')) ||
205
- exists(path.join(dir, 'build.gradle')) ||
206
- exists(path.join(dir, 'build.gradle.kts'))
207
- ) {
208
- return 'java';
209
- }
210
- } catch {
211
- // Fall through to unknown
212
- }
213
-
214
- return 'unknown';
215
- }
216
-
217
- /**
218
- * Detect which infrastructure tools are present in `dir`.
219
- *
220
- * Scans for Terraform files, Kubernetes manifests, Helm charts,
221
- * Docker files, and CI/CD configuration.
222
- */
223
- export function detectInfrastructure(dir: string): InfraType[] {
224
- const found: Set<InfraType> = new Set();
225
-
226
- try {
227
- // Terraform -- look for any .tf files
228
- const tfFiles = findFiles(dir, name => name.endsWith('.tf'), 3, 5);
229
- if (tfFiles.length > 0) {
230
- found.add('terraform');
231
- }
232
-
233
- // Kubernetes -- look for YAML files containing common K8s markers
234
- const yamlFiles = findFiles(
235
- dir,
236
- name => name.endsWith('.yaml') || name.endsWith('.yml'),
237
- 3,
238
- 30
239
- );
240
- for (const yamlFile of yamlFiles) {
241
- const content = readText(yamlFile);
242
- if (
243
- content.includes('kind: Deployment') ||
244
- content.includes('kind: Service') ||
245
- content.includes('apiVersion:')
246
- ) {
247
- found.add('kubernetes');
248
- break;
249
- }
250
- }
251
-
252
- // Helm
253
- if (findFiles(dir, name => name === 'Chart.yaml', 3, 1).length > 0) {
254
- found.add('helm');
255
- }
256
-
257
- // Docker
258
- const entries = listDir(dir);
259
- if (
260
- entries.some(
261
- e => e === 'Dockerfile' || e === 'docker-compose.yml' || e === 'docker-compose.yaml'
262
- )
263
- ) {
264
- found.add('docker');
265
- }
266
- // Also check for a docker/ directory with Dockerfiles
267
- if (exists(path.join(dir, 'docker'))) {
268
- const dockerDir = listDir(path.join(dir, 'docker'));
269
- if (
270
- dockerDir.some(e => e.startsWith('Dockerfile') || e.endsWith('.yml') || e.endsWith('.yaml'))
271
- ) {
272
- found.add('docker');
273
- }
274
- }
275
-
276
- // CI/CD
277
- if (
278
- exists(path.join(dir, '.github', 'workflows')) ||
279
- exists(path.join(dir, '.gitlab-ci.yml')) ||
280
- exists(path.join(dir, 'Jenkinsfile')) ||
281
- exists(path.join(dir, '.circleci'))
282
- ) {
283
- found.add('cicd');
284
- }
285
- } catch {
286
- // Return whatever we collected so far
287
- }
288
-
289
- return Array.from(found);
290
- }
291
-
292
- /**
293
- * Detect cloud providers referenced in Terraform files or local credentials.
294
- *
295
- * Checks both `.tf` file contents and well-known credential locations
296
- * or environment variables.
297
- */
298
- export function detectCloudProviders(dir: string): CloudProvider[] {
299
- const found: Set<CloudProvider> = new Set();
300
-
301
- try {
302
- // --- Scan Terraform files for provider blocks ---
303
- const tfFiles = findFiles(dir, name => name.endsWith('.tf'), 3, 20);
304
-
305
- for (const tfFile of tfFiles) {
306
- const content = readText(tfFile);
307
-
308
- if (content.includes('provider "aws"') || content.includes("provider 'aws'")) {
309
- found.add('aws');
310
- }
311
- if (content.includes('provider "google"') || content.includes("provider 'google'")) {
312
- found.add('gcp');
313
- }
314
- if (content.includes('provider "azurerm"') || content.includes("provider 'azurerm'")) {
315
- found.add('azure');
316
- }
317
- }
318
-
319
- // --- Check environment variables ---
320
- if (process.env['AWS_ACCESS_KEY_ID'] || process.env['AWS_PROFILE']) {
321
- found.add('aws');
322
- }
323
- if (process.env['GOOGLE_APPLICATION_CREDENTIALS'] || process.env['GCLOUD_PROJECT']) {
324
- found.add('gcp');
325
- }
326
- if (process.env['AZURE_SUBSCRIPTION_ID'] || process.env['ARM_SUBSCRIPTION_ID']) {
327
- found.add('azure');
328
- }
329
-
330
- // --- Check local credential files ---
331
- const home = process.env['HOME'] ?? process.env['USERPROFILE'] ?? '';
332
- if (home) {
333
- if (
334
- exists(path.join(home, '.aws', 'credentials')) ||
335
- exists(path.join(home, '.aws', 'config'))
336
- ) {
337
- found.add('aws');
338
- }
339
- if (exists(path.join(home, '.config', 'gcloud'))) {
340
- found.add('gcp');
341
- }
342
- if (exists(path.join(home, '.azure'))) {
343
- found.add('azure');
344
- }
345
- }
346
- } catch {
347
- // Return whatever we collected
348
- }
349
-
350
- return Array.from(found);
351
- }
352
-
353
- /** Live infrastructure context gathered by querying actual CLI tools */
354
- export interface InfraContext {
355
- terraformWorkspace?: string;
356
- terraformBackend?: string;
357
- kubectlContext?: string;
358
- kubectlClusters?: string[];
359
- helmReleases?: string[];
360
- awsAccount?: string;
361
- awsRegion?: string;
362
- /** G13: Named AWS profiles from ~/.aws/config (max 10) */
363
- awsProfiles?: Array<{ profile: string; account?: string; region?: string }>;
364
- gcpProject?: string;
365
- /** G16: Number of Kubernetes namespaces in the current cluster */
366
- k8sNamespaceCount?: number;
367
- /** G16: Number of Kubernetes deployments across all namespaces */
368
- k8sDeploymentCount?: number;
369
- /** CI/CD pipeline system detected in the project directory (G9). */
370
- cicdPipeline?: string;
371
- }
372
-
373
- /**
374
- * Discover live infrastructure context by querying CLI tools.
375
- * All queries are best-effort with short timeouts.
376
- */
377
- export async function discoverInfraContext(dir: string): Promise<InfraContext> {
378
- const { execFileSync } = await import('node:child_process');
379
- const ctx: InfraContext = {};
380
-
381
- // Terraform workspace (only if .terraform exists)
382
- if (exists(path.join(dir, '.terraform'))) {
383
- try {
384
- ctx.terraformWorkspace = execFileSync('terraform', ['workspace', 'show'], {
385
- cwd: dir, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'],
386
- }).trim();
387
- } catch { /* ignore */ }
388
- }
389
-
390
- // kubectl context
391
- try {
392
- ctx.kubectlContext = execFileSync('kubectl', ['config', 'current-context'], {
393
- encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'],
394
- }).trim();
395
- const clustersOut = execFileSync('kubectl', ['config', 'get-clusters'], {
396
- encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'],
397
- });
398
- ctx.kubectlClusters = clustersOut.split('\n').slice(1).map(s => s.trim()).filter(Boolean);
399
- } catch { /* ignore */ }
400
-
401
- // Helm releases
402
- try {
403
- const helmOut = execFileSync('helm', ['list', '-A', '--output=json'], {
404
- encoding: 'utf-8', timeout: 10000, stdio: ['pipe', 'pipe', 'pipe'],
405
- });
406
- const releases = JSON.parse(helmOut || '[]') as Array<{ name: string; namespace: string }>;
407
- ctx.helmReleases = releases.map(r => `${r.name} (${r.namespace})`);
408
- } catch { /* ignore */ }
409
-
410
- // AWS account + region
411
- try {
412
- const awsIdOut = execFileSync('aws', ['sts', 'get-caller-identity', '--output=json'], {
413
- encoding: 'utf-8', timeout: 8000, stdio: ['pipe', 'pipe', 'pipe'],
414
- });
415
- const awsId = JSON.parse(awsIdOut);
416
- ctx.awsAccount = awsId.Account;
417
- } catch { /* ignore */ }
418
-
419
- try {
420
- ctx.awsRegion = execFileSync('aws', ['configure', 'get', 'region'], {
421
- encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'],
422
- }).trim() || process.env.AWS_DEFAULT_REGION;
423
- } catch {
424
- ctx.awsRegion = process.env.AWS_DEFAULT_REGION;
425
- }
426
-
427
- // G13: Discover all AWS profiles from ~/.aws/config
428
- try {
429
- const { readFileSync } = await import('node:fs');
430
- const { homedir } = await import('node:os');
431
- const awsConfigPath = path.join(homedir(), '.aws', 'config');
432
- if (exists(awsConfigPath)) {
433
- const awsConfig = readFileSync(awsConfigPath, 'utf-8');
434
- const profiles: Array<{ profile: string; account?: string; region?: string }> = [];
435
- const profileRegex = /^\[(?:profile\s+)?(\S+)\]/gm;
436
- let match;
437
- while ((match = profileRegex.exec(awsConfig)) !== null) {
438
- const profileName = match[1];
439
- if (profileName === 'default') continue; // handled separately
440
- // Extract region from the profile block
441
- const blockStart = match.index + match[0].length;
442
- const nextBlock = awsConfig.indexOf('\n[', blockStart);
443
- const block = awsConfig.slice(blockStart, nextBlock === -1 ? undefined : nextBlock);
444
- const regionMatch = block.match(/^\s*region\s*=\s*(.+)$/m);
445
- profiles.push({ profile: profileName, region: regionMatch?.[1]?.trim() });
446
- }
447
- if (profiles.length > 0) ctx.awsProfiles = profiles.slice(0, 10); // max 10 profiles
448
- }
449
- } catch { /* ignore */ }
450
-
451
- // GCP project
452
- try {
453
- const proj = execFileSync('gcloud', ['config', 'get-value', 'project'], {
454
- encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'],
455
- }).trim();
456
- if (proj && proj !== '(unset)') ctx.gcpProject = proj;
457
- } catch { /* ignore */ }
458
-
459
- // G16: Count K8s namespaces and deployments
460
- if (ctx.kubectlContext) {
461
- try {
462
- const nsOut = execFileSync('kubectl', ['get', 'namespaces', '--no-headers'], {
463
- encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'],
464
- });
465
- const nsCount = nsOut.trim().split('\n').filter(Boolean).length;
466
- ctx.k8sNamespaceCount = nsCount;
467
- } catch { /* ignore */ }
468
- try {
469
- const deplOut = execFileSync('kubectl', ['get', 'deployments', '-A', '--no-headers'], {
470
- encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'],
471
- });
472
- const deplCount = deplOut.trim().split('\n').filter(Boolean).length;
473
- ctx.k8sDeploymentCount = deplCount;
474
- } catch { /* ignore */ }
475
- }
476
-
477
- // CI/CD pipeline detection (G9)
478
- const cicdFiles: Array<[string, string]> = [
479
- ['.github/workflows', 'GitHub Actions'],
480
- ['.gitlab-ci.yml', 'GitLab CI'],
481
- ['.circleci', 'CircleCI'],
482
- ['Jenkinsfile', 'Jenkins'],
483
- ['.buildkite', 'Buildkite'],
484
- ['azure-pipelines.yml', 'Azure Pipelines'],
485
- ];
486
- for (const [file, name] of cicdFiles) {
487
- if (exists(path.join(dir, file))) {
488
- ctx.cicdPipeline = name;
489
- break;
490
- }
491
- }
492
-
493
- return ctx;
494
- }
495
-
496
- /**
497
- * Format an InfraContext into a compact single-line summary for injection
498
- * into agent messages (Gaps 7 & 10).
499
- */
500
- export function formatInfraContext(ctx: InfraContext): string {
501
- const parts: string[] = [];
502
- if (ctx.terraformWorkspace) parts.push(`tf-workspace: ${ctx.terraformWorkspace}`);
503
- if (ctx.kubectlContext) parts.push(`k8s-context: ${ctx.kubectlContext}`);
504
- if (ctx.helmReleases && ctx.helmReleases.length > 0) {
505
- parts.push(`helm-releases: ${ctx.helmReleases.slice(0, 3).join(', ')}${ctx.helmReleases.length > 3 ? ` +${ctx.helmReleases.length - 3} more` : ''}`);
506
- }
507
- if (ctx.awsAccount) parts.push(`aws-account: ${ctx.awsAccount}`);
508
- if (ctx.awsRegion) parts.push(`aws-region: ${ctx.awsRegion}`);
509
- if (ctx.gcpProject) parts.push(`gcp-project: ${ctx.gcpProject}`);
510
- if (ctx.cicdPipeline) parts.push(`cicd: ${ctx.cicdPipeline}`);
511
- return parts.length > 0 ? parts.join(' | ') : 'no infra context detected';
512
- }
513
-
514
- /**
515
- * Detect which Node.js package manager is used in `dir`.
516
- *
517
- * Lock-file priority: bun > yarn > pnpm > npm.
518
- * Returns `undefined` when no lock file is found.
519
- */
520
- export function detectPackageManager(dir: string): 'npm' | 'yarn' | 'pnpm' | 'bun' | undefined {
521
- try {
522
- if (exists(path.join(dir, 'bun.lock')) || exists(path.join(dir, 'bun.lockb'))) {
523
- return 'bun';
524
- }
525
- if (exists(path.join(dir, 'yarn.lock'))) {
526
- return 'yarn';
527
- }
528
- if (exists(path.join(dir, 'pnpm-lock.yaml'))) {
529
- return 'pnpm';
530
- }
531
- if (exists(path.join(dir, 'package-lock.json'))) {
532
- return 'npm';
533
- }
534
- } catch {
535
- // fall through
536
- }
537
- return undefined;
538
- }
539
-
540
- /**
541
- * Detect the test framework from `package.json` dependencies or
542
- * lock-file presence.
543
- *
544
- * Returns the framework name as a human-readable string, or `undefined`
545
- * if none is detected.
546
- */
547
- export function detectTestFramework(dir: string): string | undefined {
548
- try {
549
- const pkgPath = path.join(dir, 'package.json');
550
- if (!exists(pkgPath)) {
551
- return undefined;
552
- }
553
-
554
- const pkg = JSON.parse(readText(pkgPath)) as Record<string, unknown>;
555
- const allDeps = {
556
- ...(pkg['dependencies'] as Record<string, string> | undefined),
557
- ...(pkg['devDependencies'] as Record<string, string> | undefined),
558
- };
559
-
560
- if ('vitest' in allDeps) {
561
- return 'vitest';
562
- }
563
- if ('jest' in allDeps) {
564
- return 'jest';
565
- }
566
- if ('mocha' in allDeps) {
567
- return 'mocha';
568
- }
569
- if ('@playwright/test' in allDeps) {
570
- return 'playwright';
571
- }
572
-
573
- // Bun ships its own test runner -- detect via lock file
574
- if (exists(path.join(dir, 'bun.lock')) || exists(path.join(dir, 'bun.lockb'))) {
575
- return 'bun:test';
576
- }
577
- } catch {
578
- // fall through
579
- }
580
-
581
- // Non-JS projects
582
- if (exists(path.join(dir, 'go.mod'))) {
583
- return 'go test';
584
- }
585
- if (exists(path.join(dir, 'Cargo.toml'))) {
586
- return 'cargo test';
587
- }
588
- if (exists(path.join(dir, 'pyproject.toml')) || exists(path.join(dir, 'setup.py'))) {
589
- const pyproject = readText(path.join(dir, 'pyproject.toml'));
590
- if (pyproject.includes('pytest')) {
591
- return 'pytest';
592
- }
593
- if (exists(path.join(dir, 'pytest.ini')) || exists(path.join(dir, 'setup.cfg'))) {
594
- return 'pytest';
595
- }
596
- return 'unittest';
597
- }
598
-
599
- return undefined;
600
- }
601
-
602
- /**
603
- * Detect the linter used in the project.
604
- *
605
- * Checks for ESLint, Biome, golangci-lint, Ruff, and Clippy configuration.
606
- */
607
- export function detectLinter(dir: string): string | undefined {
608
- try {
609
- const entries = listDir(dir);
610
-
611
- // ESLint (various config formats)
612
- if (entries.some(e => e.startsWith('.eslintrc') || e.startsWith('eslint.config'))) {
613
- return 'eslint';
614
- }
615
-
616
- // Biome
617
- if (entries.includes('biome.json') || entries.includes('biome.jsonc')) {
618
- return 'biome';
619
- }
620
-
621
- // Go -- golangci-lint
622
- if (entries.includes('.golangci.yml') || entries.includes('.golangci.yaml')) {
623
- return 'golangci-lint';
624
- }
625
-
626
- // Python -- ruff
627
- if (entries.includes('ruff.toml') || entries.includes('.ruff.toml')) {
628
- return 'ruff';
629
- }
630
-
631
- // Check pyproject.toml for ruff or flake8
632
- if (exists(path.join(dir, 'pyproject.toml'))) {
633
- const pyproject = readText(path.join(dir, 'pyproject.toml'));
634
- if (pyproject.includes('[tool.ruff]')) {
635
- return 'ruff';
636
- }
637
- if (pyproject.includes('[tool.flake8]')) {
638
- return 'flake8';
639
- }
640
- }
641
-
642
- // Rust -- clippy is part of the toolchain, detect via Cargo.toml
643
- if (exists(path.join(dir, 'Cargo.toml'))) {
644
- return 'clippy';
645
- }
646
- } catch {
647
- // fall through
648
- }
649
- return undefined;
650
- }
651
-
652
- /**
653
- * Detect the code formatter used in the project.
654
- *
655
- * Checks for Prettier, Biome, gofmt, rustfmt, and Black configuration.
656
- */
657
- export function detectFormatter(dir: string): string | undefined {
658
- try {
659
- const entries = listDir(dir);
660
-
661
- // Prettier
662
- if (entries.some(e => e.startsWith('.prettierrc') || e.startsWith('prettier.config'))) {
663
- return 'prettier';
664
- }
665
-
666
- // Biome doubles as formatter
667
- if (entries.includes('biome.json') || entries.includes('biome.jsonc')) {
668
- return 'biome';
669
- }
670
-
671
- // Go -- gofmt is built-in
672
- if (exists(path.join(dir, 'go.mod'))) {
673
- return 'gofmt';
674
- }
675
-
676
- // Rust -- rustfmt
677
- if (exists(path.join(dir, 'rustfmt.toml')) || exists(path.join(dir, '.rustfmt.toml'))) {
678
- return 'rustfmt';
679
- }
680
- if (exists(path.join(dir, 'Cargo.toml'))) {
681
- return 'rustfmt';
682
- }
683
-
684
- // Python -- black / ruff format
685
- if (exists(path.join(dir, 'pyproject.toml'))) {
686
- const pyproject = readText(path.join(dir, 'pyproject.toml'));
687
- if (pyproject.includes('[tool.black]')) {
688
- return 'black';
689
- }
690
- if (pyproject.includes('[tool.ruff]')) {
691
- return 'ruff';
692
- }
693
- }
694
- } catch {
695
- // fall through
696
- }
697
- return undefined;
698
- }
699
-
700
- /**
701
- * Run the full project detection pipeline on `dir`.
702
- *
703
- * Aggregates results from all individual detection functions into a
704
- * single {@link ProjectDetection} object.
705
- */
706
- export function detectProject(dir: string): ProjectDetection {
707
- const resolvedDir = path.resolve(dir);
708
-
709
- return {
710
- projectName: path.basename(resolvedDir),
711
- projectType: detectProjectType(resolvedDir),
712
- infraTypes: detectInfrastructure(resolvedDir),
713
- cloudProviders: detectCloudProviders(resolvedDir),
714
- hasGit: exists(path.join(resolvedDir, '.git')),
715
- packageManager: detectPackageManager(resolvedDir),
716
- testFramework: detectTestFramework(resolvedDir),
717
- linter: detectLinter(resolvedDir),
718
- formatter: detectFormatter(resolvedDir),
719
- };
720
- }
721
-
722
- // ---------------------------------------------------------------------------
723
- // Generation
724
- // ---------------------------------------------------------------------------
725
-
726
- /**
727
- * Produce the contents of a `NIMBUS.md` file from detection results.
728
- *
729
- * The generated markdown serves as both human-readable documentation
730
- * and machine-readable project metadata for the Nimbus agent.
731
- */
732
- export function generateNimbusMd(detection: ProjectDetection, _dir: string, infraCtx?: InfraContext): string {
733
- const lines: string[] = [];
734
-
735
- // --- Header ---
736
- lines.push(`# ${detection.projectName}`);
737
- lines.push('');
738
- lines.push('> Auto-generated by `nimbus init`. Edit freely to refine agent behaviour.');
739
- lines.push('');
740
-
741
- // --- Project Overview ---
742
- lines.push('## Project Overview');
743
- lines.push('');
744
- lines.push(`- **Type:** ${detection.projectType}`);
745
- if (detection.packageManager) {
746
- lines.push(`- **Package Manager:** ${detection.packageManager}`);
747
- }
748
- if (detection.testFramework) {
749
- lines.push(`- **Test Framework:** ${detection.testFramework}`);
750
- }
751
- if (detection.hasGit) {
752
- lines.push('- **Version Control:** git');
753
- }
754
- lines.push('');
755
-
756
- // --- Infrastructure ---
757
- if (detection.infraTypes.length > 0 || detection.cloudProviders.length > 0) {
758
- lines.push('## Infrastructure');
759
- lines.push('');
760
- if (detection.infraTypes.length > 0) {
761
- lines.push(`- **Tools:** ${detection.infraTypes.join(', ')}`);
762
- }
763
- if (detection.cloudProviders.length > 0) {
764
- lines.push(`- **Cloud Providers:** ${detection.cloudProviders.join(', ')}`);
765
- }
766
- if (infraCtx) {
767
- if (infraCtx.terraformWorkspace) {
768
- lines.push(`- **Terraform Workspace:** ${infraCtx.terraformWorkspace}`);
769
- }
770
- if (infraCtx.kubectlContext) {
771
- lines.push(`- **Kubernetes Context:** ${infraCtx.kubectlContext}`);
772
- }
773
- if (infraCtx.kubectlClusters && infraCtx.kubectlClusters.length > 0) {
774
- lines.push(`- **Kubernetes Clusters:** ${infraCtx.kubectlClusters.join(', ')}`);
775
- }
776
- if (infraCtx.helmReleases && infraCtx.helmReleases.length > 0) {
777
- lines.push(`- **Helm Releases:** ${infraCtx.helmReleases.slice(0, 5).join(', ')}${infraCtx.helmReleases.length > 5 ? ` (+${infraCtx.helmReleases.length - 5} more)` : ''}`);
778
- }
779
- if (infraCtx.awsAccount) {
780
- lines.push(`- **AWS Account:** ${infraCtx.awsAccount}${infraCtx.awsRegion ? ` (${infraCtx.awsRegion})` : ''}`);
781
- }
782
- // G13: List named AWS profiles
783
- if (infraCtx.awsProfiles && infraCtx.awsProfiles.length > 0) {
784
- lines.push(`- **AWS Profiles:** ${infraCtx.awsProfiles.map(p => p.profile).join(', ')}`);
785
- }
786
- if (infraCtx.gcpProject) {
787
- lines.push(`- **GCP Project:** ${infraCtx.gcpProject}`);
788
- }
789
- // G16: K8s namespace and deployment counts
790
- if (infraCtx.k8sNamespaceCount !== undefined) {
791
- lines.push(`- **K8s Namespaces:** ${infraCtx.k8sNamespaceCount}`);
792
- }
793
- if (infraCtx.k8sDeploymentCount !== undefined) {
794
- lines.push(`- **K8s Deployments:** ${infraCtx.k8sDeploymentCount}`);
795
- }
796
- // G9: CI/CD pipeline
797
- if (infraCtx.cicdPipeline) {
798
- lines.push(`- **CI/CD:** ${infraCtx.cicdPipeline}`);
799
- }
800
- }
801
- lines.push('');
802
- }
803
-
804
- // --- CI/CD (M4) ---
805
- if (infraCtx?.cicdPipeline) {
806
- lines.push('## CI/CD');
807
- lines.push('');
808
- const pipelineDir: Record<string, string> = {
809
- 'GitHub Actions': '.github/workflows/',
810
- 'GitLab CI': '.gitlab-ci.yml',
811
- 'CircleCI': '.circleci/',
812
- 'Jenkins': 'Jenkinsfile',
813
- };
814
- const pipelinePath = pipelineDir[infraCtx.cicdPipeline] ?? '';
815
- lines.push(`Pipeline: ${infraCtx.cicdPipeline}${pipelinePath ? ` (${pipelinePath})` : ''}`);
816
- lines.push('Convention: Always run `terraform plan` in CI before apply. Apply only on main branch merge.');
817
- lines.push('');
818
- }
819
-
820
- // --- Conventions ---
821
- if (detection.linter || detection.formatter) {
822
- lines.push('## Conventions');
823
- lines.push('');
824
- if (detection.linter) {
825
- lines.push(`- **Linter:** ${detection.linter}`);
826
- }
827
- if (detection.formatter) {
828
- lines.push(`- **Formatter:** ${detection.formatter}`);
829
- }
830
- lines.push('');
831
- }
832
-
833
- // --- Environments (GAP-22) ---
834
- lines.push('## Environments');
835
- lines.push('');
836
- lines.push('| Name | Terraform Workspace | Kubernetes Context | Protected |');
837
- lines.push('|------|--------------------|--------------------|-----------|');
838
- lines.push('| dev | dev | | false |');
839
- lines.push('| staging | staging | | false |');
840
- lines.push('| prod | prod | | true |');
841
- lines.push('');
842
-
843
- // --- Safety Rules ---
844
- lines.push('## Safety Rules');
845
- lines.push('');
846
- lines.push('- Protected branches: `main`, `master`');
847
- lines.push('- Protected Kubernetes namespaces: `production`, `kube-system`');
848
- lines.push('- Always preview before `terraform apply`');
849
- lines.push('- Run tests before committing');
850
- lines.push('- Never store secrets in source control');
851
- lines.push('');
852
-
853
- // --- Guardrails (G5): DevOps-specific rules when infra is detected ---
854
- const hasInfra = detection.infraTypes.length > 0 || detection.cloudProviders.length > 0;
855
- if (hasInfra) {
856
- lines.push('## Guardrails');
857
- lines.push('');
858
- lines.push('- Never run `terraform destroy` without explicit confirmation');
859
- lines.push('- Protected Kubernetes namespaces: `production`, `kube-system`, `monitoring`');
860
- lines.push('- Always show terraform plan before apply');
861
- lines.push('- Confirm target cloud account and region before resource creation');
862
- lines.push('- Protected environments: any workspace/namespace containing `prod`, `prd`, `production`');
863
- lines.push('');
864
- }
865
-
866
- // --- Forbidden placeholder (G5) ---
867
- lines.push('## Forbidden');
868
- lines.push('');
869
- lines.push('<!-- List operations Nimbus must never perform in this project -->');
870
- lines.push('<!-- Example: - Never destroy the production database -->');
871
- lines.push('');
872
-
873
- // --- Custom Instructions ---
874
- lines.push('## Custom Instructions');
875
- lines.push('');
876
- lines.push('<!-- Add project-specific instructions for the Nimbus agent here -->');
877
- lines.push('');
878
-
879
- // --- G18: Runbooks ---
880
- const runbookDirs = ['docs/runbooks', 'runbooks', '.github/runbooks', '.nimbus/runbooks'];
881
- const foundRunbooks: string[] = [];
882
- for (const dir of runbookDirs) {
883
- const fullPath = path.join(_dir, dir);
884
- if (fs.existsSync(fullPath)) {
885
- try {
886
- const files = fs.readdirSync(fullPath).filter(f => /\.(md|yaml|yml)$/.test(f));
887
- foundRunbooks.push(...files.map(f => `- ${dir}/${f}`));
888
- } catch { /* non-critical */ }
889
- }
890
- }
891
- const runbookSection = foundRunbooks.length > 0
892
- ? foundRunbooks.join('\n') + '\n\nRefer to these runbooks for incident response and operational procedures.'
893
- : '<!-- Add runbook references, e.g.:\n- docs/runbooks/cert-rotation.md -->';
894
- lines.push('## Runbooks');
895
- lines.push('');
896
- lines.push(runbookSection);
897
- lines.push('');
898
-
899
- return lines.join('\n');
900
- }
901
-
902
- /**
903
- * Generate the contents of `.nimbus/config.yaml`.
904
- *
905
- * Produces a valid YAML string without requiring an external YAML library.
906
- */
907
- function generateConfigYaml(detection: ProjectDetection): string {
908
- const lines: string[] = [];
909
-
910
- lines.push('# Nimbus project configuration');
911
- lines.push('# See https://nimbus.dev/docs/config for all options');
912
- lines.push('');
913
- lines.push('# Default LLM model for agent interactions');
914
- lines.push('default_model: anthropic/claude-sonnet-4');
915
- lines.push('');
916
- lines.push('# Default agent mode: build | plan | debug | review');
917
- lines.push('default_mode: build');
918
- lines.push('');
919
- lines.push('# Project metadata');
920
- lines.push('project:');
921
- lines.push(` name: ${detection.projectName}`);
922
- lines.push(` type: ${detection.projectType}`);
923
- if (detection.packageManager) {
924
- lines.push(` package_manager: ${detection.packageManager}`);
925
- }
926
- lines.push('');
927
-
928
- // Permissions
929
- lines.push('# Permission rules control what the agent can do without asking');
930
- lines.push('permissions:');
931
- lines.push(' # File operations');
932
- lines.push(' file_read: allow');
933
- lines.push(' file_write: ask');
934
- lines.push(' file_delete: deny');
935
- lines.push('');
936
- lines.push(' # Shell commands');
937
- lines.push(' shell_read: allow # non-destructive commands (ls, cat, git status)');
938
- lines.push(' shell_write: ask # potentially destructive commands');
939
- lines.push('');
940
- lines.push(' # Git operations');
941
- lines.push(' git_read: allow');
942
- lines.push(' git_write: ask');
943
- lines.push('');
944
- lines.push(' # Infrastructure operations');
945
- lines.push(' terraform_plan: allow');
946
- lines.push(' terraform_apply: deny');
947
- lines.push(' kubectl_read: allow');
948
- lines.push(' kubectl_write: deny');
949
- lines.push('');
950
-
951
- // Safety
952
- lines.push('# Safety settings');
953
- lines.push('safety:');
954
- lines.push(' protected_branches:');
955
- lines.push(' - main');
956
- lines.push(' - master');
957
- lines.push(' protected_k8s_namespaces:');
958
- lines.push(' - production');
959
- lines.push(' - kube-system');
960
- lines.push(' require_plan_before_apply: true');
961
- lines.push(' require_tests_before_commit: true');
962
- lines.push('');
963
-
964
- return lines.join('\n');
965
- }
966
-
967
- // ---------------------------------------------------------------------------
968
- // Main init
969
- // ---------------------------------------------------------------------------
970
-
971
- /**
972
- * Initialize a Nimbus project in the given directory.
973
- *
974
- * Creates the `.nimbus/` directory structure and a `NIMBUS.md` file
975
- * populated with auto-detected project metadata.
976
- *
977
- * @param options - Configuration for the init process
978
- * @returns The detection results and list of created files
979
- *
980
- * @example
981
- * ```ts
982
- * const result = await runInit({ cwd: '/path/to/project' });
983
- * console.log(result.detection.projectType); // 'typescript'
984
- * console.log(result.filesCreated); // ['.nimbus/config.yaml', ...]
985
- * ```
986
- */
987
- export async function runInit(options?: InitOptions): Promise<InitResult> {
988
- const dir = path.resolve(options?.cwd ?? process.cwd());
989
- const force = options?.force ?? false;
990
- const quiet = options?.quiet ?? false;
991
- const merge = options?.merge ?? false;
992
-
993
- const log = (msg: string): void => {
994
- if (!quiet) {
995
- console.log(msg);
996
- }
997
- };
998
-
999
- // ---- M2: --merge mode — append Local Overrides section, don't overwrite ----
1000
- const nimbusmdPathEarly = path.join(dir, 'NIMBUS.md');
1001
- if (merge && exists(nimbusmdPathEarly)) {
1002
- const content = fs.readFileSync(nimbusmdPathEarly, 'utf-8');
1003
- const filesCreated: string[] = [];
1004
-
1005
- if (!content.includes('## Local Overrides')) {
1006
- fs.appendFileSync(nimbusmdPathEarly, '\n\n## Local Overrides\n\n<!-- Personal additions -->\n', 'utf-8');
1007
- log(' Appended ## Local Overrides section to NIMBUS.md');
1008
- } else {
1009
- log(' NIMBUS.md already has a ## Local Overrides section');
1010
- }
1011
-
1012
- const localMdPath = path.join(dir, '.nimbus', 'local.md');
1013
- if (!exists(localMdPath)) {
1014
- fs.mkdirSync(path.join(dir, '.nimbus'), { recursive: true });
1015
- fs.writeFileSync(localMdPath, '# Local Overrides\n\n<!-- Personal notes and overrides that are not committed -->\n', 'utf-8');
1016
- log(' Created .nimbus/local.md for personal overrides');
1017
- filesCreated.push(localMdPath);
1018
- }
1019
-
1020
- const detection = detectProject(dir);
1021
- return { detection, filesCreated, nimbusmdPath: nimbusmdPathEarly };
1022
- }
1023
-
1024
- // ---- Step 1: Detect project characteristics ----
1025
- log('Detecting project...');
1026
- const detection = detectProject(dir);
1027
-
1028
- log(` Project type: ${detection.projectType}`);
1029
- if (detection.packageManager) {
1030
- log(` Package manager: ${detection.packageManager}`);
1031
- }
1032
- if (detection.infraTypes.length > 0) {
1033
- log(` Infrastructure: ${detection.infraTypes.join(', ')}`);
1034
- }
1035
- if (detection.cloudProviders.length > 0) {
1036
- log(` Cloud providers: ${detection.cloudProviders.join(', ')}`);
1037
- }
1038
- if (detection.testFramework) {
1039
- log(` Test framework: ${detection.testFramework}`);
1040
- }
1041
-
1042
- // ---- Step 2: Check for existing NIMBUS.md and show diff (L8) ----
1043
- const nimbusmdPath = path.join(dir, 'NIMBUS.md');
1044
- if (exists(nimbusmdPath) && !force && !quiet) {
1045
- // Generate the new content first for diffing
1046
- const infraCtxForDiff = await discoverInfraContext(dir).catch(() => undefined);
1047
- const newContent = generateNimbusMd(detection, dir, infraCtxForDiff);
1048
- const existingContent = readText(nimbusmdPath);
1049
-
1050
- if (newContent === existingContent) {
1051
- log('NIMBUS.md is already up to date.');
1052
- return { detection, filesCreated: [], nimbusmdPath };
1053
- }
1054
-
1055
- // Show line-level diff
1056
- const oldLines = existingContent.split('\n');
1057
- const newLines = newContent.split('\n');
1058
- const diffLines: string[] = [];
1059
- const maxLen = Math.max(oldLines.length, newLines.length);
1060
- for (let idx = 0; idx < maxLen; idx++) {
1061
- const o = oldLines[idx];
1062
- const n = newLines[idx];
1063
- if (o === undefined) diffLines.push(`+ ${n}`);
1064
- else if (n === undefined) diffLines.push(`- ${o}`);
1065
- else if (o !== n) { diffLines.push(`- ${o}`); diffLines.push(`+ ${n}`); }
1066
- }
1067
-
1068
- if (diffLines.length > 0) {
1069
- log('\nNIMBUS.md changes:');
1070
- for (const dl of diffLines.slice(0, 50)) {
1071
- if (dl.startsWith('+')) log(` \x1b[32m${dl}\x1b[0m`);
1072
- else if (dl.startsWith('-')) log(` \x1b[31m${dl}\x1b[0m`);
1073
- else log(` ${dl}`);
1074
- }
1075
- if (diffLines.length > 50) log(` ... and ${diffLines.length - 50} more changes`);
1076
- log('');
1077
- log('Apply these changes? [y/N]');
1078
-
1079
- // Synchronous readline for non-quiet mode
1080
- const answer = await new Promise<string>(resolve => {
1081
- const { createInterface } = require('readline') as typeof import('readline');
1082
- const rl = createInterface({ input: process.stdin, output: process.stdout });
1083
- rl.question('', (ans: string) => { rl.close(); resolve(ans.trim()); });
1084
- });
1085
-
1086
- if (answer.toLowerCase() !== 'y') {
1087
- log('Aborted — NIMBUS.md not changed.');
1088
- return { detection, filesCreated: [], nimbusmdPath };
1089
- }
1090
-
1091
- fs.writeFileSync(nimbusmdPath, newContent, 'utf-8');
1092
- log(' Updated NIMBUS.md');
1093
- return { detection, filesCreated: [nimbusmdPath], nimbusmdPath };
1094
- }
1095
- } else if (exists(nimbusmdPath) && !force) {
1096
- // quiet mode — skip without prompting
1097
- return { detection, filesCreated: [], nimbusmdPath };
1098
- }
1099
-
1100
- // ---- Step 3: Create .nimbus/ directory structure ----
1101
- const filesCreated: string[] = [];
1102
- const nimbusDirPath = path.join(dir, '.nimbus');
1103
- const hooksDirPath = path.join(nimbusDirPath, 'hooks');
1104
- const agentsDirPath = path.join(nimbusDirPath, 'agents');
1105
-
1106
- if (!exists(nimbusDirPath)) {
1107
- fs.mkdirSync(nimbusDirPath, { recursive: true });
1108
- }
1109
- if (!exists(hooksDirPath)) {
1110
- fs.mkdirSync(hooksDirPath, { recursive: true });
1111
- }
1112
- if (!exists(agentsDirPath)) {
1113
- fs.mkdirSync(agentsDirPath, { recursive: true });
1114
- }
1115
-
1116
- // ---- Step 4: Create .nimbus/config.yaml ----
1117
- const configPath = path.join(nimbusDirPath, 'config.yaml');
1118
- if (!exists(configPath) || force) {
1119
- const configContent = generateConfigYaml(detection);
1120
- fs.writeFileSync(configPath, configContent, 'utf-8');
1121
- filesCreated.push(configPath);
1122
- log(' Created .nimbus/config.yaml');
1123
- }
1124
-
1125
- // ---- Step 5: Create placeholder hook files ----
1126
- const preCommitHookPath = path.join(hooksDirPath, 'pre-commit.ts');
1127
- if (!exists(preCommitHookPath) || force) {
1128
- const preCommitContent = [
1129
- '/**',
1130
- ' * Nimbus pre-commit hook',
1131
- ' *',
1132
- ' * Runs automatically before each commit when enabled.',
1133
- ' * Add custom validation logic here.',
1134
- ' */',
1135
- '',
1136
- 'export default async function preCommit(): Promise<void> {',
1137
- ' // Example: ensure tests pass before committing',
1138
- ' // await $`bun test`;',
1139
- '}',
1140
- '',
1141
- ].join('\n');
1142
- fs.writeFileSync(preCommitHookPath, preCommitContent, 'utf-8');
1143
- filesCreated.push(preCommitHookPath);
1144
- log(' Created .nimbus/hooks/pre-commit.ts');
1145
- }
1146
-
1147
- // ---- Step 6: Create placeholder agent config ----
1148
- const defaultAgentPath = path.join(agentsDirPath, 'default.yaml');
1149
- if (!exists(defaultAgentPath) || force) {
1150
- const agentContent = [
1151
- '# Default agent profile',
1152
- '# Customize the system prompt and tool access for this agent',
1153
- '',
1154
- 'name: default',
1155
- 'description: General-purpose Nimbus agent',
1156
- '',
1157
- 'tools:',
1158
- ' - file_read',
1159
- ' - file_write',
1160
- ' - shell',
1161
- ' - git',
1162
- '',
1163
- 'system_prompt: |',
1164
- ` You are working on the ${detection.projectName} project.`,
1165
- ` It is a ${detection.projectType} project.`,
1166
- ' Follow the safety rules in NIMBUS.md.',
1167
- '',
1168
- ].join('\n');
1169
- fs.writeFileSync(defaultAgentPath, agentContent, 'utf-8');
1170
- filesCreated.push(defaultAgentPath);
1171
- log(' Created .nimbus/agents/default.yaml');
1172
- }
1173
-
1174
- // ---- Step 7: Generate and write NIMBUS.md ----
1175
- // L8: Monorepo detection — scan immediate subdirs for terraform roots
1176
- let monorepoSection = '';
1177
- try {
1178
- const subdirs = fs.readdirSync(dir, { withFileTypes: true })
1179
- .filter(e => e.isDirectory() && !e.name.startsWith('.') && !['node_modules', '.git'].includes(e.name))
1180
- .map(e => e.name);
1181
- const tfRoots: string[] = [];
1182
- for (const sub of subdirs.slice(0, 20)) {
1183
- const subPath = path.join(dir, sub);
1184
- const hasTf = fs.readdirSync(subPath).some(f => f.endsWith('.tf'));
1185
- if (hasTf) tfRoots.push(sub);
1186
- }
1187
- if (tfRoots.length > 1) {
1188
- monorepoSection = `\n## Terraform Modules (Monorepo)\n\nThis is a monorepo with multiple Terraform roots:\n${tfRoots.map(r => `- \`./${r}/\``).join('\n')}\n\nTo target a specific root, \`cd\` into the directory or specify the path.\n`;
1189
- log(` Detected ${tfRoots.length} Terraform roots (monorepo)`);
1190
- }
1191
- } catch { /* non-critical */ }
1192
-
1193
- const nimbusmdContent = generateNimbusMd(detection, dir) + monorepoSection;
1194
- fs.writeFileSync(nimbusmdPath, nimbusmdContent, 'utf-8');
1195
- filesCreated.push(nimbusmdPath);
1196
- log(' Created NIMBUS.md');
1197
-
1198
- // ---- Step 8: Append .nimbus/ to .gitignore if not already present ----
1199
- const gitignorePath = path.join(dir, '.gitignore');
1200
- if (exists(gitignorePath)) {
1201
- const gitignore = readText(gitignorePath);
1202
- if (!gitignore.includes('.nimbus/')) {
1203
- fs.appendFileSync(gitignorePath, '\n# Nimbus local config\n.nimbus/\n', 'utf-8');
1204
- log(' Updated .gitignore');
1205
- }
1206
- }
1207
-
1208
- log('');
1209
- log('Nimbus project initialized successfully.');
1210
- log('Edit NIMBUS.md to customise agent behaviour.');
1211
-
1212
- // M5: Print next steps after generating NIMBUS.md
1213
- if (!quiet) {
1214
- log('');
1215
- log('\x1b[36mNext steps:\x1b[0m');
1216
- log(' nimbus plan Preview infrastructure changes');
1217
- log(' nimbus doctor Check your DevOps toolchain');
1218
- log(' nimbus status Live infrastructure health dashboard');
1219
- log(' nimbus Open the interactive DevOps agent');
1220
- }
1221
-
1222
- return {
1223
- detection,
1224
- filesCreated,
1225
- nimbusmdPath,
1226
- };
1227
- }