@local-labs-jpollock/local-addon-nexus-ai 0.1.14 → 0.2.1

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 (453) hide show
  1. package/README.md +13 -3
  2. package/lib/cli/bootstrap/graphql.d.ts.map +1 -1
  3. package/lib/cli/bootstrap/graphql.js +37 -22
  4. package/lib/cli/bootstrap/graphql.js.map +1 -1
  5. package/lib/cli/commands/doctor.d.ts +14 -0
  6. package/lib/cli/commands/doctor.d.ts.map +1 -0
  7. package/lib/cli/commands/doctor.js +496 -0
  8. package/lib/cli/commands/doctor.js.map +1 -0
  9. package/lib/cli/commands/wpe.d.ts.map +1 -1
  10. package/lib/cli/commands/wpe.js +1408 -0
  11. package/lib/cli/commands/wpe.js.map +1 -1
  12. package/lib/cli/index.js +4 -1
  13. package/lib/cli/index.js.map +1 -1
  14. package/lib/cli/utils/graphql.d.ts.map +1 -1
  15. package/lib/cli/utils/graphql.js +58 -36
  16. package/lib/cli/utils/graphql.js.map +1 -1
  17. package/lib/common/constants.d.ts +12 -0
  18. package/lib/common/constants.d.ts.map +1 -1
  19. package/lib/common/constants.js +27 -0
  20. package/lib/common/constants.js.map +1 -1
  21. package/lib/common/schemas.d.ts +14 -11
  22. package/lib/common/schemas.d.ts.map +1 -1
  23. package/lib/common/schemas.js +2 -1
  24. package/lib/common/schemas.js.map +1 -1
  25. package/lib/common/types.d.ts +2 -0
  26. package/lib/common/types.d.ts.map +1 -1
  27. package/lib/main/ai-gateway/AIGatewayRoutes.d.ts +2 -1
  28. package/lib/main/ai-gateway/AIGatewayRoutes.d.ts.map +1 -1
  29. package/lib/main/ai-gateway/AIGatewayRoutes.js +134 -63
  30. package/lib/main/ai-gateway/AIGatewayRoutes.js.map +1 -1
  31. package/lib/main/ai-gateway/mu-plugin-template.d.ts +2 -0
  32. package/lib/main/ai-gateway/mu-plugin-template.d.ts.map +1 -1
  33. package/lib/main/ai-gateway/mu-plugin-template.js +31 -33
  34. package/lib/main/ai-gateway/mu-plugin-template.js.map +1 -1
  35. package/lib/main/ai-gateway/openai-client.d.ts +32 -0
  36. package/lib/main/ai-gateway/openai-client.d.ts.map +1 -0
  37. package/lib/main/ai-gateway/openai-client.js +135 -0
  38. package/lib/main/ai-gateway/openai-client.js.map +1 -0
  39. package/lib/main/ai-proxy/AiProxyServer.d.ts.map +1 -1
  40. package/lib/main/ai-proxy/AiProxyServer.js +13 -1
  41. package/lib/main/ai-proxy/AiProxyServer.js.map +1 -1
  42. package/lib/main/ai-proxy/types.d.ts +11 -1
  43. package/lib/main/ai-proxy/types.d.ts.map +1 -1
  44. package/lib/main/content/RemoteContentExtractor.d.ts +10 -15
  45. package/lib/main/content/RemoteContentExtractor.d.ts.map +1 -1
  46. package/lib/main/content/RemoteContentExtractor.js +65 -136
  47. package/lib/main/content/RemoteContentExtractor.js.map +1 -1
  48. package/lib/main/content/lifecycle-hooks.d.ts.map +1 -1
  49. package/lib/main/content/lifecycle-hooks.js +54 -9
  50. package/lib/main/content/lifecycle-hooks.js.map +1 -1
  51. package/lib/main/credentials/CredentialSyncBroadcaster.d.ts.map +1 -1
  52. package/lib/main/credentials/CredentialSyncBroadcaster.js +5 -2
  53. package/lib/main/credentials/CredentialSyncBroadcaster.js.map +1 -1
  54. package/lib/main/events/GraphService.d.ts +10 -0
  55. package/lib/main/events/GraphService.d.ts.map +1 -1
  56. package/lib/main/events/GraphService.js +62 -5
  57. package/lib/main/events/GraphService.js.map +1 -1
  58. package/lib/main/events/HttpEventInterface.d.ts.map +1 -1
  59. package/lib/main/events/HttpEventInterface.js +8 -7
  60. package/lib/main/events/HttpEventInterface.js.map +1 -1
  61. package/lib/main/events/WPESyncService.d.ts +44 -9
  62. package/lib/main/events/WPESyncService.d.ts.map +1 -1
  63. package/lib/main/events/WPESyncService.js +280 -87
  64. package/lib/main/events/WPESyncService.js.map +1 -1
  65. package/lib/main/events/types.d.ts +2 -0
  66. package/lib/main/events/types.d.ts.map +1 -1
  67. package/lib/main/graphql/resolvers.d.ts +435 -1
  68. package/lib/main/graphql/resolvers.d.ts.map +1 -1
  69. package/lib/main/graphql/resolvers.js +576 -34
  70. package/lib/main/graphql/resolvers.js.map +1 -1
  71. package/lib/main/graphql/schema.d.ts.map +1 -1
  72. package/lib/main/graphql/schema.js +185 -0
  73. package/lib/main/graphql/schema.js.map +1 -1
  74. package/lib/main/index.d.ts.map +1 -1
  75. package/lib/main/index.js +86 -2
  76. package/lib/main/index.js.map +1 -1
  77. package/lib/main/ipc-handlers.d.ts.map +1 -1
  78. package/lib/main/ipc-handlers.js +358 -29
  79. package/lib/main/ipc-handlers.js.map +1 -1
  80. package/lib/main/mcp/McpServer.js +1 -1
  81. package/lib/main/mcp/instructions/resources/workflows/wpe-sync.md +45 -11
  82. package/lib/main/mcp/instructions/server-instructions.d.ts.map +1 -1
  83. package/lib/main/mcp/instructions/server-instructions.js +160 -5
  84. package/lib/main/mcp/instructions/server-instructions.js.map +1 -1
  85. package/lib/main/mcp/local-services-bridge.d.ts +15 -2
  86. package/lib/main/mcp/local-services-bridge.d.ts.map +1 -1
  87. package/lib/main/mcp/local-services-bridge.js +135 -26
  88. package/lib/main/mcp/local-services-bridge.js.map +1 -1
  89. package/lib/main/mcp/modules/content/search-content.d.ts.map +1 -1
  90. package/lib/main/mcp/modules/content/search-content.js +26 -11
  91. package/lib/main/mcp/modules/content/search-content.js.map +1 -1
  92. package/lib/main/mcp/modules/fleet/find-outdated-sites.d.ts +11 -0
  93. package/lib/main/mcp/modules/fleet/find-outdated-sites.d.ts.map +1 -1
  94. package/lib/main/mcp/modules/fleet/find-outdated-sites.js +134 -54
  95. package/lib/main/mcp/modules/fleet/find-outdated-sites.js.map +1 -1
  96. package/lib/main/mcp/modules/site-management/export-site.d.ts.map +1 -1
  97. package/lib/main/mcp/modules/site-management/export-site.js +59 -5
  98. package/lib/main/mcp/modules/site-management/export-site.js.map +1 -1
  99. package/lib/main/mcp/modules/site-management/index.d.ts.map +1 -1
  100. package/lib/main/mcp/modules/site-management/index.js +2 -0
  101. package/lib/main/mcp/modules/site-management/index.js.map +1 -1
  102. package/lib/main/mcp/modules/site-management/operation-status.d.ts +12 -0
  103. package/lib/main/mcp/modules/site-management/operation-status.d.ts.map +1 -0
  104. package/lib/main/mcp/modules/site-management/operation-status.js +91 -0
  105. package/lib/main/mcp/modules/site-management/operation-status.js.map +1 -0
  106. package/lib/main/mcp/modules/wp-cli/core-update.d.ts +3 -0
  107. package/lib/main/mcp/modules/wp-cli/core-update.d.ts.map +1 -0
  108. package/lib/main/mcp/modules/wp-cli/core-update.js +54 -0
  109. package/lib/main/mcp/modules/wp-cli/core-update.js.map +1 -0
  110. package/lib/main/mcp/modules/wp-cli/index.d.ts.map +1 -1
  111. package/lib/main/mcp/modules/wp-cli/index.js +2 -0
  112. package/lib/main/mcp/modules/wp-cli/index.js.map +1 -1
  113. package/lib/main/mcp/modules/wp-cli/plugin-update.d.ts.map +1 -1
  114. package/lib/main/mcp/modules/wp-cli/plugin-update.js +2 -1
  115. package/lib/main/mcp/modules/wp-cli/plugin-update.js.map +1 -1
  116. package/lib/main/mcp/modules/wp-connector/auto-sync.d.ts.map +1 -1
  117. package/lib/main/mcp/modules/wp-connector/auto-sync.js +5 -1
  118. package/lib/main/mcp/modules/wp-connector/auto-sync.js.map +1 -1
  119. package/lib/main/mcp/modules/wp-connector/setup-ai.d.ts.map +1 -1
  120. package/lib/main/mcp/modules/wp-connector/setup-ai.js +3 -2
  121. package/lib/main/mcp/modules/wp-connector/setup-ai.js.map +1 -1
  122. package/lib/main/mcp/modules/wpe/account-domains.d.ts +3 -0
  123. package/lib/main/mcp/modules/wpe/account-domains.d.ts.map +1 -0
  124. package/lib/main/mcp/modules/wpe/account-domains.js +78 -0
  125. package/lib/main/mcp/modules/wpe/account-domains.js.map +1 -0
  126. package/lib/main/mcp/modules/wpe/account-overview.d.ts +3 -0
  127. package/lib/main/mcp/modules/wpe/account-overview.d.ts.map +1 -0
  128. package/lib/main/mcp/modules/wpe/account-overview.js +91 -0
  129. package/lib/main/mcp/modules/wpe/account-overview.js.map +1 -0
  130. package/lib/main/mcp/modules/wpe/account-ssl-status.d.ts +3 -0
  131. package/lib/main/mcp/modules/wpe/account-ssl-status.d.ts.map +1 -0
  132. package/lib/main/mcp/modules/wpe/account-ssl-status.js +118 -0
  133. package/lib/main/mcp/modules/wpe/account-ssl-status.js.map +1 -0
  134. package/lib/main/mcp/modules/wpe/add-user-to-accounts.d.ts +3 -0
  135. package/lib/main/mcp/modules/wpe/add-user-to-accounts.d.ts.map +1 -0
  136. package/lib/main/mcp/modules/wpe/add-user-to-accounts.js +97 -0
  137. package/lib/main/mcp/modules/wpe/add-user-to-accounts.js.map +1 -0
  138. package/lib/main/mcp/modules/wpe/api-credentials.d.ts +11 -0
  139. package/lib/main/mcp/modules/wpe/api-credentials.d.ts.map +1 -0
  140. package/lib/main/mcp/modules/wpe/api-credentials.js +117 -0
  141. package/lib/main/mcp/modules/wpe/api-credentials.js.map +1 -0
  142. package/lib/main/mcp/modules/wpe/authenticate.d.ts +2 -2
  143. package/lib/main/mcp/modules/wpe/authenticate.d.ts.map +1 -1
  144. package/lib/main/mcp/modules/wpe/authenticate.js +33 -12
  145. package/lib/main/mcp/modules/wpe/authenticate.js.map +1 -1
  146. package/lib/main/mcp/modules/wpe/backup-and-verify.d.ts +3 -0
  147. package/lib/main/mcp/modules/wpe/backup-and-verify.d.ts.map +1 -0
  148. package/lib/main/mcp/modules/wpe/backup-and-verify.js +98 -0
  149. package/lib/main/mcp/modules/wpe/backup-and-verify.js.map +1 -0
  150. package/lib/main/mcp/modules/wpe/check-domain-status.d.ts +3 -0
  151. package/lib/main/mcp/modules/wpe/check-domain-status.d.ts.map +1 -0
  152. package/lib/main/mcp/modules/wpe/check-domain-status.js +44 -0
  153. package/lib/main/mcp/modules/wpe/check-domain-status.js.map +1 -0
  154. package/lib/main/mcp/modules/wpe/create-account-user.d.ts +3 -0
  155. package/lib/main/mcp/modules/wpe/create-account-user.d.ts.map +1 -0
  156. package/lib/main/mcp/modules/wpe/create-account-user.js +54 -0
  157. package/lib/main/mcp/modules/wpe/create-account-user.js.map +1 -0
  158. package/lib/main/mcp/modules/wpe/create-backup.d.ts.map +1 -1
  159. package/lib/main/mcp/modules/wpe/create-backup.js +12 -7
  160. package/lib/main/mcp/modules/wpe/create-backup.js.map +1 -1
  161. package/lib/main/mcp/modules/wpe/create-domain.d.ts +3 -0
  162. package/lib/main/mcp/modules/wpe/create-domain.d.ts.map +1 -0
  163. package/lib/main/mcp/modules/wpe/create-domain.js +32 -0
  164. package/lib/main/mcp/modules/wpe/create-domain.js.map +1 -0
  165. package/lib/main/mcp/modules/wpe/create-domains-bulk.d.ts +3 -0
  166. package/lib/main/mcp/modules/wpe/create-domains-bulk.d.ts.map +1 -0
  167. package/lib/main/mcp/modules/wpe/create-domains-bulk.js +36 -0
  168. package/lib/main/mcp/modules/wpe/create-domains-bulk.js.map +1 -0
  169. package/lib/main/mcp/modules/wpe/create-install.d.ts +3 -0
  170. package/lib/main/mcp/modules/wpe/create-install.d.ts.map +1 -0
  171. package/lib/main/mcp/modules/wpe/create-install.js +52 -0
  172. package/lib/main/mcp/modules/wpe/create-install.js.map +1 -0
  173. package/lib/main/mcp/modules/wpe/create-site.d.ts +3 -0
  174. package/lib/main/mcp/modules/wpe/create-site.d.ts.map +1 -0
  175. package/lib/main/mcp/modules/wpe/create-site.js +38 -0
  176. package/lib/main/mcp/modules/wpe/create-site.js.map +1 -0
  177. package/lib/main/mcp/modules/wpe/create-ssh-key.d.ts +3 -0
  178. package/lib/main/mcp/modules/wpe/create-ssh-key.d.ts.map +1 -0
  179. package/lib/main/mcp/modules/wpe/create-ssh-key.js +32 -0
  180. package/lib/main/mcp/modules/wpe/create-ssh-key.js.map +1 -0
  181. package/lib/main/mcp/modules/wpe/delete-account-user.d.ts +3 -0
  182. package/lib/main/mcp/modules/wpe/delete-account-user.d.ts.map +1 -0
  183. package/lib/main/mcp/modules/wpe/delete-account-user.js +63 -0
  184. package/lib/main/mcp/modules/wpe/delete-account-user.js.map +1 -0
  185. package/lib/main/mcp/modules/wpe/delete-domain.d.ts +3 -0
  186. package/lib/main/mcp/modules/wpe/delete-domain.d.ts.map +1 -0
  187. package/lib/main/mcp/modules/wpe/delete-domain.js +47 -0
  188. package/lib/main/mcp/modules/wpe/delete-domain.js.map +1 -0
  189. package/lib/main/mcp/modules/wpe/delete-install.d.ts +3 -0
  190. package/lib/main/mcp/modules/wpe/delete-install.d.ts.map +1 -0
  191. package/lib/main/mcp/modules/wpe/delete-install.js +99 -0
  192. package/lib/main/mcp/modules/wpe/delete-install.js.map +1 -0
  193. package/lib/main/mcp/modules/wpe/delete-site.d.ts +3 -0
  194. package/lib/main/mcp/modules/wpe/delete-site.d.ts.map +1 -0
  195. package/lib/main/mcp/modules/wpe/delete-site.js +85 -0
  196. package/lib/main/mcp/modules/wpe/delete-site.js.map +1 -0
  197. package/lib/main/mcp/modules/wpe/delete-ssh-key.d.ts +3 -0
  198. package/lib/main/mcp/modules/wpe/delete-ssh-key.d.ts.map +1 -0
  199. package/lib/main/mcp/modules/wpe/delete-ssh-key.js +45 -0
  200. package/lib/main/mcp/modules/wpe/delete-ssh-key.js.map +1 -0
  201. package/lib/main/mcp/modules/wpe/detect-drift.d.ts +16 -0
  202. package/lib/main/mcp/modules/wpe/detect-drift.d.ts.map +1 -0
  203. package/lib/main/mcp/modules/wpe/detect-drift.js +174 -0
  204. package/lib/main/mcp/modules/wpe/detect-drift.js.map +1 -0
  205. package/lib/main/mcp/modules/wpe/diagnose-site.d.ts +3 -0
  206. package/lib/main/mcp/modules/wpe/diagnose-site.d.ts.map +1 -0
  207. package/lib/main/mcp/modules/wpe/diagnose-site.js +167 -0
  208. package/lib/main/mcp/modules/wpe/diagnose-site.js.map +1 -0
  209. package/lib/main/mcp/modules/wpe/environment-diff.d.ts +3 -0
  210. package/lib/main/mcp/modules/wpe/environment-diff.d.ts.map +1 -0
  211. package/lib/main/mcp/modules/wpe/environment-diff.js +140 -0
  212. package/lib/main/mcp/modules/wpe/environment-diff.js.map +1 -0
  213. package/lib/main/mcp/modules/wpe/fleet-health.d.ts +3 -0
  214. package/lib/main/mcp/modules/wpe/fleet-health.d.ts.map +1 -0
  215. package/lib/main/mcp/modules/wpe/fleet-health.js +113 -0
  216. package/lib/main/mcp/modules/wpe/fleet-health.js.map +1 -0
  217. package/lib/main/mcp/modules/wpe/fleet-versions.d.ts +12 -0
  218. package/lib/main/mcp/modules/wpe/fleet-versions.d.ts.map +1 -0
  219. package/lib/main/mcp/modules/wpe/fleet-versions.js +102 -0
  220. package/lib/main/mcp/modules/wpe/fleet-versions.js.map +1 -0
  221. package/lib/main/mcp/modules/wpe/get-account-limits.d.ts +3 -0
  222. package/lib/main/mcp/modules/wpe/get-account-limits.d.ts.map +1 -0
  223. package/lib/main/mcp/modules/wpe/get-account-limits.js +52 -0
  224. package/lib/main/mcp/modules/wpe/get-account-limits.js.map +1 -0
  225. package/lib/main/mcp/modules/wpe/get-account-usage-insights.d.ts +3 -0
  226. package/lib/main/mcp/modules/wpe/get-account-usage-insights.d.ts.map +1 -0
  227. package/lib/main/mcp/modules/wpe/get-account-usage-insights.js +66 -0
  228. package/lib/main/mcp/modules/wpe/get-account-usage-insights.js.map +1 -0
  229. package/lib/main/mcp/modules/wpe/get-account-usage-summary.d.ts +3 -0
  230. package/lib/main/mcp/modules/wpe/get-account-usage-summary.d.ts.map +1 -0
  231. package/lib/main/mcp/modules/wpe/get-account-usage-summary.js +69 -0
  232. package/lib/main/mcp/modules/wpe/get-account-usage-summary.js.map +1 -0
  233. package/lib/main/mcp/modules/wpe/get-account-user.d.ts +3 -0
  234. package/lib/main/mcp/modules/wpe/get-account-user.d.ts.map +1 -0
  235. package/lib/main/mcp/modules/wpe/get-account-user.js +53 -0
  236. package/lib/main/mcp/modules/wpe/get-account-user.js.map +1 -0
  237. package/lib/main/mcp/modules/wpe/get-account-users.d.ts +3 -0
  238. package/lib/main/mcp/modules/wpe/get-account-users.d.ts.map +1 -0
  239. package/lib/main/mcp/modules/wpe/get-account-users.js +57 -0
  240. package/lib/main/mcp/modules/wpe/get-account-users.js.map +1 -0
  241. package/lib/main/mcp/modules/wpe/get-account.d.ts +3 -0
  242. package/lib/main/mcp/modules/wpe/get-account.d.ts.map +1 -0
  243. package/lib/main/mcp/modules/wpe/get-account.js +38 -0
  244. package/lib/main/mcp/modules/wpe/get-account.js.map +1 -0
  245. package/lib/main/mcp/modules/wpe/get-accounts.d.ts.map +1 -1
  246. package/lib/main/mcp/modules/wpe/get-accounts.js +12 -7
  247. package/lib/main/mcp/modules/wpe/get-accounts.js.map +1 -1
  248. package/lib/main/mcp/modules/wpe/get-backup.d.ts +3 -0
  249. package/lib/main/mcp/modules/wpe/get-backup.d.ts.map +1 -0
  250. package/lib/main/mcp/modules/wpe/get-backup.js +50 -0
  251. package/lib/main/mcp/modules/wpe/get-backup.js.map +1 -0
  252. package/lib/main/mcp/modules/wpe/get-current-user.d.ts +3 -0
  253. package/lib/main/mcp/modules/wpe/get-current-user.d.ts.map +1 -0
  254. package/lib/main/mcp/modules/wpe/get-current-user.js +46 -0
  255. package/lib/main/mcp/modules/wpe/get-current-user.js.map +1 -0
  256. package/lib/main/mcp/modules/wpe/get-domain-ssl-certificate.d.ts +3 -0
  257. package/lib/main/mcp/modules/wpe/get-domain-ssl-certificate.d.ts.map +1 -0
  258. package/lib/main/mcp/modules/wpe/get-domain-ssl-certificate.js +41 -0
  259. package/lib/main/mcp/modules/wpe/get-domain-ssl-certificate.js.map +1 -0
  260. package/lib/main/mcp/modules/wpe/get-domain-status-report.d.ts +3 -0
  261. package/lib/main/mcp/modules/wpe/get-domain-status-report.d.ts.map +1 -0
  262. package/lib/main/mcp/modules/wpe/get-domain-status-report.js +48 -0
  263. package/lib/main/mcp/modules/wpe/get-domain-status-report.js.map +1 -0
  264. package/lib/main/mcp/modules/wpe/get-domain.d.ts +3 -0
  265. package/lib/main/mcp/modules/wpe/get-domain.d.ts.map +1 -0
  266. package/lib/main/mcp/modules/wpe/get-domain.js +39 -0
  267. package/lib/main/mcp/modules/wpe/get-domain.js.map +1 -0
  268. package/lib/main/mcp/modules/wpe/get-domains.d.ts +3 -0
  269. package/lib/main/mcp/modules/wpe/get-domains.d.ts.map +1 -0
  270. package/lib/main/mcp/modules/wpe/get-domains.js +44 -0
  271. package/lib/main/mcp/modules/wpe/get-domains.js.map +1 -0
  272. package/lib/main/mcp/modules/wpe/get-install.d.ts.map +1 -1
  273. package/lib/main/mcp/modules/wpe/get-install.js +12 -7
  274. package/lib/main/mcp/modules/wpe/get-install.js.map +1 -1
  275. package/lib/main/mcp/modules/wpe/get-installs.d.ts.map +1 -1
  276. package/lib/main/mcp/modules/wpe/get-installs.js +13 -7
  277. package/lib/main/mcp/modules/wpe/get-installs.js.map +1 -1
  278. package/lib/main/mcp/modules/wpe/get-largefs-validation.d.ts +3 -0
  279. package/lib/main/mcp/modules/wpe/get-largefs-validation.d.ts.map +1 -0
  280. package/lib/main/mcp/modules/wpe/get-largefs-validation.js +64 -0
  281. package/lib/main/mcp/modules/wpe/get-largefs-validation.js.map +1 -0
  282. package/lib/main/mcp/modules/wpe/get-offload-settings.d.ts +3 -0
  283. package/lib/main/mcp/modules/wpe/get-offload-settings.d.ts.map +1 -0
  284. package/lib/main/mcp/modules/wpe/get-offload-settings.js +43 -0
  285. package/lib/main/mcp/modules/wpe/get-offload-settings.js.map +1 -0
  286. package/lib/main/mcp/modules/wpe/get-site-changes.js +1 -1
  287. package/lib/main/mcp/modules/wpe/get-site-changes.js.map +1 -1
  288. package/lib/main/mcp/modules/wpe/get-site.d.ts +3 -0
  289. package/lib/main/mcp/modules/wpe/get-site.d.ts.map +1 -0
  290. package/lib/main/mcp/modules/wpe/get-site.js +45 -0
  291. package/lib/main/mcp/modules/wpe/get-site.js.map +1 -0
  292. package/lib/main/mcp/modules/wpe/get-sites.d.ts +3 -0
  293. package/lib/main/mcp/modules/wpe/get-sites.d.ts.map +1 -0
  294. package/lib/main/mcp/modules/wpe/get-sites.js +34 -0
  295. package/lib/main/mcp/modules/wpe/get-sites.js.map +1 -0
  296. package/lib/main/mcp/modules/wpe/get-ssh-keys.d.ts +3 -0
  297. package/lib/main/mcp/modules/wpe/get-ssh-keys.d.ts.map +1 -0
  298. package/lib/main/mcp/modules/wpe/get-ssh-keys.js +41 -0
  299. package/lib/main/mcp/modules/wpe/get-ssh-keys.js.map +1 -0
  300. package/lib/main/mcp/modules/wpe/get-ssl-certificates.d.ts +3 -0
  301. package/lib/main/mcp/modules/wpe/get-ssl-certificates.d.ts.map +1 -0
  302. package/lib/main/mcp/modules/wpe/get-ssl-certificates.js +62 -0
  303. package/lib/main/mcp/modules/wpe/get-ssl-certificates.js.map +1 -0
  304. package/lib/main/mcp/modules/wpe/go-live-checklist.d.ts +3 -0
  305. package/lib/main/mcp/modules/wpe/go-live-checklist.d.ts.map +1 -0
  306. package/lib/main/mcp/modules/wpe/go-live-checklist.js +147 -0
  307. package/lib/main/mcp/modules/wpe/go-live-checklist.js.map +1 -0
  308. package/lib/main/mcp/modules/wpe/helpers.d.ts +11 -0
  309. package/lib/main/mcp/modules/wpe/helpers.d.ts.map +1 -1
  310. package/lib/main/mcp/modules/wpe/helpers.js +47 -0
  311. package/lib/main/mcp/modules/wpe/helpers.js.map +1 -1
  312. package/lib/main/mcp/modules/wpe/import-ssl-certificate.d.ts +3 -0
  313. package/lib/main/mcp/modules/wpe/import-ssl-certificate.d.ts.map +1 -0
  314. package/lib/main/mcp/modules/wpe/import-ssl-certificate.js +40 -0
  315. package/lib/main/mcp/modules/wpe/import-ssl-certificate.js.map +1 -0
  316. package/lib/main/mcp/modules/wpe/index.d.ts.map +1 -1
  317. package/lib/main/mcp/modules/wpe/index.js +121 -0
  318. package/lib/main/mcp/modules/wpe/index.js.map +1 -1
  319. package/lib/main/mcp/modules/wpe/installs-by-account.d.ts +3 -0
  320. package/lib/main/mcp/modules/wpe/installs-by-account.d.ts.map +1 -0
  321. package/lib/main/mcp/modules/wpe/installs-by-account.js +82 -0
  322. package/lib/main/mcp/modules/wpe/installs-by-account.js.map +1 -0
  323. package/lib/main/mcp/modules/wpe/nexus-list-sites.d.ts.map +1 -1
  324. package/lib/main/mcp/modules/wpe/nexus-list-sites.js +94 -25
  325. package/lib/main/mcp/modules/wpe/nexus-list-sites.js.map +1 -1
  326. package/lib/main/mcp/modules/wpe/portfolio-overview.d.ts +3 -0
  327. package/lib/main/mcp/modules/wpe/portfolio-overview.d.ts.map +1 -0
  328. package/lib/main/mcp/modules/wpe/portfolio-overview.js +113 -0
  329. package/lib/main/mcp/modules/wpe/portfolio-overview.js.map +1 -0
  330. package/lib/main/mcp/modules/wpe/portfolio-usage.d.ts +15 -0
  331. package/lib/main/mcp/modules/wpe/portfolio-usage.d.ts.map +1 -0
  332. package/lib/main/mcp/modules/wpe/portfolio-usage.js +114 -0
  333. package/lib/main/mcp/modules/wpe/portfolio-usage.js.map +1 -0
  334. package/lib/main/mcp/modules/wpe/prepare-go-live.d.ts +3 -0
  335. package/lib/main/mcp/modules/wpe/prepare-go-live.d.ts.map +1 -0
  336. package/lib/main/mcp/modules/wpe/prepare-go-live.js +150 -0
  337. package/lib/main/mcp/modules/wpe/prepare-go-live.js.map +1 -0
  338. package/lib/main/mcp/modules/wpe/promote-environment.d.ts +3 -0
  339. package/lib/main/mcp/modules/wpe/promote-environment.d.ts.map +1 -0
  340. package/lib/main/mcp/modules/wpe/promote-environment.js +140 -0
  341. package/lib/main/mcp/modules/wpe/promote-environment.js.map +1 -0
  342. package/lib/main/mcp/modules/wpe/purge-cache.d.ts.map +1 -1
  343. package/lib/main/mcp/modules/wpe/purge-cache.js +10 -5
  344. package/lib/main/mcp/modules/wpe/purge-cache.js.map +1 -1
  345. package/lib/main/mcp/modules/wpe/refresh-account-disk-usage.d.ts +3 -0
  346. package/lib/main/mcp/modules/wpe/refresh-account-disk-usage.d.ts.map +1 -0
  347. package/lib/main/mcp/modules/wpe/refresh-account-disk-usage.js +32 -0
  348. package/lib/main/mcp/modules/wpe/refresh-account-disk-usage.js.map +1 -0
  349. package/lib/main/mcp/modules/wpe/refresh-disk-usage.d.ts +3 -0
  350. package/lib/main/mcp/modules/wpe/refresh-disk-usage.d.ts.map +1 -0
  351. package/lib/main/mcp/modules/wpe/refresh-disk-usage.js +32 -0
  352. package/lib/main/mcp/modules/wpe/refresh-disk-usage.js.map +1 -0
  353. package/lib/main/mcp/modules/wpe/request-ssl-certificate.d.ts +3 -0
  354. package/lib/main/mcp/modules/wpe/request-ssl-certificate.d.ts.map +1 -0
  355. package/lib/main/mcp/modules/wpe/request-ssl-certificate.js +37 -0
  356. package/lib/main/mcp/modules/wpe/request-ssl-certificate.js.map +1 -0
  357. package/lib/main/mcp/modules/wpe/update-account-user.d.ts +3 -0
  358. package/lib/main/mcp/modules/wpe/update-account-user.d.ts.map +1 -0
  359. package/lib/main/mcp/modules/wpe/update-account-user.js +44 -0
  360. package/lib/main/mcp/modules/wpe/update-account-user.js.map +1 -0
  361. package/lib/main/mcp/modules/wpe/update-domain.d.ts +3 -0
  362. package/lib/main/mcp/modules/wpe/update-domain.d.ts.map +1 -0
  363. package/lib/main/mcp/modules/wpe/update-domain.js +39 -0
  364. package/lib/main/mcp/modules/wpe/update-domain.js.map +1 -0
  365. package/lib/main/mcp/modules/wpe/update-install.d.ts +3 -0
  366. package/lib/main/mcp/modules/wpe/update-install.d.ts.map +1 -0
  367. package/lib/main/mcp/modules/wpe/update-install.js +48 -0
  368. package/lib/main/mcp/modules/wpe/update-install.js.map +1 -0
  369. package/lib/main/mcp/modules/wpe/update-offload-settings.d.ts +3 -0
  370. package/lib/main/mcp/modules/wpe/update-offload-settings.d.ts.map +1 -0
  371. package/lib/main/mcp/modules/wpe/update-offload-settings.js +32 -0
  372. package/lib/main/mcp/modules/wpe/update-offload-settings.js.map +1 -0
  373. package/lib/main/mcp/modules/wpe/update-site.d.ts +3 -0
  374. package/lib/main/mcp/modules/wpe/update-site.d.ts.map +1 -0
  375. package/lib/main/mcp/modules/wpe/update-site.js +35 -0
  376. package/lib/main/mcp/modules/wpe/update-site.js.map +1 -0
  377. package/lib/main/mcp/modules/wpe/user-audit.d.ts +3 -0
  378. package/lib/main/mcp/modules/wpe/user-audit.d.ts.map +1 -0
  379. package/lib/main/mcp/modules/wpe/user-audit.js +117 -0
  380. package/lib/main/mcp/modules/wpe/user-audit.js.map +1 -0
  381. package/lib/main/mcp/modules/wpe/wpe-pull.d.ts.map +1 -1
  382. package/lib/main/mcp/modules/wpe/wpe-pull.js +61 -11
  383. package/lib/main/mcp/modules/wpe/wpe-pull.js.map +1 -1
  384. package/lib/main/mcp/modules/wpe/wpe-push.d.ts.map +1 -1
  385. package/lib/main/mcp/modules/wpe/wpe-push.js +23 -11
  386. package/lib/main/mcp/modules/wpe/wpe-push.js.map +1 -1
  387. package/lib/main/mcp/safety.d.ts.map +1 -1
  388. package/lib/main/mcp/safety.js +105 -1
  389. package/lib/main/mcp/safety.js.map +1 -1
  390. package/lib/main/mcp/types.d.ts +2 -0
  391. package/lib/main/mcp/types.d.ts.map +1 -1
  392. package/lib/main/operation-tracker.d.ts +46 -0
  393. package/lib/main/operation-tracker.d.ts.map +1 -0
  394. package/lib/main/operation-tracker.js +149 -0
  395. package/lib/main/operation-tracker.js.map +1 -0
  396. package/lib/main/vector-store/VectorStore.d.ts +26 -0
  397. package/lib/main/vector-store/VectorStore.d.ts.map +1 -1
  398. package/lib/main/vector-store/VectorStore.js +142 -0
  399. package/lib/main/vector-store/VectorStore.js.map +1 -1
  400. package/lib/renderer/components/AIGatewayByCallerPanel.d.ts.map +1 -1
  401. package/lib/renderer/components/AIGatewayByCallerPanel.js +24 -7
  402. package/lib/renderer/components/AIGatewayByCallerPanel.js.map +1 -1
  403. package/lib/renderer/components/AIGatewayPanel.d.ts +96 -0
  404. package/lib/renderer/components/AIGatewayPanel.d.ts.map +1 -0
  405. package/lib/renderer/components/AIGatewayPanel.js +389 -0
  406. package/lib/renderer/components/AIGatewayPanel.js.map +1 -0
  407. package/lib/renderer/components/AIGatewayUsagePanel.d.ts.map +1 -1
  408. package/lib/renderer/components/AIGatewayUsagePanel.js +30 -10
  409. package/lib/renderer/components/AIGatewayUsagePanel.js.map +1 -1
  410. package/lib/renderer/components/EventTimeline.d.ts.map +1 -1
  411. package/lib/renderer/components/EventTimeline.js +22 -37
  412. package/lib/renderer/components/EventTimeline.js.map +1 -1
  413. package/lib/renderer/components/NexusOverview.d.ts +40 -2
  414. package/lib/renderer/components/NexusOverview.d.ts.map +1 -1
  415. package/lib/renderer/components/NexusOverview.js +350 -81
  416. package/lib/renderer/components/NexusOverview.js.map +1 -1
  417. package/lib/renderer/components/NexusPreferences.d.ts +13 -0
  418. package/lib/renderer/components/NexusPreferences.d.ts.map +1 -1
  419. package/lib/renderer/components/NexusPreferences.js +183 -2
  420. package/lib/renderer/components/NexusPreferences.js.map +1 -1
  421. package/lib/renderer/components/NexusSiteTab.d.ts +1 -0
  422. package/lib/renderer/components/NexusSiteTab.d.ts.map +1 -1
  423. package/lib/renderer/components/NexusSiteTab.js +7 -0
  424. package/lib/renderer/components/NexusSiteTab.js.map +1 -1
  425. package/lib/renderer/components/SiteNexusSection.d.ts +1 -0
  426. package/lib/renderer/components/SiteNexusSection.d.ts.map +1 -1
  427. package/lib/renderer/components/SiteNexusSection.js +7 -0
  428. package/lib/renderer/components/SiteNexusSection.js.map +1 -1
  429. package/lib/renderer/index.d.ts.map +1 -1
  430. package/lib/renderer/index.js +5 -1
  431. package/lib/renderer/index.js.map +1 -1
  432. package/lib/wp-plugins/ai/includes/Abilities/Excerpt_Generation/Excerpt_Generation.php +6 -0
  433. package/lib/wp-plugins/ai/includes/Abilities/Summarization/Summarization.php +6 -0
  434. package/lib/wp-plugins/ai/includes/Abilities/Title_Generation/Title_Generation.php +10 -0
  435. package/lib/wp-plugins/ai-provider-for-local-gateway/plugin.php +35 -34
  436. package/lib/wp-plugins/ai-provider-for-local-gateway/src/Availability/LocalGatewayProviderAvailability.php +24 -28
  437. package/lib/wp-plugins/ai-provider-for-local-gateway/src/Metadata/LocalGatewayModelMetadataDirectory.php +26 -29
  438. package/lib/wp-plugins/ai-provider-for-local-gateway/src/Models/LocalGatewayTextGenerationModel.php +21 -20
  439. package/lib/wp-plugins/ai-provider-for-local-gateway/src/Provider/LocalGatewayProvider.php +16 -25
  440. package/lib/wp-plugins/nexus-ai-connector/includes/class-admin-settings.php +12 -6
  441. package/package.json +1 -1
  442. package/wp-plugins/ai/includes/Abilities/Excerpt_Generation/Excerpt_Generation.php +6 -0
  443. package/wp-plugins/ai/includes/Abilities/Summarization/Summarization.php +6 -0
  444. package/wp-plugins/ai/includes/Abilities/Title_Generation/Title_Generation.php +10 -0
  445. package/wp-plugins/ai-provider-for-local-gateway/plugin.php +35 -34
  446. package/wp-plugins/ai-provider-for-local-gateway/src/Availability/LocalGatewayProviderAvailability.php +24 -28
  447. package/wp-plugins/ai-provider-for-local-gateway/src/Metadata/LocalGatewayModelMetadataDirectory.php +26 -29
  448. package/wp-plugins/ai-provider-for-local-gateway/src/Models/LocalGatewayTextGenerationModel.php +21 -20
  449. package/wp-plugins/ai-provider-for-local-gateway/src/Provider/LocalGatewayProvider.php +16 -25
  450. package/wp-plugins/nexus-ai-connector/includes/class-admin-settings.php +12 -6
  451. package/models/all-MiniLM-L6-v2-quantized/model.onnx +0 -0
  452. package/models/all-MiniLM-L6-v2-quantized/tokenizer_config.json +0 -1
  453. package/models/all-MiniLM-L6-v2-quantized/vocab.txt +0 -30522
package/README.md CHANGED
@@ -237,11 +237,13 @@ Install the CLI, which automatically downloads and installs the addon for your p
237
237
  # Install CLI globally
238
238
  npm install -g @local-labs-jpollock/local-addon-nexus-ai
239
239
 
240
- # Run any command to trigger auto-install
241
- nexus sites list
240
+ # Verify everything is working
241
+ nexus doctor
242
242
  ```
243
243
 
244
- **What happens:**
244
+ `nexus doctor` checks Local, the addon, MCP server, AI provider, and site configuration — and prints the exact next step for anything that needs attention.
245
+
246
+ **What the first run does:**
245
247
  1. CLI detects the addon is missing
246
248
  2. Prompts: "Download and install addon for macOS (Apple Silicon)? (Y/n)"
247
249
  3. Downloads the correct platform-specific addon from GitHub Releases
@@ -249,6 +251,14 @@ nexus sites list
249
251
  5. Activates the addon automatically
250
252
  6. Prompts you to restart Local
251
253
 
254
+ **After restarting Local, connect your AI agent:**
255
+
256
+ ```bash
257
+ nexus mcp setup # configure Claude Code, Cursor, Claude Desktop, etc.
258
+ ```
259
+
260
+ This is the fastest path to value — no API key required.
261
+
252
262
  **Supported platforms:**
253
263
  - macOS (Apple Silicon) - `darwin-arm64`
254
264
  - macOS (Intel) - `darwin-x64`
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/cli/bootstrap/graphql.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,GAAG,IAAI,CAoB1D;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,SAAS,GAAE,MAAc,EACzB,cAAc,GAAE,MAAY,GAC3B,OAAO,CAAC,OAAO,CAAC,CAoClB"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/cli/bootstrap/graphql.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,GAAG,IAAI,CAwB1D;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,SAAS,GAAE,MAAc,EACzB,cAAc,GAAE,MAAY,GAC3B,OAAO,CAAC,OAAO,CAAC,CAiDlB"}
@@ -51,10 +51,13 @@ function readConnectionInfo() {
51
51
  }
52
52
  const content = fs.readFileSync(paths.graphqlConnectionInfoFile, 'utf-8');
53
53
  const info = JSON.parse(content);
54
+ // Local's connection file sometimes has stale ports - default to port 4000
55
+ const defaultUrl = 'http://127.0.0.1:4000/graphql';
56
+ const defaultPort = 4000;
54
57
  return {
55
- url: info.url || `http://127.0.0.1:${info.port}/graphql`,
56
- subscriptionUrl: info.subscriptionUrl || `ws://127.0.0.1:${info.port}/graphql`,
57
- port: info.port,
58
+ url: info.url || defaultUrl,
59
+ subscriptionUrl: info.subscriptionUrl || `ws://127.0.0.1:${info.port || defaultPort}/graphql`,
60
+ port: info.port || defaultPort,
58
61
  authToken: info.authToken || '',
59
62
  };
60
63
  }
@@ -70,26 +73,38 @@ async function waitForGraphQL(timeoutMs = 30000, pollIntervalMs = 500) {
70
73
  while (Date.now() - start < timeoutMs) {
71
74
  const connectionInfo = readConnectionInfo();
72
75
  if (connectionInfo) {
73
- try {
74
- // Use AbortController for per-request timeout (2 seconds)
75
- const controller = new AbortController();
76
- const requestTimeout = setTimeout(() => controller.abort(), 2000);
77
- const response = await fetch(connectionInfo.url, {
78
- method: 'POST',
79
- headers: {
80
- 'Content-Type': 'application/json',
81
- Authorization: `Bearer ${connectionInfo.authToken}`,
82
- },
83
- body: JSON.stringify({ query: '{ __typename }' }),
84
- signal: controller.signal,
85
- });
86
- clearTimeout(requestTimeout);
87
- if (response.ok) {
88
- return true;
76
+ // Try both the URL from the connection file AND port 4000 as fallback
77
+ // (Local's connection file sometimes has stale ports)
78
+ const urlsToTry = [
79
+ connectionInfo.url,
80
+ 'http://127.0.0.1:4000/graphql',
81
+ ];
82
+ for (const url of urlsToTry) {
83
+ try {
84
+ // Use AbortController for per-request timeout (2 seconds)
85
+ const controller = new AbortController();
86
+ const requestTimeout = setTimeout(() => controller.abort(), 2000);
87
+ const response = await fetch(url, {
88
+ method: 'POST',
89
+ headers: {
90
+ 'Content-Type': 'application/json',
91
+ Authorization: `Bearer ${connectionInfo.authToken}`,
92
+ },
93
+ body: JSON.stringify({ query: '{ __typename }' }),
94
+ signal: controller.signal,
95
+ });
96
+ clearTimeout(requestTimeout);
97
+ if (response.ok) {
98
+ // Update connection info to use the working URL
99
+ if (url !== connectionInfo.url) {
100
+ connectionInfo.url = url;
101
+ }
102
+ return true;
103
+ }
104
+ }
105
+ catch {
106
+ // Server not ready yet - connection refused, timeout, etc.
89
107
  }
90
- }
91
- catch {
92
- // Server not ready yet - connection refused, timeout, etc.
93
108
  }
94
109
  }
95
110
  await delay(pollIntervalMs);
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/cli/bootstrap/graphql.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeH,gDAoBC;AAKD,wCAuCC;AA7ED,uCAAyB;AACzB,mCAAwC;AASxC;;GAEG;AACH,SAAgB,kBAAkB;IAChC,MAAM,KAAK,GAAG,IAAA,qBAAa,GAAE,CAAC;IAE9B,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEjC,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,oBAAoB,IAAI,CAAC,IAAI,UAAU;YACxD,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,kBAAkB,IAAI,CAAC,IAAI,UAAU;YAC9E,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc,CAClC,YAAoB,KAAK,EACzB,iBAAyB,GAAG;IAE5B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEzB,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,SAAS,EAAE,CAAC;QACtC,MAAM,cAAc,GAAG,kBAAkB,EAAE,CAAC;QAE5C,IAAI,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC;gBACH,0DAA0D;gBAC1D,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;gBACzC,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;gBAElE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE;oBAC/C,MAAM,EAAE,MAAM;oBACd,OAAO,EAAE;wBACP,cAAc,EAAE,kBAAkB;wBAClC,aAAa,EAAE,UAAU,cAAc,CAAC,SAAS,EAAE;qBACpD;oBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;oBACjD,MAAM,EAAE,UAAU,CAAC,MAAM;iBAC1B,CAAC,CAAC;gBAEH,YAAY,CAAC,cAAc,CAAC,CAAC;gBAE7B,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;oBAChB,OAAO,IAAI,CAAC;gBACd,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,2DAA2D;YAC7D,CAAC;QACH,CAAC;QAED,MAAM,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
1
+ {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/cli/bootstrap/graphql.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeH,gDAwBC;AAKD,wCAoDC;AA9FD,uCAAyB;AACzB,mCAAwC;AASxC;;GAEG;AACH,SAAgB,kBAAkB;IAChC,MAAM,KAAK,GAAG,IAAA,qBAAa,GAAE,CAAC;IAE9B,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC;YACpD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEjC,2EAA2E;QAC3E,MAAM,UAAU,GAAG,+BAA+B,CAAC;QACnD,MAAM,WAAW,GAAG,IAAI,CAAC;QAEzB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,UAAU;YAC3B,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,kBAAkB,IAAI,CAAC,IAAI,IAAI,WAAW,UAAU;YAC7F,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,WAAW;YAC9B,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,cAAc,CAClC,YAAoB,KAAK,EACzB,iBAAyB,GAAG;IAE5B,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAEzB,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,SAAS,EAAE,CAAC;QACtC,MAAM,cAAc,GAAG,kBAAkB,EAAE,CAAC;QAE5C,IAAI,cAAc,EAAE,CAAC;YACnB,sEAAsE;YACtE,sDAAsD;YACtD,MAAM,SAAS,GAAG;gBAChB,cAAc,CAAC,GAAG;gBAClB,+BAA+B;aAChC,CAAC;YAEF,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;gBAC5B,IAAI,CAAC;oBACH,0DAA0D;oBAC1D,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;oBACzC,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,CAAC;oBAElE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;wBAChC,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE;4BACP,cAAc,EAAE,kBAAkB;4BAClC,aAAa,EAAE,UAAU,cAAc,CAAC,SAAS,EAAE;yBACpD;wBACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC;wBACjD,MAAM,EAAE,UAAU,CAAC,MAAM;qBAC1B,CAAC,CAAC;oBAEH,YAAY,CAAC,cAAc,CAAC,CAAC;oBAE7B,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;wBAChB,gDAAgD;wBAChD,IAAI,GAAG,KAAK,cAAc,CAAC,GAAG,EAAE,CAAC;4BAC/B,cAAc,CAAC,GAAG,GAAG,GAAG,CAAC;wBAC3B,CAAC;wBACD,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,2DAA2D;gBAC7D,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * nexus doctor
3
+ *
4
+ * System health check and first-run orientation.
5
+ * Runs independently of bootstrap — each check is isolated and never crashes
6
+ * the overall command. Shows actionable next steps for anything that is missing.
7
+ *
8
+ * Usage:
9
+ * nexus doctor # human-readable report
10
+ * nexus doctor --json # machine-readable output
11
+ */
12
+ import { Command } from 'commander';
13
+ export declare const doctorCommand: Command;
14
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkcpC,eAAO,MAAM,aAAa,SAqCtB,CAAC"}
@@ -0,0 +1,496 @@
1
+ "use strict";
2
+ /**
3
+ * nexus doctor
4
+ *
5
+ * System health check and first-run orientation.
6
+ * Runs independently of bootstrap — each check is isolated and never crashes
7
+ * the overall command. Shows actionable next steps for anything that is missing.
8
+ *
9
+ * Usage:
10
+ * nexus doctor # human-readable report
11
+ * nexus doctor --json # machine-readable output
12
+ */
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.doctorCommand = void 0;
48
+ const fs = __importStar(require("fs"));
49
+ const os = __importStar(require("os"));
50
+ const path = __importStar(require("path"));
51
+ const commander_1 = require("commander");
52
+ const process_1 = require("../bootstrap/process");
53
+ const addon_1 = require("../bootstrap/addon");
54
+ const graphql_1 = require("../bootstrap/graphql");
55
+ const paths_1 = require("../bootstrap/paths");
56
+ // ---------------------------------------------------------------------------
57
+ // Constants
58
+ // ---------------------------------------------------------------------------
59
+ // Known AI agent config files — used to detect which agents are configured.
60
+ const AGENT_CONFIG_PATHS = {
61
+ 'Claude Desktop': () => process.platform === 'win32'
62
+ ? path.join(os.homedir(), 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json')
63
+ : process.platform === 'darwin'
64
+ ? path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
65
+ : path.join(os.homedir(), '.config', 'Claude', 'claude_desktop_config.json'),
66
+ 'Cursor': () => path.join(os.homedir(), '.cursor', 'mcp.json'),
67
+ 'Windsurf': () => path.join(os.homedir(), '.codeium', 'windsurf', 'mcp_config.json'),
68
+ };
69
+ const PROVIDER_LABELS = {
70
+ anthropic: 'Anthropic (Claude)',
71
+ openai: 'OpenAI (GPT)',
72
+ google: 'Google (Gemini)',
73
+ ollama: 'Ollama (local)',
74
+ 'local-gateway': 'Local Gateway',
75
+ };
76
+ // ---------------------------------------------------------------------------
77
+ // Status icons
78
+ // ---------------------------------------------------------------------------
79
+ const ICON = {
80
+ ok: '✅',
81
+ warn: '⚠️ ',
82
+ error: '❌',
83
+ skip: '⚪',
84
+ disabled: '○ ',
85
+ };
86
+ // ---------------------------------------------------------------------------
87
+ // MCP helpers (duplicated from mcp.ts to keep doctor self-contained)
88
+ // ---------------------------------------------------------------------------
89
+ function getMcpConnectionInfoPath() {
90
+ const dir = process.platform === 'win32'
91
+ ? path.join(process.env.APPDATA ?? path.join(os.homedir(), 'AppData', 'Roaming'), 'Local')
92
+ : process.platform === 'darwin'
93
+ ? path.join(os.homedir(), 'Library', 'Application Support', 'Local')
94
+ : path.join(os.homedir(), '.config', 'Local');
95
+ return path.join(dir, 'nexus-ai-mcp-connection-info.json');
96
+ }
97
+ function loadMcpInfo() {
98
+ try {
99
+ const data = fs.readFileSync(getMcpConnectionInfoPath(), 'utf-8');
100
+ return JSON.parse(data);
101
+ }
102
+ catch {
103
+ return null;
104
+ }
105
+ }
106
+ async function isMcpServerLive(url, token) {
107
+ try {
108
+ const https = await Promise.resolve().then(() => __importStar(require('https')));
109
+ const http = await Promise.resolve().then(() => __importStar(require('http')));
110
+ const lib = url.startsWith('https') ? https : http;
111
+ return await new Promise((resolve) => {
112
+ const req = lib.get(`${url}/health`, { headers: { Authorization: `Bearer ${token}` }, timeout: 3000 }, (res) => resolve(res.statusCode === 200));
113
+ req.on('error', () => resolve(false));
114
+ req.on('timeout', () => { req.destroy(); resolve(false); });
115
+ });
116
+ }
117
+ catch {
118
+ return false;
119
+ }
120
+ }
121
+ // ---------------------------------------------------------------------------
122
+ // Individual checks (each returns CheckResult, never throws)
123
+ // ---------------------------------------------------------------------------
124
+ async function checkLocalInstalled() {
125
+ try {
126
+ const installed = (0, process_1.isLocalInstalled)();
127
+ return installed
128
+ ? { label: 'Local app', status: 'ok', detail: 'Installed' }
129
+ : { label: 'Local app', status: 'error', detail: 'Not found', action: 'Download Local from https://localwp.com' };
130
+ }
131
+ catch {
132
+ return { label: 'Local app', status: 'error', detail: 'Check failed' };
133
+ }
134
+ }
135
+ async function checkLocalRunning() {
136
+ try {
137
+ const running = await (0, process_1.isLocalRunning)();
138
+ return running
139
+ ? { label: 'Local running', status: 'ok', detail: 'Running' }
140
+ : { label: 'Local running', status: 'warn', detail: 'Not running', action: 'Open the Local app' };
141
+ }
142
+ catch {
143
+ return { label: 'Local running', status: 'error', detail: 'Check failed' };
144
+ }
145
+ }
146
+ /**
147
+ * Try to read addon version from the npm global install path.
148
+ * The addon may be loaded by Local from the npm global dir (not Local's own addons/ folder)
149
+ * when installed via `npm install -g`.
150
+ */
151
+ function getGlobalNpmAddonVersion() {
152
+ // Try npm global resolution first
153
+ try {
154
+ const pkgPath = require.resolve('@local-labs-jpollock/local-addon-nexus-ai/package.json');
155
+ return require(pkgPath).version ?? null;
156
+ }
157
+ catch { /* not on require path */ }
158
+ // Fallback: CLI and addon are the same package — read our own package.json.
159
+ // __dirname is lib/cli/commands, so ../../.. reaches the package root.
160
+ try {
161
+ const pkgPath = path.join(__dirname, '..', '..', '..', 'package.json');
162
+ return JSON.parse(fs.readFileSync(pkgPath, 'utf-8')).version ?? null;
163
+ }
164
+ catch {
165
+ return null;
166
+ }
167
+ }
168
+ async function checkAddon() {
169
+ try {
170
+ // isAddonActivated() is the authoritative signal — if the addon is in enabled-addons.json,
171
+ // Local has it available and it's active. isAddonInstalled() only checks one specific path
172
+ // and misses npm-global installs (the common case for `npm install -g` users).
173
+ const activated = (0, addon_1.isAddonActivated)();
174
+ const version = (0, addon_1.getInstalledAddonVersion)() ?? getGlobalNpmAddonVersion() ?? 'unknown';
175
+ const devMode = (0, addon_1.isDevAddon)();
176
+ if (activated) {
177
+ const detail = `Active (v${version})${devMode ? ' · dev' : ''}`;
178
+ return { label: 'Nexus AI addon', status: 'ok', detail };
179
+ }
180
+ // Activated flag not set — may be installed but not enabled
181
+ const installed = (0, addon_1.isAddonInstalled)();
182
+ if (installed) {
183
+ return { label: 'Nexus AI addon', status: 'warn', detail: `Installed (v${version}) but not activated`, action: 'Enable Nexus AI in Local → Preferences → Addons' };
184
+ }
185
+ return { label: 'Nexus AI addon', status: 'error', detail: 'Not installed', action: 'nexus update' };
186
+ }
187
+ catch {
188
+ return { label: 'Nexus AI addon', status: 'error', detail: 'Check failed' };
189
+ }
190
+ }
191
+ async function checkVersionMatch() {
192
+ try {
193
+ const addonVersion = (0, addon_1.getInstalledAddonVersion)();
194
+ if (!addonVersion)
195
+ return null;
196
+ // package.json version is baked in at build time via __VERSION__ or require
197
+ const cliPkg = require('../../../package.json');
198
+ const cliVersion = cliPkg.version;
199
+ if (addonVersion !== cliVersion) {
200
+ return {
201
+ label: 'Version match',
202
+ status: 'warn',
203
+ detail: `CLI v${cliVersion} ≠ addon v${addonVersion}`,
204
+ action: 'nexus update',
205
+ };
206
+ }
207
+ return { label: 'Version match', status: 'ok', detail: `v${cliVersion}` };
208
+ }
209
+ catch {
210
+ return null; // Non-critical — skip silently
211
+ }
212
+ }
213
+ async function checkGraphQL() {
214
+ try {
215
+ const info = (0, graphql_1.readConnectionInfo)();
216
+ if (!info) {
217
+ return { label: 'GraphQL server', status: 'warn', detail: 'No connection info — Local may not be running' };
218
+ }
219
+ return { label: 'GraphQL server', status: 'ok', detail: `Connected (port ${info.port})` };
220
+ }
221
+ catch {
222
+ return { label: 'GraphQL server', status: 'error', detail: 'Check failed' };
223
+ }
224
+ }
225
+ async function checkMcpServer() {
226
+ try {
227
+ const info = loadMcpInfo();
228
+ if (!info) {
229
+ return { label: 'MCP server', status: 'warn', detail: 'Not configured', action: 'Start Local with Nexus AI addon to activate MCP' };
230
+ }
231
+ const live = await isMcpServerLive(info.url, info.authToken);
232
+ if (!live) {
233
+ return { label: 'MCP server', status: 'warn', detail: `Configured (port ${info.port}) but not responding`, action: 'Restart Local' };
234
+ }
235
+ return { label: 'MCP server', status: 'ok', detail: `Running · ${info.tools.length} tools (v${info.version ?? '?'})` };
236
+ }
237
+ catch {
238
+ return { label: 'MCP server', status: 'error', detail: 'Check failed' };
239
+ }
240
+ }
241
+ /**
242
+ * Check if Claude Code has nexus-ai registered via `claude mcp list`.
243
+ * Claude Code is a CLI tool — registrations are managed by the `claude` binary,
244
+ * not a config file we can inspect directly.
245
+ */
246
+ async function isClaudeCodeConfigured() {
247
+ try {
248
+ const { execFile } = await Promise.resolve().then(() => __importStar(require('child_process')));
249
+ const { promisify } = await Promise.resolve().then(() => __importStar(require('util')));
250
+ const exec = promisify(execFile);
251
+ const { stdout } = await exec('claude', ['mcp', 'list'], { timeout: 4000 });
252
+ return stdout.toLowerCase().includes('nexus-ai') || stdout.includes('mcp-stdio');
253
+ }
254
+ catch {
255
+ // claude not installed, not in PATH, or command failed
256
+ return false;
257
+ }
258
+ }
259
+ async function checkAgentConfig() {
260
+ try {
261
+ const info = loadMcpInfo();
262
+ if (!info) {
263
+ return { label: 'AI agent config', status: 'warn', detail: 'MCP server not running', action: 'nexus mcp setup' };
264
+ }
265
+ const configured = [];
266
+ // Claude Code — CLI-based, detect via `claude mcp list`
267
+ if (await isClaudeCodeConfigured()) {
268
+ configured.push('Claude Code');
269
+ }
270
+ // File-based agents — check their config files for nexus references
271
+ for (const [name, getPath] of Object.entries(AGENT_CONFIG_PATHS)) {
272
+ try {
273
+ const content = fs.readFileSync(getPath(), 'utf-8');
274
+ if (content.includes(info.url) || content.includes('nexus-ai') || content.includes('mcp-stdio')) {
275
+ configured.push(name);
276
+ }
277
+ }
278
+ catch {
279
+ // File doesn't exist — agent not configured
280
+ }
281
+ }
282
+ if (configured.length === 0) {
283
+ return { label: 'AI agent config', status: 'warn', detail: 'No agents configured', action: 'nexus mcp setup' };
284
+ }
285
+ return { label: 'AI agent config', status: 'ok', detail: configured.join(', ') };
286
+ }
287
+ catch {
288
+ return { label: 'AI agent config', status: 'error', detail: 'Check failed' };
289
+ }
290
+ }
291
+ async function checkAiProvider(graphqlAvailable) {
292
+ if (!graphqlAvailable) {
293
+ return { label: 'AI provider', status: 'skip', detail: 'Local not running' };
294
+ }
295
+ try {
296
+ const { getClient } = await Promise.resolve().then(() => __importStar(require('../utils/graphql')));
297
+ const client = getClient({ timeout: 5000 });
298
+ const result = await client.mutate(`
299
+ mutation { nexusAiGetConfig { success config { provider model hasApiKey useLocalGateway } } }
300
+ `, {});
301
+ const { success, config } = result.nexusAiGetConfig;
302
+ if (!success || !config?.provider) {
303
+ return { label: 'AI provider', status: 'warn', detail: 'Not configured', action: 'nexus ai config' };
304
+ }
305
+ const label = PROVIDER_LABELS[config.provider] ?? config.provider;
306
+ if (!config.hasApiKey && config.provider !== 'ollama') {
307
+ return { label: 'AI provider', status: 'warn', detail: `${label} · no API key`, action: 'nexus ai config' };
308
+ }
309
+ return { label: 'AI provider', status: 'ok', detail: label };
310
+ }
311
+ catch {
312
+ return { label: 'AI provider', status: 'skip', detail: 'Could not reach addon' };
313
+ }
314
+ }
315
+ async function checkGateway(graphqlAvailable) {
316
+ if (!graphqlAvailable) {
317
+ return { label: 'Local Gateway', status: 'skip', detail: 'Local not running' };
318
+ }
319
+ try {
320
+ const { getClient } = await Promise.resolve().then(() => __importStar(require('../utils/graphql')));
321
+ const client = getClient({ timeout: 5000 });
322
+ const result = await client.mutate(`
323
+ mutation { nexusAiGetConfig { success config { useLocalGateway } } }
324
+ `, {});
325
+ const enabled = result.nexusAiGetConfig?.config?.useLocalGateway;
326
+ return enabled
327
+ ? { label: 'Local Gateway', status: 'ok', detail: 'Enabled' }
328
+ : { label: 'Local Gateway', status: 'disabled', detail: 'Disabled' };
329
+ }
330
+ catch {
331
+ return { label: 'Local Gateway', status: 'skip', detail: 'Could not reach addon' };
332
+ }
333
+ }
334
+ function readSiteAiConfigs() {
335
+ try {
336
+ const p = path.join((0, paths_1.getLocalPaths)().dataDir, 'nexus-ai_site_ai_config.json');
337
+ return JSON.parse(fs.readFileSync(p, 'utf-8'));
338
+ }
339
+ catch {
340
+ return {};
341
+ }
342
+ }
343
+ async function checkSitesWithAI(graphqlAvailable) {
344
+ if (!graphqlAvailable) {
345
+ return { label: 'Sites with AI', status: 'skip', detail: 'Local not running' };
346
+ }
347
+ try {
348
+ const { getClient } = await Promise.resolve().then(() => __importStar(require('../utils/graphql')));
349
+ const client = getClient({ timeout: 8000 });
350
+ const result = await client.mutate(`
351
+ mutation { nexusSitesList { local { name status } } }
352
+ `, {});
353
+ const sites = result.nexusSitesList?.local ?? [];
354
+ const total = sites.length;
355
+ if (total === 0) {
356
+ return { label: 'Sites with AI', status: 'skip', detail: 'No local sites found' };
357
+ }
358
+ // Read AI config from disk — no separate GraphQL mutation needed
359
+ const siteAiConfigs = readSiteAiConfigs();
360
+ const configuredCount = Object.keys(siteAiConfigs).length;
361
+ const running = sites.filter((s) => s.status === 'running');
362
+ const detail = `${configuredCount} / ${total} site${total !== 1 ? 's' : ''} configured · ${running.length} running`;
363
+ if (configuredCount === 0) {
364
+ const firstRunning = running[0];
365
+ return {
366
+ label: 'Sites with AI',
367
+ status: 'warn',
368
+ detail,
369
+ action: firstRunning ? `nexus ai setup ${firstRunning.name}` : 'nexus ai setup <sitename>',
370
+ };
371
+ }
372
+ return { label: 'Sites with AI', status: 'ok', detail };
373
+ }
374
+ catch {
375
+ return { label: 'Sites with AI', status: 'skip', detail: 'Could not reach addon' };
376
+ }
377
+ }
378
+ // ---------------------------------------------------------------------------
379
+ // Report rendering
380
+ // ---------------------------------------------------------------------------
381
+ const COL_LABEL = 18; // label column width
382
+ function formatRow(result) {
383
+ const icon = ICON[result.status];
384
+ const label = result.label.padEnd(COL_LABEL);
385
+ const detail = result.detail ? ` ${result.detail}` : '';
386
+ return ` ${icon} ${label}${detail}`;
387
+ }
388
+ function isFirstRun(checks) {
389
+ // "First run" = MCP not configured AND no AI provider set
390
+ const mcp = checks.find((c) => c.label === 'MCP server');
391
+ const ai = checks.find((c) => c.label === 'AI provider');
392
+ return mcp?.status === 'warn' && ai?.status === 'warn';
393
+ }
394
+ function renderReport(checks, version) {
395
+ const line = '─'.repeat(50);
396
+ const localRunning = checks.find((c) => c.label === 'Local running')?.status === 'ok';
397
+ console.log('');
398
+ console.log(`Nexus AI v${version} — System Health`);
399
+ console.log(line);
400
+ for (const check of checks) {
401
+ console.log(formatRow(check));
402
+ }
403
+ console.log(line);
404
+ const nextSteps = checks
405
+ .filter((c) => c.action && (c.status === 'warn' || c.status === 'error'))
406
+ .map((c) => c.action);
407
+ if (nextSteps.length > 0) {
408
+ console.log('');
409
+ if (isFirstRun(checks) && !localRunning) {
410
+ console.log(' Getting started:');
411
+ console.log('');
412
+ console.log(' 1. Open the Local app and make sure Nexus AI addon is enabled.');
413
+ console.log(' 2. Connect your AI agent: nexus mcp setup');
414
+ console.log(' 3. Configure AI provider: nexus ai config');
415
+ console.log('');
416
+ }
417
+ else if (isFirstRun(checks)) {
418
+ console.log(' Getting started:');
419
+ console.log('');
420
+ console.log(' 1. Connect your AI agent: nexus mcp setup');
421
+ console.log(' 2. Configure AI provider: nexus ai config');
422
+ console.log(' 3. Set up a WordPress site: nexus ai setup <sitename>');
423
+ console.log('');
424
+ }
425
+ else {
426
+ console.log(' Next steps:');
427
+ for (const step of [...new Set(nextSteps)]) {
428
+ console.log(` → ${step}`);
429
+ }
430
+ console.log('');
431
+ }
432
+ }
433
+ else {
434
+ console.log('');
435
+ console.log(' Everything looks good. 🎉');
436
+ console.log('');
437
+ }
438
+ }
439
+ function renderJson(checks, version) {
440
+ const output = {
441
+ version,
442
+ healthy: checks.every((c) => c.status === 'ok' || c.status === 'disabled' || c.status === 'skip'),
443
+ checks: checks.map((c) => ({
444
+ label: c.label,
445
+ status: c.status,
446
+ detail: c.detail ?? null,
447
+ action: c.action ?? null,
448
+ })),
449
+ };
450
+ console.log(JSON.stringify(output, null, 2));
451
+ }
452
+ // ---------------------------------------------------------------------------
453
+ // Command
454
+ // ---------------------------------------------------------------------------
455
+ exports.doctorCommand = new commander_1.Command('doctor')
456
+ .description('Check system health and show setup status')
457
+ .option('--json', 'Output as JSON')
458
+ .action(async (options) => {
459
+ const cliPkg = (() => {
460
+ try {
461
+ return require('../../../package.json');
462
+ }
463
+ catch {
464
+ return { version: '?' };
465
+ }
466
+ })();
467
+ const version = cliPkg.version;
468
+ const checks = [];
469
+ // ── Phase 1: checks that never need Local/GraphQL ────────────────────
470
+ checks.push(await checkLocalInstalled());
471
+ checks.push(await checkLocalRunning());
472
+ checks.push(await checkAddon());
473
+ const versionMatch = await checkVersionMatch();
474
+ if (versionMatch)
475
+ checks.push(versionMatch);
476
+ checks.push(await checkGraphQL());
477
+ checks.push(await checkMcpServer());
478
+ checks.push(await checkAgentConfig());
479
+ // ── Phase 2: checks that need GraphQL (only if GraphQL is reachable) ─
480
+ const graphqlAvailable = checks.find((c) => c.label === 'GraphQL server')?.status === 'ok';
481
+ checks.push(await checkAiProvider(graphqlAvailable));
482
+ checks.push(await checkGateway(graphqlAvailable));
483
+ checks.push(await checkSitesWithAI(graphqlAvailable));
484
+ // ── Output ────────────────────────────────────────────────────────────
485
+ if (options.json) {
486
+ renderJson(checks, version);
487
+ }
488
+ else {
489
+ renderReport(checks, version);
490
+ }
491
+ // Exit with non-zero if any check is 'error'
492
+ const hasError = checks.some((c) => c.status === 'error');
493
+ if (hasError)
494
+ process.exit(1);
495
+ });
496
+ //# sourceMappingURL=doctor.js.map