@rubytech/create-maxy-code 0.1.38 → 0.1.39

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 (297) hide show
  1. package/dist/__tests__/onboarding-state-readback.test.js +61 -0
  2. package/dist/onboarding-readback.js +27 -0
  3. package/package.json +1 -1
  4. package/payload/platform/lib/anthropic-key/dist/index.d.ts +22 -0
  5. package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +1 -0
  6. package/payload/platform/lib/anthropic-key/dist/index.js +232 -0
  7. package/payload/platform/lib/anthropic-key/dist/index.js.map +1 -0
  8. package/payload/platform/package-lock.json +513 -753
  9. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +39 -0
  10. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +1 -0
  11. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +249 -0
  12. package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +1 -0
  13. package/payload/platform/plugins/docs/references/platform.md +1 -1
  14. package/payload/platform/plugins/real-agency/plugins/.claude-plugin/marketplace.json +13 -0
  15. package/payload/platform/plugins/real-agency/plugins/loop/.claude-plugin/plugin.json +17 -0
  16. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.d.ts +2 -0
  17. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.d.ts.map +1 -0
  18. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.js +293 -0
  19. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.js.map +1 -0
  20. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts +10 -0
  21. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts.map +1 -0
  22. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js +88 -0
  23. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js.map +1 -0
  24. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts +82 -0
  25. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -0
  26. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js +427 -0
  27. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -0
  28. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts +5 -0
  29. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +1 -0
  30. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js +40 -0
  31. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -0
  32. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +10 -0
  33. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -0
  34. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js +24 -0
  35. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js.map +1 -0
  36. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts +16 -0
  37. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts.map +1 -0
  38. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js +35 -0
  39. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js.map +1 -0
  40. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts +5 -0
  41. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -0
  42. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js +19 -0
  43. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -0
  44. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts +4 -0
  45. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts.map +1 -0
  46. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js +14 -0
  47. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js.map +1 -0
  48. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts +9 -0
  49. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -0
  50. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js +60 -0
  51. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js.map +1 -0
  52. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +13 -0
  53. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -0
  54. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js +41 -0
  55. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +1 -0
  56. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +9 -0
  57. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -0
  58. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js +16 -0
  59. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +1 -0
  60. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +15 -0
  61. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -0
  62. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js +11 -0
  63. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +1 -0
  64. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts +10 -0
  65. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +1 -0
  66. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js +39 -0
  67. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js.map +1 -0
  68. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts +9 -0
  69. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +1 -0
  70. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js +125 -0
  71. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js.map +1 -0
  72. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts +18 -0
  73. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts.map +1 -0
  74. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js +87 -0
  75. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js.map +1 -0
  76. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts +10 -0
  77. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +1 -0
  78. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js +82 -0
  79. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js.map +1 -0
  80. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts +12 -0
  81. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +1 -0
  82. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js +32 -0
  83. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js.map +1 -0
  84. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts +15 -0
  85. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts.map +1 -0
  86. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js +11 -0
  87. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js.map +1 -0
  88. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts +16 -0
  89. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts.map +1 -0
  90. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js +41 -0
  91. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js.map +1 -0
  92. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts +13 -0
  93. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts.map +1 -0
  94. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js +49 -0
  95. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js.map +1 -0
  96. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts +7 -0
  97. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +1 -0
  98. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js +19 -0
  99. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js.map +1 -0
  100. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts +5 -0
  101. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts.map +1 -0
  102. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js +32 -0
  103. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js.map +1 -0
  104. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts +14 -0
  105. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +1 -0
  106. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js +11 -0
  107. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js.map +1 -0
  108. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +9 -0
  109. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -0
  110. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js +85 -0
  111. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js.map +1 -0
  112. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts +13 -0
  113. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +1 -0
  114. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js +44 -0
  115. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js.map +1 -0
  116. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts +14 -0
  117. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +1 -0
  118. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js +18 -0
  119. package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js.map +1 -0
  120. package/payload/premium-plugins/real-agency/plugins/.claude-plugin/marketplace.json +13 -0
  121. package/payload/premium-plugins/real-agency/plugins/loop/.claude-plugin/plugin.json +17 -0
  122. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.d.ts +2 -0
  123. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.d.ts.map +1 -0
  124. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.js +293 -0
  125. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.js.map +1 -0
  126. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts +10 -0
  127. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts.map +1 -0
  128. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js +88 -0
  129. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js.map +1 -0
  130. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts +82 -0
  131. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -0
  132. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js +427 -0
  133. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -0
  134. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts +5 -0
  135. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +1 -0
  136. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js +40 -0
  137. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -0
  138. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +10 -0
  139. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -0
  140. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js +24 -0
  141. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js.map +1 -0
  142. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts +16 -0
  143. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts.map +1 -0
  144. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js +35 -0
  145. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js.map +1 -0
  146. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts +5 -0
  147. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -0
  148. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js +19 -0
  149. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -0
  150. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts +4 -0
  151. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts.map +1 -0
  152. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js +14 -0
  153. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js.map +1 -0
  154. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts +9 -0
  155. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -0
  156. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js +60 -0
  157. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js.map +1 -0
  158. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +13 -0
  159. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -0
  160. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js +41 -0
  161. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +1 -0
  162. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +9 -0
  163. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -0
  164. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js +16 -0
  165. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +1 -0
  166. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +15 -0
  167. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -0
  168. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js +11 -0
  169. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +1 -0
  170. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts +10 -0
  171. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +1 -0
  172. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js +39 -0
  173. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js.map +1 -0
  174. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts +9 -0
  175. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +1 -0
  176. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js +125 -0
  177. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js.map +1 -0
  178. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts +18 -0
  179. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts.map +1 -0
  180. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js +87 -0
  181. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js.map +1 -0
  182. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts +10 -0
  183. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +1 -0
  184. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js +82 -0
  185. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js.map +1 -0
  186. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts +12 -0
  187. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +1 -0
  188. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js +32 -0
  189. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js.map +1 -0
  190. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts +15 -0
  191. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts.map +1 -0
  192. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js +11 -0
  193. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js.map +1 -0
  194. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts +16 -0
  195. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts.map +1 -0
  196. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js +41 -0
  197. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js.map +1 -0
  198. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts +13 -0
  199. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts.map +1 -0
  200. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js +49 -0
  201. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js.map +1 -0
  202. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts +7 -0
  203. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +1 -0
  204. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js +19 -0
  205. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js.map +1 -0
  206. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts +5 -0
  207. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts.map +1 -0
  208. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js +32 -0
  209. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js.map +1 -0
  210. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts +14 -0
  211. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +1 -0
  212. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js +11 -0
  213. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js.map +1 -0
  214. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +9 -0
  215. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -0
  216. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js +85 -0
  217. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js.map +1 -0
  218. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts +13 -0
  219. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +1 -0
  220. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js +44 -0
  221. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js.map +1 -0
  222. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts +14 -0
  223. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +1 -0
  224. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js +18 -0
  225. package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js.map +1 -0
  226. package/payload/server/public/assets/{Checkbox-DAki3vDW.js → Checkbox-CmCjmfJy.js} +1 -1
  227. package/payload/server/public/assets/{admin-CyAZtsYZ.js → admin-CtodW6As.js} +1 -1
  228. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-C-hla3Ip.js → architectureDiagram-Q4EWVU46-CfOjbx0H.js} +1 -1
  229. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-CbzjtNs3.js → blockDiagram-DXYQGD6D-D0kA2C9i.js} +1 -1
  230. package/payload/server/public/assets/{brand-Cun0PBrA.css → brand-6hKfBgOI.css} +1 -1
  231. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-B87UblA0.js → c4Diagram-AHTNJAMY-CDgXiXgj.js} +1 -1
  232. package/payload/server/public/assets/channel-DA7MGMzQ.js +1 -0
  233. package/payload/server/public/assets/{chunk-336JU56O-2a2pVlSg.js → chunk-336JU56O-BfBTcT5X.js} +2 -2
  234. package/payload/server/public/assets/{chunk-426QAEUC-j9NOD8_a.js → chunk-426QAEUC-BdSSZ1Kw.js} +1 -1
  235. package/payload/server/public/assets/{chunk-4TB4RGXK-Cs872xAq.js → chunk-4TB4RGXK-UvE1im9g.js} +1 -1
  236. package/payload/server/public/assets/{chunk-5FUZZQ4R-BnDFbZ_I.js → chunk-5FUZZQ4R-Dx4DslXz.js} +1 -1
  237. package/payload/server/public/assets/{chunk-5PVQY5BW-Bu5B3Hyf.js → chunk-5PVQY5BW-CNHawhLJ.js} +1 -1
  238. package/payload/server/public/assets/{chunk-EDXVE4YY-B96Fw4FF.js → chunk-EDXVE4YY-Rmjv-1et.js} +1 -1
  239. package/payload/server/public/assets/{chunk-ENJZ2VHE-CcGrGQim.js → chunk-ENJZ2VHE-CL-LeH3r.js} +1 -1
  240. package/payload/server/public/assets/{chunk-ICPOFSXX-ZRvcI4Ai.js → chunk-ICPOFSXX-B2MFOJDt.js} +1 -1
  241. package/payload/server/public/assets/{chunk-OYMX7WX6-B6RI9Fbf.js → chunk-OYMX7WX6-BxcIcCt5.js} +1 -1
  242. package/payload/server/public/assets/{chunk-U2HBQHQK-BYGHVYyo.js → chunk-U2HBQHQK-COzwOBrY.js} +1 -1
  243. package/payload/server/public/assets/{chunk-X2U36JSP-rwNs-gTO.js → chunk-X2U36JSP-B0rjT5hL.js} +1 -1
  244. package/payload/server/public/assets/{chunk-YZCP3GAM-jPttJRap.js → chunk-YZCP3GAM-pwrIw0XH.js} +1 -1
  245. package/payload/server/public/assets/{chunk-ZZ45TVLE-DLykWOT5.js → chunk-ZZ45TVLE-BXpeAm0k.js} +1 -1
  246. package/payload/server/public/assets/classDiagram-6PBFFD2Q-DqfmcWSr.js +1 -0
  247. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BVOMSbZ_.js +1 -0
  248. package/payload/server/public/assets/clone-Byp7hagU.js +1 -0
  249. package/payload/server/public/assets/{dagre-jnQDnF-5.js → dagre-DjOJn05k.js} +1 -1
  250. package/payload/server/public/assets/{dagre-KV5264BT-C6wSzHX2.js → dagre-KV5264BT-PczvQiEh.js} +1 -1
  251. package/payload/server/public/assets/data-A7azIkZU.js +1 -0
  252. package/payload/server/public/assets/{device-url-actions-y1tXNDZx.js → device-url-actions-C55ZS_Zg.js} +1 -1
  253. package/payload/server/public/assets/{diagram-5BDNPKRD-N3X-n90h.js → diagram-5BDNPKRD-D477xo5F.js} +1 -1
  254. package/payload/server/public/assets/{diagram-G4DWMVQ6-vfmbzdPd.js → diagram-G4DWMVQ6-C-HAtbtT.js} +1 -1
  255. package/payload/server/public/assets/{diagram-MMDJMWI5-BETmPx_w.js → diagram-MMDJMWI5-B9wus4H0.js} +1 -1
  256. package/payload/server/public/assets/{diagram-TYMM5635-BSUGM4wG.js → diagram-TYMM5635-UMZLloFr.js} +1 -1
  257. package/payload/server/public/assets/{erDiagram-SMLLAGMA-CWZ9OwMb.js → erDiagram-SMLLAGMA-B8E52Mp4.js} +1 -1
  258. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-BpQOQS1a.js → flowDiagram-DWJPFMVM-CUel34tq.js} +1 -1
  259. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-Dc59igCS.js → ganttDiagram-T4ZO3ILL-BfwE-Xav.js} +1 -1
  260. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-D6lXg3zl.js → gitGraphDiagram-UUTBAWPF-2d6tXRIM.js} +1 -1
  261. package/payload/server/public/assets/graph-Dx83EhtP.js +1 -0
  262. package/payload/server/public/assets/{graph-labels-DFyNH0jb.js → graph-labels-Bg2Bzelb.js} +1 -1
  263. package/payload/server/public/assets/{graphlib-yG7kH8Fr.js → graphlib-CCo9-wNJ.js} +1 -1
  264. package/payload/server/public/assets/{infoDiagram-42DDH7IO-TS9Pv8Os.js → infoDiagram-42DDH7IO-DB1SVWL6.js} +1 -1
  265. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-BJiJJTq6.js → ishikawaDiagram-UXIWVN3A-CdeMUTYS.js} +1 -1
  266. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-C7PW4fmw.js → journeyDiagram-VCZTEJTY-D8x8TUoc.js} +1 -1
  267. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-BEk21ciD.js → kanban-definition-6JOO6SKY-Cmkhd1mO.js} +1 -1
  268. package/payload/server/public/assets/{line-DusyVWDE.js → line-CoHkpBv3.js} +1 -1
  269. package/payload/server/public/assets/{mermaid-parser.core-DeeojQSb.js → mermaid-parser.core-C7R2PfZC.js} +1 -1
  270. package/payload/server/public/assets/{mermaid.core-p65Lo7Sj.js → mermaid.core-lQaq-kll.js} +3 -3
  271. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-B0jxFxdS.js → mindmap-definition-QFDTVHPH-CsPq3pX1.js} +1 -1
  272. package/payload/server/public/assets/{page-BeYGnDzI.js → page-CBKzjUHO.js} +1 -1
  273. package/payload/server/public/assets/{page-x5khmfRx.js → page-DwEaAdVp.js} +1 -1
  274. package/payload/server/public/assets/{pieDiagram-DEJITSTG-DJ5GKYt6.js → pieDiagram-DEJITSTG-FZH9sTnP.js} +1 -1
  275. package/payload/server/public/assets/{public-cnoUs7vq.js → public-hGLzxhE_.js} +3 -3
  276. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-BV7R-kwV.js → quadrantDiagram-34T5L4WZ-9poxfoqh.js} +1 -1
  277. package/payload/server/public/assets/{requirementDiagram-MS252O5E-DRiLzlGN.js → requirementDiagram-MS252O5E-Ce7iOdT_.js} +1 -1
  278. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-C5-6_cCI.js → sankeyDiagram-XADWPNL6-DINuXatI.js} +1 -1
  279. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-5FXm_VYM.js → sequenceDiagram-FGHM5R23-CSMec3EK.js} +1 -1
  280. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-FCQTaGqV.js → stateDiagram-FHFEXIEX-15DKzypj.js} +1 -1
  281. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-AcaK_QfD.js +1 -0
  282. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-tvtq62ef.js → timeline-definition-GMOUNBTQ-BxIRc9Pu.js} +1 -1
  283. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-Dk-k7CE4.js → vennDiagram-DHZGUBPP-DdgRyU55.js} +1 -1
  284. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-CZSrqniY.js → wardleyDiagram-NUSXRM2D-CKvhU1Uj.js} +1 -1
  285. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-CpGLpk7Q.js → xychartDiagram-5P7HB3ND-d0V1V4PD.js} +1 -1
  286. package/payload/server/public/data.html +5 -5
  287. package/payload/server/public/graph.html +6 -6
  288. package/payload/server/public/index.html +8 -8
  289. package/payload/server/public/public.html +5 -5
  290. package/payload/server/public/assets/channel-CTNo72W7.js +0 -1
  291. package/payload/server/public/assets/classDiagram-6PBFFD2Q-BaV5nDmT.js +0 -1
  292. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DOKlCKjY.js +0 -1
  293. package/payload/server/public/assets/clone-sQSwlSln.js +0 -1
  294. package/payload/server/public/assets/data-DbkuXcPb.js +0 -1
  295. package/payload/server/public/assets/graph-CC5_6-dg.js +0 -1
  296. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BdpPhdqg.js +0 -1
  297. /package/payload/server/public/assets/{brand-lj7EhWRg.js → brand-DXOx08r0.js} +0 -0
@@ -0,0 +1,61 @@
1
+ // Task 033 — install-invariant for OnboardingState seed.
2
+ //
3
+ // The installer re-reads Neo4j after seed-neo4j.sh to verify the
4
+ // OnboardingState node landed. The parser turns cypher-shell's plain-
5
+ // format output into a tri-state outcome consumed by the loud-fail
6
+ // branch in src/index.ts. These tests fence the three outcomes the
7
+ // installer logs name: present / missing / unreachable.
8
+ import test from "node:test";
9
+ import assert from "node:assert/strict";
10
+ import { classifyOnboardingReadBack } from "../onboarding-readback.js";
11
+ test("non-zero exit → unreachable, with stderr tail captured", () => {
12
+ const outcome = classifyOnboardingReadBack({
13
+ status: 1,
14
+ stdout: "",
15
+ stderr: "Connection refused: bolt://localhost:7687",
16
+ });
17
+ assert.equal(outcome.kind, "unreachable");
18
+ if (outcome.kind === "unreachable") {
19
+ assert.match(outcome.stderrTail, /Connection refused/);
20
+ }
21
+ });
22
+ test("header row only (no match) → missing", () => {
23
+ // cypher-shell --format plain emits the column header even when zero rows
24
+ // matched. The seed-or-fail contract treats header-only as the loud-fail.
25
+ const outcome = classifyOnboardingReadBack({
26
+ status: 0,
27
+ stdout: "currentStep\n",
28
+ stderr: "",
29
+ });
30
+ assert.equal(outcome.kind, "missing");
31
+ });
32
+ test("data row present → present, currentStep relayed verbatim", () => {
33
+ const outcome = classifyOnboardingReadBack({
34
+ status: 0,
35
+ stdout: "currentStep\n0\n",
36
+ stderr: "",
37
+ });
38
+ assert.equal(outcome.kind, "present");
39
+ if (outcome.kind === "present") {
40
+ assert.equal(outcome.currentStep, "0");
41
+ }
42
+ });
43
+ test("empty stdout + zero exit → missing (defensive: cypher-shell flushed nothing)", () => {
44
+ const outcome = classifyOnboardingReadBack({
45
+ status: 0,
46
+ stdout: "",
47
+ stderr: "",
48
+ });
49
+ assert.equal(outcome.kind, "missing");
50
+ });
51
+ test("trailing whitespace tolerated on present row", () => {
52
+ const outcome = classifyOnboardingReadBack({
53
+ status: 0,
54
+ stdout: "currentStep\n0 \n\n",
55
+ stderr: "",
56
+ });
57
+ assert.equal(outcome.kind, "present");
58
+ if (outcome.kind === "present") {
59
+ assert.equal(outcome.currentStep, "0");
60
+ }
61
+ });
@@ -0,0 +1,27 @@
1
+ // Task 033 — pure parser for the OnboardingState read-back assertion.
2
+ //
3
+ // Extracted into a dedicated module (not src/index.ts) so the test
4
+ // suite can import it without triggering index's brand.json-at-load
5
+ // side effect. The installer's loud-fail branches at
6
+ // `assertOnboardingStateSeeded` consume the tri-state outcome.
7
+ /**
8
+ * Classify cypher-shell --format plain output into one of three states:
9
+ *
10
+ * - `unreachable` — non-zero exit (auth, network, syntax). Stderr tail
11
+ * (last 200 chars) is preserved so the install log carries the
12
+ * symptom verbatim.
13
+ * - `missing` — exit 0 but no data row beyond the header. cypher-shell
14
+ * prints the column name even on a zero-match query.
15
+ * - `present` — exit 0 with at least one data row. `currentStep` is the
16
+ * first field on row 2.
17
+ */
18
+ export function classifyOnboardingReadBack(input) {
19
+ if (input.status !== 0) {
20
+ return { kind: "unreachable", stderrTail: input.stderr.trim().slice(-200) };
21
+ }
22
+ const lines = input.stdout.trim().split("\n").filter((l) => l.length > 0);
23
+ if (lines.length < 2) {
24
+ return { kind: "missing" };
25
+ }
26
+ return { kind: "present", currentStep: lines[1].trim() };
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-maxy-code",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "Install Maxy — AI for Productive People",
5
5
  "bin": {
6
6
  "create-maxy-code": "./dist/index.js"
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Centralised Anthropic API key management.
3
+ *
4
+ * Provides read/write/validate operations for the Anthropic API key
5
+ * used by the public agent. All consumers import from this module
6
+ * instead of inlining the env-var-then-file lookup pattern.
7
+ *
8
+ * Follows the same shape as cloudflare/mcp/src/lib/cloudflared.ts
9
+ * (readToken, writeToken, hasToken, validateToken).
10
+ */
11
+ export declare function readKey(): string | null;
12
+ export declare function writeKey(key: string): void;
13
+ export declare function hasKey(): boolean;
14
+ export declare function deleteKey(): void;
15
+ export type KeyStatus = "valid" | "billing" | "auth_error" | "missing" | "error";
16
+ export interface KeyValidation {
17
+ status: KeyStatus;
18
+ message: string;
19
+ }
20
+ export declare function validateKey(key?: string): Promise<KeyValidation>;
21
+ export declare function keyFilePath(): string;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoEH,wBAAgB,OAAO,IAAI,MAAM,GAAG,IAAI,CAiDvC;AAMD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAiB1C;AAMD,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAaD,wBAAgB,SAAS,IAAI,IAAI,CAsBhC;AAUD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAsFtE;AAOD,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+ /**
3
+ * Centralised Anthropic API key management.
4
+ *
5
+ * Provides read/write/validate operations for the Anthropic API key
6
+ * used by the public agent. All consumers import from this module
7
+ * instead of inlining the env-var-then-file lookup pattern.
8
+ *
9
+ * Follows the same shape as cloudflare/mcp/src/lib/cloudflared.ts
10
+ * (readToken, writeToken, hasToken, validateToken).
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.readKey = readKey;
14
+ exports.writeKey = writeKey;
15
+ exports.hasKey = hasKey;
16
+ exports.deleteKey = deleteKey;
17
+ exports.validateKey = validateKey;
18
+ exports.keyFilePath = keyFilePath;
19
+ const index_js_1 = require("../../models/dist/index.js");
20
+ const node_fs_1 = require("node:fs");
21
+ const node_path_1 = require("node:path");
22
+ const node_os_1 = require("node:os");
23
+ // ---------------------------------------------------------------------------
24
+ // Path resolution — lazy, cached
25
+ //
26
+ // The key file lives at ~/{configDir}/.anthropic-api-key where configDir
27
+ // is read from brand.json. Resolution strategy:
28
+ // 1. PLATFORM_ROOT env var → brand.json → configDir (MCP servers)
29
+ // 2. MAXY_PLATFORM_ROOT env var → brand.json → configDir (UI/Next.js)
30
+ // 3. Fall back to .maxy (dev environment, neither env var set)
31
+ // ---------------------------------------------------------------------------
32
+ let cachedKeyFilePath = null;
33
+ function resolveKeyFilePath() {
34
+ if (cachedKeyFilePath)
35
+ return cachedKeyFilePath;
36
+ let configDirName = ".maxy"; // default for dev
37
+ const platformRoot = process.env.PLATFORM_ROOT ?? process.env.MAXY_PLATFORM_ROOT;
38
+ if (platformRoot) {
39
+ const brandPath = (0, node_path_1.join)(platformRoot, "config", "brand.json");
40
+ if (!(0, node_fs_1.existsSync)(brandPath)) {
41
+ throw new Error(`brand.json not found at ${brandPath} — platform not properly installed`);
42
+ }
43
+ try {
44
+ const brand = JSON.parse((0, node_fs_1.readFileSync)(brandPath, "utf-8"));
45
+ if (!brand.configDir) {
46
+ throw new Error(`brand.json at ${brandPath} is missing the configDir field`);
47
+ }
48
+ configDirName = brand.configDir;
49
+ }
50
+ catch (err) {
51
+ if (err instanceof SyntaxError) {
52
+ throw new Error(`brand.json at ${brandPath} is not valid JSON: ${err.message}`);
53
+ }
54
+ throw err;
55
+ }
56
+ }
57
+ cachedKeyFilePath = (0, node_path_1.resolve)((0, node_os_1.homedir)(), configDirName, ".anthropic-api-key");
58
+ return cachedKeyFilePath;
59
+ }
60
+ // ---------------------------------------------------------------------------
61
+ // readKey — two-tier lookup: env var → file
62
+ //
63
+ // Returns the key string or null if unavailable. Never throws on
64
+ // missing/unreadable key — callers handle null per their context.
65
+ // ---------------------------------------------------------------------------
66
+ function readKey() {
67
+ const envKey = process.env.ANTHROPIC_API_KEY;
68
+ if (envKey && envKey.trim()) {
69
+ return envKey.trim();
70
+ }
71
+ let keyFilePath;
72
+ try {
73
+ keyFilePath = resolveKeyFilePath();
74
+ }
75
+ catch (err) {
76
+ const msg = err instanceof Error ? err.message : String(err);
77
+ console.error(`[anthropic-key] path resolution failed: ${msg}`);
78
+ return null;
79
+ }
80
+ if (envKey !== undefined) {
81
+ // env var was set but empty — log and fall through to file
82
+ console.error(`[anthropic-key] ANTHROPIC_API_KEY env var is set but empty, falling back to file`);
83
+ }
84
+ try {
85
+ const raw = (0, node_fs_1.readFileSync)(keyFilePath, "utf-8").trim();
86
+ if (!raw) {
87
+ console.error(`[anthropic-key] key file exists but is empty: ${keyFilePath}`);
88
+ return null;
89
+ }
90
+ return raw;
91
+ }
92
+ catch (err) {
93
+ const code = err instanceof Error && "code" in err
94
+ ? err.code
95
+ : undefined;
96
+ if (code === "ENOENT") {
97
+ // File does not exist — expected on fresh installs
98
+ console.error(`[anthropic-key] no key available (env var unset, file not found: ${keyFilePath})`);
99
+ }
100
+ else {
101
+ const msg = err instanceof Error ? err.message : String(err);
102
+ console.error(`[anthropic-key] failed to read key file ${keyFilePath}: ${msg}`);
103
+ }
104
+ return null;
105
+ }
106
+ }
107
+ // ---------------------------------------------------------------------------
108
+ // writeKey — validate format and write with restricted permissions
109
+ // ---------------------------------------------------------------------------
110
+ function writeKey(key) {
111
+ const trimmed = key.trim();
112
+ if (!trimmed.startsWith("sk-ant-")) {
113
+ throw new Error("Invalid key format. Must start with sk-ant-.");
114
+ }
115
+ if (trimmed.length < 90) {
116
+ throw new Error("Invalid key format. Must be at least 90 characters.");
117
+ }
118
+ const keyFilePath = resolveKeyFilePath();
119
+ (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(keyFilePath), { recursive: true });
120
+ (0, node_fs_1.writeFileSync)(keyFilePath, trimmed, { mode: 0o600 });
121
+ console.error(`[anthropic-key] key written to ${keyFilePath}`);
122
+ }
123
+ // ---------------------------------------------------------------------------
124
+ // hasKey — thin check, no validation
125
+ // ---------------------------------------------------------------------------
126
+ function hasKey() {
127
+ return readKey() !== null;
128
+ }
129
+ // ---------------------------------------------------------------------------
130
+ // deleteKey — remove the stored key file; idempotent on ENOENT
131
+ //
132
+ // Throws on unexpected fs errors (EACCES, EBUSY, EPERM) so callers can
133
+ // surface a structured failure. ENOENT is treated as a no-op because the
134
+ // intended post-condition ("no key file on disk") is already satisfied.
135
+ // Per Task 531 learning, never use `{ force: true }` — it swallows the
136
+ // error classes that matter (permission, busy) and leaves the caller
137
+ // believing removal succeeded.
138
+ // ---------------------------------------------------------------------------
139
+ function deleteKey() {
140
+ const keyFilePath = resolveKeyFilePath();
141
+ try {
142
+ (0, node_fs_1.unlinkSync)(keyFilePath);
143
+ console.error(`[anthropic-key] deleteKey: removed ${keyFilePath}`);
144
+ }
145
+ catch (err) {
146
+ const code = err instanceof Error && "code" in err
147
+ ? err.code
148
+ : undefined;
149
+ if (code === "ENOENT") {
150
+ console.error(`[anthropic-key] deleteKey: nothing to remove (ENOENT): ${keyFilePath}`);
151
+ return;
152
+ }
153
+ const msg = err instanceof Error ? err.message : String(err);
154
+ console.error(`[anthropic-key] deleteKey: failed to remove ${keyFilePath}: ${msg}`);
155
+ throw err;
156
+ }
157
+ }
158
+ async function validateKey(key) {
159
+ const effectiveKey = key ?? readKey();
160
+ if (!effectiveKey) {
161
+ return {
162
+ status: "missing",
163
+ message: "No API key available (env var unset, file missing or empty).",
164
+ };
165
+ }
166
+ const start = Date.now();
167
+ try {
168
+ const res = await fetch("https://api.anthropic.com/v1/messages", {
169
+ method: "POST",
170
+ headers: {
171
+ "Content-Type": "application/json",
172
+ "x-api-key": effectiveKey,
173
+ "anthropic-version": "2023-06-01",
174
+ },
175
+ body: JSON.stringify({
176
+ model: index_js_1.HAIKU_MODEL,
177
+ max_tokens: 1,
178
+ messages: [{ role: "user", content: "hi" }],
179
+ }),
180
+ signal: AbortSignal.timeout(10000),
181
+ });
182
+ const latency = Date.now() - start;
183
+ if (res.ok || res.status === 429) {
184
+ // Consume the response body to release the connection back to the pool.
185
+ await res.text();
186
+ console.error(`[anthropic-key] validate: valid (${res.status}, ${latency}ms)`);
187
+ return {
188
+ status: "valid",
189
+ message: "API key is working. Credits available.",
190
+ };
191
+ }
192
+ const body = await res.text();
193
+ if (/credit balance|billing|purchase credits/i.test(body)) {
194
+ console.error(`[anthropic-key] validate: billing (${res.status}, ${latency}ms)`);
195
+ return {
196
+ status: "billing",
197
+ message: "API key is valid but credit balance is too low. The user must add credits at console.anthropic.com under Plans & Billing, or enable auto-top-up.",
198
+ };
199
+ }
200
+ if (res.status === 401 ||
201
+ res.status === 403 ||
202
+ /authentication_error|permission_error/i.test(body)) {
203
+ console.error(`[anthropic-key] validate: auth_error (${res.status}, ${latency}ms)`);
204
+ return {
205
+ status: "auth_error",
206
+ message: "API key was rejected. It may be invalid, revoked, or expired. The user should create a new key at console.anthropic.com/settings/keys.",
207
+ };
208
+ }
209
+ console.error(`[anthropic-key] validate: error (${res.status}, ${latency}ms)`);
210
+ return {
211
+ status: "error",
212
+ message: `Could not verify API key. Anthropic returned ${res.status}. This may be a temporary outage — try again later.`,
213
+ };
214
+ }
215
+ catch (err) {
216
+ const latency = Date.now() - start;
217
+ const msg = err instanceof Error ? err.message : String(err);
218
+ console.error(`[anthropic-key] validate: error (network failure, ${latency}ms): ${msg}`);
219
+ return {
220
+ status: "error",
221
+ message: `Could not reach the Anthropic API: ${msg}. Check network connectivity.`,
222
+ };
223
+ }
224
+ }
225
+ // ---------------------------------------------------------------------------
226
+ // keyFilePath — expose the resolved path for callers that need it
227
+ // (e.g., existsSync checks, user-facing messages about the key location)
228
+ // ---------------------------------------------------------------------------
229
+ function keyFilePath() {
230
+ return resolveKeyFilePath();
231
+ }
232
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAoEH,0BAiDC;AAMD,4BAiBC;AAMD,wBAEC;AAaD,8BAsBC;AAiBD,kCAsFC;AAOD,kCAEC;AArSD,yDAAyD;AACzD,qCAMiB;AACjB,yCAAmD;AACnD,qCAAkC;AAElC,8EAA8E;AAC9E,iCAAiC;AACjC,EAAE;AACF,yEAAyE;AACzE,gDAAgD;AAChD,qEAAqE;AACrE,yEAAyE;AACzE,kEAAkE;AAClE,8EAA8E;AAE9E,IAAI,iBAAiB,GAAkB,IAAI,CAAC;AAE5C,SAAS,kBAAkB;IACzB,IAAI,iBAAiB;QAAE,OAAO,iBAAiB,CAAC;IAEhD,IAAI,aAAa,GAAG,OAAO,CAAC,CAAC,kBAAkB;IAC/C,MAAM,YAAY,GAChB,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAE9D,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,IAAA,gBAAI,EAAC,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;QAC7D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