@useatlas/create 0.0.2 → 0.0.4

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 (296) hide show
  1. package/README.md +4 -18
  2. package/index.ts +191 -31
  3. package/package.json +1 -1
  4. package/templates/docker/.env.example +3 -3
  5. package/templates/docker/Dockerfile.sidecar +28 -0
  6. package/templates/docker/bin/__tests__/plugin-cli.test.ts +9 -9
  7. package/templates/docker/bin/atlas.ts +108 -44
  8. package/templates/docker/data/demo-semantic/catalog.yml +51 -27
  9. package/templates/docker/data/demo-semantic/entities/accounts.yml +95 -103
  10. package/templates/docker/data/demo-semantic/entities/companies.yml +88 -152
  11. package/templates/docker/data/demo-semantic/entities/people.yml +82 -95
  12. package/templates/docker/data/demo-semantic/glossary.yml +104 -8
  13. package/templates/docker/data/demo-semantic/metrics/accounts.yml +62 -23
  14. package/templates/docker/data/demo-semantic/metrics/companies.yml +52 -78
  15. package/templates/docker/docker-compose.yml +1 -1
  16. package/templates/docker/docs/deploy.md +2 -39
  17. package/templates/docker/package.json +17 -1
  18. package/templates/docker/semantic/catalog.yml +62 -3
  19. package/templates/docker/semantic/entities/accounts.yml +162 -0
  20. package/templates/docker/semantic/entities/companies.yml +143 -0
  21. package/templates/docker/semantic/entities/people.yml +132 -0
  22. package/templates/docker/semantic/glossary.yml +116 -4
  23. package/templates/docker/semantic/metrics/accounts.yml +77 -0
  24. package/templates/docker/semantic/metrics/companies.yml +63 -0
  25. package/templates/docker/sidecar/Dockerfile +5 -6
  26. package/templates/docker/sidecar/railway.json +1 -2
  27. package/templates/docker/src/api/__tests__/admin.test.ts +7 -7
  28. package/templates/docker/src/api/__tests__/health-plugin.test.ts +7 -0
  29. package/templates/docker/src/api/__tests__/health.test.ts +30 -8
  30. package/templates/docker/src/api/routes/admin.ts +549 -8
  31. package/templates/docker/src/api/routes/chat.ts +5 -20
  32. package/templates/docker/src/api/routes/health.ts +39 -27
  33. package/templates/docker/src/api/routes/openapi.ts +1329 -74
  34. package/templates/docker/src/api/routes/query.ts +2 -1
  35. package/templates/docker/src/api/server.ts +27 -0
  36. package/templates/docker/src/app/api/[...route]/route.ts +2 -2
  37. package/templates/docker/src/app/globals.css +13 -12
  38. package/templates/docker/src/app/layout.tsx +9 -2
  39. package/templates/docker/src/components/ui/alert-dialog.tsx +196 -0
  40. package/templates/docker/src/components/ui/badge.tsx +48 -0
  41. package/templates/docker/src/components/ui/button.tsx +64 -0
  42. package/templates/docker/src/components/ui/card.tsx +92 -0
  43. package/templates/docker/src/components/ui/collapsible.tsx +33 -0
  44. package/templates/docker/src/components/ui/command.tsx +184 -0
  45. package/templates/docker/src/components/ui/dialog.tsx +158 -0
  46. package/templates/docker/src/components/ui/dropdown-menu.tsx +257 -0
  47. package/templates/docker/src/components/ui/input.tsx +21 -0
  48. package/templates/docker/src/components/ui/scroll-area.tsx +58 -0
  49. package/templates/docker/src/components/ui/select.tsx +190 -0
  50. package/templates/docker/src/components/ui/separator.tsx +28 -0
  51. package/templates/docker/src/components/ui/sheet.tsx +143 -0
  52. package/templates/docker/src/components/ui/sidebar.tsx +726 -0
  53. package/templates/docker/src/components/ui/skeleton.tsx +13 -0
  54. package/templates/docker/src/components/ui/table.tsx +116 -0
  55. package/templates/docker/src/components/ui/tabs.tsx +91 -0
  56. package/templates/docker/src/components/ui/toggle-group.tsx +83 -0
  57. package/templates/docker/src/components/ui/toggle.tsx +47 -0
  58. package/templates/docker/src/components/ui/tooltip.tsx +57 -0
  59. package/templates/docker/src/hooks/use-mobile.ts +19 -0
  60. package/templates/docker/src/lib/__tests__/agent-cache.test.ts +2 -0
  61. package/templates/docker/src/lib/__tests__/agent-dialect.test.ts +17 -0
  62. package/templates/docker/src/lib/__tests__/agent-health-annotations.test.ts +2 -0
  63. package/templates/docker/src/lib/__tests__/agent-integration.test.ts +2 -0
  64. package/templates/docker/src/lib/__tests__/config.test.ts +69 -19
  65. package/templates/docker/src/lib/__tests__/plugin-aware-validation.test.ts +321 -0
  66. package/templates/docker/src/lib/__tests__/providers.test.ts +32 -1
  67. package/templates/docker/src/lib/__tests__/startup-actions.test.ts +9 -0
  68. package/templates/docker/src/lib/__tests__/startup-first-run.test.ts +429 -0
  69. package/templates/docker/src/lib/__tests__/startup.test.ts +5 -0
  70. package/templates/docker/src/lib/agent-query.ts +5 -23
  71. package/templates/docker/src/lib/agent.ts +32 -112
  72. package/templates/docker/src/lib/auth/__tests__/migrate.test.ts +5 -3
  73. package/templates/docker/src/lib/auth/middleware.ts +30 -4
  74. package/templates/docker/src/lib/auth/migrate.ts +97 -0
  75. package/templates/docker/src/lib/auth/server.ts +12 -1
  76. package/templates/docker/src/lib/config.ts +37 -39
  77. package/templates/docker/src/lib/db/__tests__/connection.test.ts +89 -14
  78. package/templates/docker/src/lib/db/__tests__/registry-health.test.ts +1 -18
  79. package/templates/docker/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -19
  80. package/templates/docker/src/lib/db/__tests__/registry.test.ts +11 -208
  81. package/templates/docker/src/lib/db/connection.ts +87 -265
  82. package/templates/docker/src/lib/db/internal.ts +6 -1
  83. package/templates/docker/src/lib/plugins/__tests__/hooks-integration.test.ts +3 -1
  84. package/templates/docker/src/lib/plugins/__tests__/hooks.test.ts +2 -2
  85. package/templates/docker/src/lib/plugins/__tests__/migrate.test.ts +355 -1
  86. package/templates/docker/src/lib/plugins/__tests__/registry.test.ts +32 -5
  87. package/templates/docker/src/lib/plugins/__tests__/wiring.test.ts +228 -14
  88. package/templates/docker/src/lib/plugins/index.ts +4 -1
  89. package/templates/docker/src/lib/plugins/migrate.ts +103 -0
  90. package/templates/docker/src/lib/plugins/registry.ts +12 -6
  91. package/templates/docker/src/lib/plugins/wiring.ts +113 -4
  92. package/templates/docker/src/lib/providers.ts +6 -1
  93. package/templates/docker/src/lib/security.ts +24 -0
  94. package/templates/docker/src/lib/semantic.ts +2 -0
  95. package/templates/docker/src/lib/sidecar-types.ts +12 -1
  96. package/templates/docker/src/lib/startup.ts +71 -101
  97. package/templates/docker/src/lib/tools/__tests__/custom-validation.test.ts +2 -0
  98. package/templates/docker/src/lib/tools/__tests__/explore-nsjail.test.ts +32 -18
  99. package/templates/docker/src/lib/tools/__tests__/explore-plugin.test.ts +14 -14
  100. package/templates/docker/src/lib/tools/__tests__/explore-sidecar.test.ts +5 -3
  101. package/templates/docker/src/lib/tools/__tests__/python-nsjail.test.ts +515 -0
  102. package/templates/docker/src/lib/tools/__tests__/python-sandbox.test.ts +397 -0
  103. package/templates/docker/src/lib/tools/__tests__/python-sidecar.test.ts +365 -0
  104. package/templates/docker/src/lib/tools/__tests__/python.test.ts +331 -0
  105. package/templates/docker/src/lib/tools/__tests__/registry-actions.test.ts +1 -13
  106. package/templates/docker/src/lib/tools/__tests__/registry.test.ts +38 -31
  107. package/templates/docker/src/lib/tools/__tests__/sql-audit.test.ts +2 -0
  108. package/templates/docker/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +2 -0
  109. package/templates/docker/src/lib/tools/__tests__/sql-ratelimit.test.ts +2 -0
  110. package/templates/docker/src/lib/tools/__tests__/sql.test.ts +5 -308
  111. package/templates/docker/src/lib/tools/explore-nsjail.ts +17 -12
  112. package/templates/docker/src/lib/tools/explore-sidecar.ts +25 -0
  113. package/templates/docker/src/lib/tools/explore.ts +28 -32
  114. package/templates/docker/src/lib/tools/python-nsjail.ts +396 -0
  115. package/templates/docker/src/lib/tools/python-sandbox.ts +476 -0
  116. package/templates/docker/src/lib/tools/python-sidecar.ts +150 -0
  117. package/templates/docker/src/lib/tools/python.ts +367 -0
  118. package/templates/docker/src/lib/tools/registry.ts +49 -22
  119. package/templates/docker/src/lib/tools/sql.ts +88 -88
  120. package/templates/docker/src/types/vercel-sandbox.d.ts +7 -0
  121. package/templates/docker/src/ui/components/admin/admin-layout.tsx +77 -8
  122. package/templates/docker/src/ui/components/admin/admin-sidebar.tsx +25 -17
  123. package/templates/docker/src/ui/components/admin/change-password-dialog.tsx +128 -0
  124. package/templates/docker/src/ui/components/admin/entity-detail.tsx +3 -3
  125. package/templates/docker/src/ui/components/admin/semantic-file-tree.tsx +159 -0
  126. package/templates/docker/src/ui/components/atlas-chat.tsx +64 -12
  127. package/templates/docker/src/ui/components/chart/result-chart.tsx +25 -15
  128. package/templates/docker/src/ui/components/chat/markdown.tsx +88 -42
  129. package/templates/docker/src/ui/components/chat/python-result-card.tsx +244 -0
  130. package/templates/docker/src/ui/components/chat/sql-block.tsx +39 -15
  131. package/templates/docker/src/ui/components/chat/sql-result-card.tsx +6 -1
  132. package/templates/docker/src/ui/components/chat/tool-part.tsx +12 -3
  133. package/templates/docker/src/ui/components/chat/typing-indicator.tsx +5 -2
  134. package/templates/docker/src/ui/components/conversations/conversation-item.tsx +25 -20
  135. package/templates/docker/src/ui/context.tsx +1 -1
  136. package/templates/docker/src/ui/hooks/use-conversations.ts +3 -3
  137. package/templates/docker/src/ui/hooks/use-dark-mode.ts +17 -10
  138. package/templates/docker/tsconfig.json +2 -2
  139. package/templates/nextjs-standalone/.env.example +1 -1
  140. package/templates/nextjs-standalone/bin/__tests__/plugin-cli.test.ts +9 -9
  141. package/templates/nextjs-standalone/bin/atlas.ts +108 -44
  142. package/templates/nextjs-standalone/data/demo-semantic/catalog.yml +51 -27
  143. package/templates/nextjs-standalone/data/demo-semantic/entities/accounts.yml +95 -103
  144. package/templates/nextjs-standalone/data/demo-semantic/entities/companies.yml +88 -152
  145. package/templates/nextjs-standalone/data/demo-semantic/entities/people.yml +82 -95
  146. package/templates/nextjs-standalone/data/demo-semantic/glossary.yml +104 -8
  147. package/templates/nextjs-standalone/data/demo-semantic/metrics/accounts.yml +62 -23
  148. package/templates/nextjs-standalone/data/demo-semantic/metrics/companies.yml +52 -78
  149. package/templates/nextjs-standalone/docs/deploy.md +2 -39
  150. package/templates/nextjs-standalone/package.json +11 -2
  151. package/templates/nextjs-standalone/scripts/migrate-auth.ts +25 -0
  152. package/templates/nextjs-standalone/scripts/seed-demo.ts +94 -0
  153. package/templates/nextjs-standalone/semantic/catalog.yml +62 -3
  154. package/templates/nextjs-standalone/semantic/entities/accounts.yml +162 -0
  155. package/templates/nextjs-standalone/semantic/entities/companies.yml +143 -0
  156. package/templates/nextjs-standalone/semantic/entities/people.yml +132 -0
  157. package/templates/nextjs-standalone/semantic/glossary.yml +116 -4
  158. package/templates/nextjs-standalone/semantic/metrics/accounts.yml +77 -0
  159. package/templates/nextjs-standalone/semantic/metrics/companies.yml +63 -0
  160. package/templates/nextjs-standalone/src/api/__tests__/admin.test.ts +7 -7
  161. package/templates/nextjs-standalone/src/api/__tests__/health-plugin.test.ts +7 -0
  162. package/templates/nextjs-standalone/src/api/__tests__/health.test.ts +30 -8
  163. package/templates/nextjs-standalone/src/api/routes/admin.ts +549 -8
  164. package/templates/nextjs-standalone/src/api/routes/chat.ts +5 -20
  165. package/templates/nextjs-standalone/src/api/routes/health.ts +39 -27
  166. package/templates/nextjs-standalone/src/api/routes/openapi.ts +1329 -74
  167. package/templates/nextjs-standalone/src/api/routes/query.ts +2 -1
  168. package/templates/nextjs-standalone/src/api/server.ts +27 -0
  169. package/templates/nextjs-standalone/src/app/api/[...route]/route.ts +2 -2
  170. package/templates/nextjs-standalone/src/app/globals.css +13 -12
  171. package/templates/nextjs-standalone/src/app/layout.tsx +9 -2
  172. package/templates/nextjs-standalone/src/components/ui/alert-dialog.tsx +196 -0
  173. package/templates/nextjs-standalone/src/components/ui/badge.tsx +48 -0
  174. package/templates/nextjs-standalone/src/components/ui/button.tsx +64 -0
  175. package/templates/nextjs-standalone/src/components/ui/card.tsx +92 -0
  176. package/templates/nextjs-standalone/src/components/ui/collapsible.tsx +33 -0
  177. package/templates/nextjs-standalone/src/components/ui/command.tsx +184 -0
  178. package/templates/nextjs-standalone/src/components/ui/dialog.tsx +158 -0
  179. package/templates/nextjs-standalone/src/components/ui/dropdown-menu.tsx +257 -0
  180. package/templates/nextjs-standalone/src/components/ui/input.tsx +21 -0
  181. package/templates/nextjs-standalone/src/components/ui/scroll-area.tsx +58 -0
  182. package/templates/nextjs-standalone/src/components/ui/select.tsx +190 -0
  183. package/templates/nextjs-standalone/src/components/ui/separator.tsx +28 -0
  184. package/templates/nextjs-standalone/src/components/ui/sheet.tsx +143 -0
  185. package/templates/nextjs-standalone/src/components/ui/sidebar.tsx +726 -0
  186. package/templates/nextjs-standalone/src/components/ui/skeleton.tsx +13 -0
  187. package/templates/nextjs-standalone/src/components/ui/table.tsx +116 -0
  188. package/templates/nextjs-standalone/src/components/ui/tabs.tsx +91 -0
  189. package/templates/nextjs-standalone/src/components/ui/toggle-group.tsx +83 -0
  190. package/templates/nextjs-standalone/src/components/ui/toggle.tsx +47 -0
  191. package/templates/nextjs-standalone/src/components/ui/tooltip.tsx +57 -0
  192. package/templates/nextjs-standalone/src/hooks/use-mobile.ts +19 -0
  193. package/templates/nextjs-standalone/src/lib/__tests__/agent-cache.test.ts +2 -0
  194. package/templates/nextjs-standalone/src/lib/__tests__/agent-dialect.test.ts +17 -0
  195. package/templates/nextjs-standalone/src/lib/__tests__/agent-health-annotations.test.ts +2 -0
  196. package/templates/nextjs-standalone/src/lib/__tests__/agent-integration.test.ts +2 -0
  197. package/templates/nextjs-standalone/src/lib/__tests__/config.test.ts +69 -19
  198. package/templates/nextjs-standalone/src/lib/__tests__/plugin-aware-validation.test.ts +321 -0
  199. package/templates/nextjs-standalone/src/lib/__tests__/providers.test.ts +32 -1
  200. package/templates/nextjs-standalone/src/lib/__tests__/startup-actions.test.ts +9 -0
  201. package/templates/nextjs-standalone/src/lib/__tests__/startup-first-run.test.ts +429 -0
  202. package/templates/nextjs-standalone/src/lib/__tests__/startup.test.ts +5 -0
  203. package/templates/nextjs-standalone/src/lib/agent-query.ts +5 -23
  204. package/templates/nextjs-standalone/src/lib/agent.ts +32 -112
  205. package/templates/nextjs-standalone/src/lib/auth/__tests__/migrate.test.ts +5 -3
  206. package/templates/nextjs-standalone/src/lib/auth/middleware.ts +30 -4
  207. package/templates/nextjs-standalone/src/lib/auth/migrate.ts +97 -0
  208. package/templates/nextjs-standalone/src/lib/auth/server.ts +12 -1
  209. package/templates/nextjs-standalone/src/lib/config.ts +37 -39
  210. package/templates/nextjs-standalone/src/lib/db/__tests__/connection.test.ts +89 -14
  211. package/templates/nextjs-standalone/src/lib/db/__tests__/registry-health.test.ts +1 -18
  212. package/templates/nextjs-standalone/src/lib/db/__tests__/registry-pool-limits.test.ts +0 -19
  213. package/templates/nextjs-standalone/src/lib/db/__tests__/registry.test.ts +11 -208
  214. package/templates/nextjs-standalone/src/lib/db/connection.ts +87 -265
  215. package/templates/nextjs-standalone/src/lib/db/internal.ts +6 -1
  216. package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks-integration.test.ts +3 -1
  217. package/templates/nextjs-standalone/src/lib/plugins/__tests__/hooks.test.ts +2 -2
  218. package/templates/nextjs-standalone/src/lib/plugins/__tests__/migrate.test.ts +355 -1
  219. package/templates/nextjs-standalone/src/lib/plugins/__tests__/registry.test.ts +32 -5
  220. package/templates/nextjs-standalone/src/lib/plugins/__tests__/wiring.test.ts +228 -14
  221. package/templates/nextjs-standalone/src/lib/plugins/index.ts +4 -1
  222. package/templates/nextjs-standalone/src/lib/plugins/migrate.ts +103 -0
  223. package/templates/nextjs-standalone/src/lib/plugins/registry.ts +12 -6
  224. package/templates/nextjs-standalone/src/lib/plugins/wiring.ts +113 -4
  225. package/templates/nextjs-standalone/src/lib/providers.ts +6 -1
  226. package/templates/nextjs-standalone/src/lib/security.ts +24 -0
  227. package/templates/nextjs-standalone/src/lib/semantic.ts +2 -0
  228. package/templates/nextjs-standalone/src/lib/sidecar-types.ts +12 -1
  229. package/templates/nextjs-standalone/src/lib/startup.ts +71 -101
  230. package/templates/nextjs-standalone/src/lib/tools/__tests__/custom-validation.test.ts +2 -0
  231. package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-nsjail.test.ts +32 -18
  232. package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-plugin.test.ts +14 -14
  233. package/templates/nextjs-standalone/src/lib/tools/__tests__/explore-sidecar.test.ts +5 -3
  234. package/templates/nextjs-standalone/src/lib/tools/__tests__/python-nsjail.test.ts +515 -0
  235. package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sandbox.test.ts +397 -0
  236. package/templates/nextjs-standalone/src/lib/tools/__tests__/python-sidecar.test.ts +365 -0
  237. package/templates/nextjs-standalone/src/lib/tools/__tests__/python.test.ts +331 -0
  238. package/templates/nextjs-standalone/src/lib/tools/__tests__/registry-actions.test.ts +1 -13
  239. package/templates/nextjs-standalone/src/lib/tools/__tests__/registry.test.ts +38 -31
  240. package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-audit.test.ts +2 -0
  241. package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-connection-whitelist.test.ts +2 -0
  242. package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-ratelimit.test.ts +2 -0
  243. package/templates/nextjs-standalone/src/lib/tools/__tests__/sql.test.ts +5 -308
  244. package/templates/nextjs-standalone/src/lib/tools/explore-nsjail.ts +17 -12
  245. package/templates/nextjs-standalone/src/lib/tools/explore-sidecar.ts +25 -0
  246. package/templates/nextjs-standalone/src/lib/tools/explore.ts +28 -32
  247. package/templates/nextjs-standalone/src/lib/tools/python-nsjail.ts +396 -0
  248. package/templates/nextjs-standalone/src/lib/tools/python-sandbox.ts +476 -0
  249. package/templates/nextjs-standalone/src/lib/tools/python-sidecar.ts +150 -0
  250. package/templates/nextjs-standalone/src/lib/tools/python.ts +367 -0
  251. package/templates/nextjs-standalone/src/lib/tools/registry.ts +49 -22
  252. package/templates/nextjs-standalone/src/lib/tools/sql.ts +88 -88
  253. package/templates/nextjs-standalone/src/ui/components/admin/admin-layout.tsx +77 -8
  254. package/templates/nextjs-standalone/src/ui/components/admin/admin-sidebar.tsx +25 -17
  255. package/templates/nextjs-standalone/src/ui/components/admin/change-password-dialog.tsx +128 -0
  256. package/templates/nextjs-standalone/src/ui/components/admin/entity-detail.tsx +3 -3
  257. package/templates/nextjs-standalone/src/ui/components/admin/semantic-file-tree.tsx +159 -0
  258. package/templates/nextjs-standalone/src/ui/components/atlas-chat.tsx +64 -12
  259. package/templates/nextjs-standalone/src/ui/components/chart/result-chart.tsx +25 -15
  260. package/templates/nextjs-standalone/src/ui/components/chat/markdown.tsx +88 -42
  261. package/templates/nextjs-standalone/src/ui/components/chat/python-result-card.tsx +244 -0
  262. package/templates/nextjs-standalone/src/ui/components/chat/sql-block.tsx +39 -15
  263. package/templates/nextjs-standalone/src/ui/components/chat/sql-result-card.tsx +6 -1
  264. package/templates/nextjs-standalone/src/ui/components/chat/tool-part.tsx +12 -3
  265. package/templates/nextjs-standalone/src/ui/components/chat/typing-indicator.tsx +5 -2
  266. package/templates/nextjs-standalone/src/ui/components/conversations/conversation-item.tsx +25 -20
  267. package/templates/nextjs-standalone/src/ui/context.tsx +1 -1
  268. package/templates/nextjs-standalone/src/ui/hooks/use-conversations.ts +3 -3
  269. package/templates/nextjs-standalone/src/ui/hooks/use-dark-mode.ts +17 -10
  270. package/templates/nextjs-standalone/tsconfig.json +0 -1
  271. package/templates/nextjs-standalone/vercel.json +4 -1
  272. package/templates/docker/render.yaml +0 -34
  273. package/templates/docker/semantic/entities/.gitkeep +0 -0
  274. package/templates/docker/semantic/metrics/.gitkeep +0 -0
  275. package/templates/docker/src/lib/db/__tests__/duckdb.test.ts +0 -141
  276. package/templates/docker/src/lib/db/__tests__/salesforce.test.ts +0 -339
  277. package/templates/docker/src/lib/db/__tests__/snowflake.test.ts +0 -217
  278. package/templates/docker/src/lib/db/duckdb.ts +0 -122
  279. package/templates/docker/src/lib/db/salesforce.ts +0 -342
  280. package/templates/docker/src/lib/tools/__tests__/salesforce-tool.test.ts +0 -154
  281. package/templates/docker/src/lib/tools/__tests__/soql-validation.test.ts +0 -303
  282. package/templates/docker/src/lib/tools/__tests__/sql-duckdb.test.ts +0 -233
  283. package/templates/docker/src/lib/tools/salesforce.ts +0 -138
  284. package/templates/docker/src/lib/tools/soql-validation.ts +0 -172
  285. package/templates/nextjs-standalone/semantic/entities/.gitkeep +0 -0
  286. package/templates/nextjs-standalone/semantic/metrics/.gitkeep +0 -0
  287. package/templates/nextjs-standalone/src/lib/db/__tests__/duckdb.test.ts +0 -141
  288. package/templates/nextjs-standalone/src/lib/db/__tests__/salesforce.test.ts +0 -339
  289. package/templates/nextjs-standalone/src/lib/db/__tests__/snowflake.test.ts +0 -217
  290. package/templates/nextjs-standalone/src/lib/db/duckdb.ts +0 -122
  291. package/templates/nextjs-standalone/src/lib/db/salesforce.ts +0 -342
  292. package/templates/nextjs-standalone/src/lib/tools/__tests__/salesforce-tool.test.ts +0 -154
  293. package/templates/nextjs-standalone/src/lib/tools/__tests__/soql-validation.test.ts +0 -303
  294. package/templates/nextjs-standalone/src/lib/tools/__tests__/sql-duckdb.test.ts +0 -233
  295. package/templates/nextjs-standalone/src/lib/tools/salesforce.ts +0 -138
  296. package/templates/nextjs-standalone/src/lib/tools/soql-validation.ts +0 -172
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Deploy a text-to-SQL data analyst agent on your database in minutes. Ask natural language questions, get validated SQL and interpreted results.
4
4
 
5
- **What you get:** A self-contained project with a chat UI, multi-layer SQL validation, auto-generated semantic layer from your schema, and deploy configs for Docker, Railway, Render, and Vercel.
5
+ **What you get:** A self-contained project with a chat UI, multi-layer SQL validation, auto-generated semantic layer from your schema, and deploy configs for Docker, Railway, and Vercel.
6
6
 
7
7
  ## Quick start
8
8
 
@@ -27,7 +27,7 @@ Running `bun create @useatlas my-app` walks you through each option:
27
27
  | Prompt | Options | Default |
28
28
  |--------|---------|---------|
29
29
  | **Project name** | Any valid directory name | `my-atlas-app` |
30
- | **Platform** | Docker, Railway, Render, Vercel, Other | Docker |
30
+ | **Platform** | Docker, Railway, Vercel, Other | Docker |
31
31
  | **Sandbox** | nsjail, Sidecar, E2B, Daytona, None (only for "Other" platform) | nsjail |
32
32
  | **Database** | PostgreSQL, MySQL | PostgreSQL |
33
33
  | **Connection string** | Your database URL | `postgresql://atlas:atlas@localhost:5432/atlas` |
@@ -56,7 +56,7 @@ bun create @useatlas my-app --platform vercel
56
56
  bun create @useatlas my-app --platform railway
57
57
  ```
58
58
 
59
- Available platforms: `vercel`, `railway`, `render`, `docker`, `other`
59
+ Available platforms: `vercel`, `railway`, `docker`, `other`
60
60
 
61
61
  ## Demo datasets
62
62
 
@@ -109,20 +109,6 @@ cd my-app
109
109
  4. Set env vars on the main service: `ATLAS_PROVIDER`, provider API key, `ATLAS_DATASOURCE_URL`
110
110
  5. Set `SIDECAR_AUTH_TOKEN` on **both** services (pre-generated in `.env`)
111
111
 
112
- ### Render
113
-
114
- Uses a sidecar as a Render private service. A `render.yaml` Blueprint is included.
115
-
116
- ```bash
117
- bun create @useatlas my-app --platform render
118
- cd my-app
119
- ```
120
-
121
- 1. Push to GitHub
122
- 2. In the Render dashboard: **New > Blueprint**, select your repo
123
- 3. Set the prompted env vars: `ATLAS_DATASOURCE_URL`, provider API key
124
- 4. After deploy, update `ATLAS_SANDBOX_URL` with the sidecar's private URL
125
-
126
112
  ### Vercel
127
113
 
128
114
  Deploys as a Next.js app with the API embedded via a catch-all route. Explore tool auto-detects Vercel Sandbox (Firecracker VM isolation).
@@ -218,7 +204,7 @@ bun run lint # Lint with ESLint
218
204
 
219
205
  **Docker build fails with nsjail errors** -- nsjail requires Linux. On macOS, build with `docker build --platform linux/amd64 -t my-app .` or skip nsjail: add `--build-arg INSTALL_NSJAIL=false`.
220
206
 
221
- **"Connection refused" on Railway/Render** -- Ensure `ATLAS_DATASOURCE_URL` uses an external hostname, not `localhost`. For the sidecar, verify both services share the same `SIDECAR_AUTH_TOKEN`.
207
+ **"Connection refused" on Railway** -- Ensure `ATLAS_DATASOURCE_URL` uses an external hostname, not `localhost`. For the sidecar, verify both services share the same `SIDECAR_AUTH_TOKEN`.
222
208
 
223
209
  ## Links
224
210
 
package/index.ts CHANGED
@@ -58,7 +58,7 @@ const useDefaults = args.includes("--defaults") || args.includes("-y");
58
58
  const positionalArgs = args.filter((a) => !a.startsWith("-"));
59
59
 
60
60
  // Platform → template mapping
61
- const VALID_PLATFORMS = ["vercel", "railway", "render", "docker", "other"] as const;
61
+ const VALID_PLATFORMS = ["vercel", "railway", "docker", "other"] as const;
62
62
  type Platform = (typeof VALID_PLATFORMS)[number];
63
63
 
64
64
  const VALID_SANDBOX_CHOICES = ["nsjail", "sidecar", "e2b", "daytona", "none"] as const;
@@ -70,9 +70,180 @@ function templateForPlatform(platform: Platform): Template {
70
70
  return platform === "vercel" ? "nextjs-standalone" : "docker";
71
71
  }
72
72
 
73
- // Parse --platform flag
73
+ function generateReadme(projectName: string, platform: Platform, dbChoice: string): string {
74
+ const deployBadges: Record<Platform, string> = {
75
+ vercel: `[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?env=AI_GATEWAY_API_KEY,BETTER_AUTH_SECRET&envDescription=AI_GATEWAY_API_KEY%3A%20Vercel%20AI%20Gateway%20key%20(vercel.com%2F~%2Fai%2Fapi-keys).%20BETTER_AUTH_SECRET%3A%20Random%20string%2C%2032%2B%20chars%20(openssl%20rand%20-base64%2032).&project-name=${projectName})`,
76
+ railway: `[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/_XHuNP?referralCode=N5vD3S)`,
77
+ docker: "",
78
+ other: "",
79
+ };
80
+ const deployBadge = deployBadges[platform];
81
+
82
+ const localDesc = platform === "vercel"
83
+ ? "Open [http://localhost:3000](http://localhost:3000)."
84
+ : "API at [http://localhost:3000](http://localhost:3000).";
85
+
86
+ const localQuickStart = `## Quick Start
87
+
88
+ 1. **Install dependencies:**
89
+ \`\`\`bash
90
+ bun install
91
+ \`\`\`
92
+
93
+ 2. **Configure environment:** Edit \`.env\` with your API key and database URL.
94
+
95
+ 3. **Generate semantic layer:**
96
+ \`\`\`bash
97
+ bun run atlas -- init # From your database
98
+ bun run atlas -- init --demo # Or load demo data
99
+ \`\`\`
100
+
101
+ 4. **Run locally:**
102
+ \`\`\`bash
103
+ bun run dev
104
+ \`\`\`
105
+ ${localDesc}`;
106
+
107
+ const deploySections: Record<Platform, string> = {
108
+ vercel: `## Deploy to Vercel
109
+
110
+ 1. Push to GitHub:
111
+ \`\`\`bash
112
+ git init && git add -A && git commit -m "Initial commit"
113
+ gh repo create ${projectName} --public --source=. --push
114
+ \`\`\`
115
+
116
+ 2. Import in the [Vercel Dashboard](https://vercel.com/new) and set environment variables:
117
+ - \`ATLAS_PROVIDER\` — \`anthropic\` (or \`gateway\` for Vercel AI Gateway)
118
+ - \`ANTHROPIC_API_KEY\` — Your API key
119
+ - \`ATLAS_DATASOURCE_URL\` — Your analytics database (\`postgresql://...\`)
120
+ - \`DATABASE_URL\` — Atlas internal Postgres (auth, audit)
121
+
122
+ 3. Deploy. Vercel auto-detects \`@vercel/sandbox\` for secure explore isolation.`,
123
+
124
+ railway: `## Deploy to Railway
125
+
126
+ 1. Push to GitHub:
127
+ \`\`\`bash
128
+ git init && git add -A && git commit -m "Initial commit"
129
+ gh repo create ${projectName} --public --source=. --push
130
+ \`\`\`
131
+
132
+ 2. Create a [Railway project](https://railway.app/) and add a **Postgres** plugin (auto-sets \`DATABASE_URL\`).
133
+
134
+ 3. Add two services from your GitHub repo:
135
+ - **API** — Root directory, uses \`railway.json\` + \`Dockerfile\`
136
+ - **Sidecar** — \`sidecar/\` directory, uses \`sidecar/Dockerfile\`
137
+
138
+ 4. Set environment variables on the API service:
139
+ \`\`\`
140
+ ATLAS_PROVIDER=anthropic
141
+ ANTHROPIC_API_KEY=sk-ant-...
142
+ ATLAS_DATASOURCE_URL=postgresql://...
143
+ ATLAS_SANDBOX_URL=http://sidecar.railway.internal:8080
144
+ SIDECAR_AUTH_TOKEN=<shared-secret>
145
+ \`\`\`
146
+ Set \`SIDECAR_AUTH_TOKEN\` on the sidecar service too.
147
+
148
+ 5. Deploy. Railway builds from the Dockerfile and runs health checks automatically.`,
149
+
150
+ docker: `## Deploy with Docker
151
+
152
+ 1. Build the image (includes nsjail for explore isolation):
153
+ \`\`\`bash
154
+ docker build -t ${projectName} .
155
+ \`\`\`
156
+
157
+ 2. Run:
158
+ \`\`\`bash
159
+ docker run -p 3000:3000 \\
160
+ -e ATLAS_PROVIDER=anthropic \\
161
+ -e ANTHROPIC_API_KEY=sk-ant-... \\
162
+ -e ATLAS_DATASOURCE_URL=postgresql://... \\
163
+ ${projectName}
164
+ \`\`\`
165
+
166
+ 3. To build without nsjail (smaller image, dev only):
167
+ \`\`\`bash
168
+ docker build --build-arg INSTALL_NSJAIL=false -t ${projectName} .
169
+ \`\`\``,
170
+
171
+ other: `## Deploy
172
+
173
+ Build and deploy the Docker image to your platform of choice. See \`docs/deploy.md\` for detailed guides.`,
174
+ };
175
+
176
+ const dbNote = dbChoice === "mysql"
177
+ ? "This project is configured for **MySQL**."
178
+ : "This project is configured for **PostgreSQL**.";
179
+
180
+ const badgeLine = deployBadge ? `${deployBadge}\n\n` : "";
181
+
182
+ return `# ${projectName}
183
+
184
+ A text-to-SQL data analyst agent powered by [Atlas](https://useatlas.dev).
185
+
186
+ ${badgeLine}${dbNote} Ask natural-language questions, and the agent explores a semantic layer, writes validated SQL, and returns interpreted results.
187
+
188
+ ${localQuickStart}
189
+
190
+ ${deploySections[platform]}
191
+
192
+ ## Project Structure
193
+
194
+ \`\`\`
195
+ ${projectName}/
196
+ ├── src/ # Application source (API + UI)
197
+ ├── bin/ # CLI tools (atlas init, enrich, eval)
198
+ ├── data/ # Demo datasets (SQL seed files)
199
+ ├── semantic/ # Semantic layer (YAML — entities, metrics, glossary)
200
+ ├── .env # Environment configuration
201
+ └── docs/deploy.md # Full deployment guide
202
+ \`\`\`
203
+
204
+ ## Commands
205
+
206
+ | Command | Description |
207
+ |---------|-------------|
208
+ | \`bun run dev\` | Start dev server |
209
+ | \`bun run build\` | Production build |
210
+ | \`bun run start\` | Start production server |
211
+ | \`bun run atlas -- init\` | Generate semantic layer from database |
212
+ | \`bun run atlas -- init --demo\` | Load simple demo dataset |
213
+ | \`bun run atlas -- init --demo cybersec\` | Load cybersec demo (62 tables) |
214
+ | \`bun run atlas -- diff\` | Compare DB schema vs semantic layer |
215
+ | \`bun run atlas -- query "question"\` | Headless query (table output) |
216
+ | \`bun run test\` | Run tests |
217
+
218
+ ## Environment Variables
219
+
220
+ | Variable | Required | Description |
221
+ |----------|----------|-------------|
222
+ | \`ATLAS_PROVIDER\` | Yes | LLM provider (\`anthropic\`, \`openai\`, \`bedrock\`, \`ollama\`, \`gateway\`) |
223
+ | Provider API key | Yes | e.g. \`ANTHROPIC_API_KEY=sk-ant-...\` |
224
+ | \`ATLAS_DATASOURCE_URL\` | Yes | Analytics database connection string |
225
+ | \`DATABASE_URL\` | No | Atlas internal Postgres (auth, audit). Auto-set on most platforms |
226
+ | \`ATLAS_MODEL\` | No | Override the default LLM model |
227
+ | \`ATLAS_ROW_LIMIT\` | No | Max rows per query (default: 1000) |
228
+
229
+ See \`docs/deploy.md\` for the full variable reference.
230
+
231
+ ## Learn More
232
+
233
+ - [Atlas Documentation](https://useatlas.dev)
234
+ - [GitHub](https://github.com/AtlasDevHQ/atlas)
235
+ `;
236
+ }
237
+
238
+ // Parse --platform / --preset flag (--preset is an alias)
74
239
  let platformFlag: Platform | undefined;
75
- const platformIdx = args.indexOf("--platform");
240
+ const platformArgIdx = args.indexOf("--platform");
241
+ const presetArgIdx = args.indexOf("--preset");
242
+ if (platformArgIdx !== -1 && presetArgIdx !== -1) {
243
+ console.error("Cannot use both --platform and --preset. They are aliases — pick one.");
244
+ process.exit(1);
245
+ }
246
+ const platformIdx = Math.max(platformArgIdx, presetArgIdx);
76
247
  if (platformIdx !== -1) {
77
248
  const val = args[platformIdx + 1];
78
249
  if (!val || val.startsWith("-")) {
@@ -93,32 +264,32 @@ if (args.includes("--help") || args.includes("-h")) {
93
264
 
94
265
  Options:
95
266
  --platform <name> Deploy target (${VALID_PLATFORMS.join(", ")}) [default: docker]
267
+ --preset <name> Alias for --platform
96
268
  --defaults, -y Use all default values (non-interactive)
97
269
  --help, -h Show this help message
98
270
 
99
271
  Platforms:
100
272
  vercel Next.js + embedded API — auto-detects Vercel sandbox
101
273
  railway Hono API + Docker — sidecar sandbox (internal networking)
102
- render Hono API + Docker — sidecar sandbox (private service)
103
274
  docker Hono API + Docker — nsjail sandbox (built into image)
104
275
  other Hono API + Docker — choose sandbox: nsjail, sidecar, E2B, Daytona, or none
105
276
 
106
277
  Examples:
107
278
  bun create @useatlas my-app
108
279
  bun create @useatlas my-app --platform vercel
109
- bun create @useatlas my-app --platform railway
280
+ bun create @useatlas my-app --preset railway
110
281
  bun create @useatlas my-app --defaults
111
282
  `);
112
283
  process.exit(0);
113
284
  }
114
285
 
115
286
  // Reject unknown flags
116
- const knownFlags = new Set(["--defaults", "-y", "--help", "-h", "--platform"]);
287
+ const knownFlags = new Set(["--defaults", "-y", "--help", "-h", "--platform", "--preset"]);
117
288
  const unknownFlags = args.filter((a, i) => {
118
289
  if (!a.startsWith("-")) return false;
119
290
  if (knownFlags.has(a)) return false;
120
- // --platform's value argument
121
- if (i > 0 && args[i - 1] === "--platform") return false;
291
+ // --platform/--preset value argument
292
+ if (i > 0 && (args[i - 1] === "--platform" || args[i - 1] === "--preset")) return false;
122
293
  return true;
123
294
  });
124
295
  if (unknownFlags.length > 0) {
@@ -221,7 +392,6 @@ async function main() {
221
392
  options: [
222
393
  { value: "docker", label: "Docker", hint: "nsjail sandbox built into image (default)" },
223
394
  { value: "railway", label: "Railway", hint: "Sidecar sandbox via internal networking" },
224
- { value: "render", label: "Render", hint: "Sidecar sandbox via private service" },
225
395
  { value: "vercel", label: "Vercel", hint: "Next.js + embedded API — auto-detected sandbox" },
226
396
  { value: "other", label: "Other", hint: "Choose your sandbox backend" },
227
397
  ],
@@ -539,14 +709,11 @@ async function main() {
539
709
 
540
710
  // Remove platform-irrelevant files from the docker template
541
711
  if (template === "docker") {
542
- const needsSidecar = platform === "railway" || platform === "render" ||
712
+ const needsSidecar = platform === "railway" ||
543
713
  (platform === "other" && sandboxChoice === "sidecar");
544
714
  if (!needsSidecar) {
545
715
  fs.rmSync(path.join(targetDir, "sidecar"), { recursive: true, force: true });
546
716
  }
547
- if (platform !== "render") {
548
- fs.rmSync(path.join(targetDir, "render.yaml"), { force: true });
549
- }
550
717
  if (platform !== "railway") {
551
718
  fs.rmSync(path.join(targetDir, "railway.json"), { force: true });
552
719
  }
@@ -556,7 +723,6 @@ async function main() {
556
723
 
557
724
  // Replace %PROJECT_NAME% in templated files (only files that exist in the template)
558
725
  const filesToReplace = ["package.json"];
559
- if (platform === "render") filesToReplace.push("render.yaml");
560
726
  for (const file of filesToReplace) {
561
727
  const filePath = path.join(targetDir, file);
562
728
  if (!fs.existsSync(filePath)) continue; // not all templates have every file
@@ -568,6 +734,14 @@ async function main() {
568
734
  fs.writeFileSync(filePath, replaced);
569
735
  }
570
736
 
737
+ // Write platform-specific README
738
+ try {
739
+ const readme = generateReadme(projectName, platform, dbChoice);
740
+ fs.writeFileSync(path.join(targetDir, "README.md"), readme);
741
+ } catch (err) {
742
+ p.log.warn(`Could not write README.md: ${err instanceof Error ? err.message : String(err)}`);
743
+ }
744
+
571
745
  s.stop("Project files copied.");
572
746
 
573
747
  // Track partial failures — we continue scaffolding but warn at the end
@@ -618,14 +792,6 @@ async function main() {
618
792
  envContent += `SIDECAR_AUTH_TOKEN=${sidecarToken}\n`;
619
793
  break;
620
794
  }
621
- case "render": {
622
- const sidecarToken = crypto.randomUUID();
623
- envContent += `\n# Explore Sandbox (sidecar)\n`;
624
- envContent += `# Deploy sidecar/ as a Render private service, then update the URL below.\n`;
625
- envContent += `# ATLAS_SANDBOX_URL=http://<sidecar-private-url>:8080 # Update after deploying sidecar\n`;
626
- envContent += `SIDECAR_AUTH_TOKEN=${sidecarToken}\n`;
627
- break;
628
- }
629
795
  case "docker":
630
796
  envContent += `\n# Explore Sandbox (nsjail — built into Docker image)\n`;
631
797
  envContent += `ATLAS_SANDBOX=nsjail\n`;
@@ -674,8 +840,8 @@ async function main() {
674
840
  // Generate atlas.config.ts for plugin-based sandboxes (E2B, Daytona)
675
841
  if (platform === "other" && (sandboxChoice === "e2b" || sandboxChoice === "daytona")) {
676
842
  const pluginPkg = sandboxChoice === "e2b"
677
- ? "@atlas/plugin-e2b-sandbox"
678
- : "@atlas/plugin-daytona-sandbox";
843
+ ? "@useatlas/e2b"
844
+ : "@useatlas/daytona";
679
845
  const pluginExport = sandboxChoice === "e2b"
680
846
  ? "e2bSandboxPlugin"
681
847
  : "daytonaSandboxPlugin";
@@ -791,12 +957,6 @@ export default defineConfig({
791
957
  "Set SIDECAR_AUTH_TOKEN on both. Internal networking is pre-configured."
792
958
  );
793
959
  break;
794
- case "render":
795
- noteBody += "\n\n" + pc.dim(
796
- "Deploy: push to GitHub → New > Blueprint.\n" +
797
- "Set SIDECAR_AUTH_TOKEN on both services. Update ATLAS_SANDBOX_URL with the sidecar private URL."
798
- );
799
- break;
800
960
  case "docker":
801
961
  noteBody += "\n\n" + pc.dim(
802
962
  "Deploy: docker build -f Dockerfile -t atlas . && docker run -p 3001:3001 atlas\n" +
@@ -807,7 +967,7 @@ export default defineConfig({
807
967
  if (sandboxChoice === "sidecar") {
808
968
  noteBody += "\n\n" + pc.dim("Deploy sidecar/ as a separate service. Set SIDECAR_AUTH_TOKEN on both.");
809
969
  } else if (sandboxChoice === "e2b" || sandboxChoice === "daytona") {
810
- noteBody += "\n\n" + pc.dim(`Install ${sandboxChoice === "e2b" ? "@atlas/plugin-e2b-sandbox" : "@atlas/plugin-daytona-sandbox"} when available.`);
970
+ noteBody += "\n\n" + pc.dim(`Install ${sandboxChoice === "e2b" ? "@useatlas/e2b" : "@useatlas/daytona"} when available.`);
811
971
  }
812
972
  break;
813
973
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useatlas/create",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Create a new Atlas text-to-SQL agent project",
5
5
  "bin": {
6
6
  "create-useatlas": "./index.ts"
@@ -46,7 +46,7 @@
46
46
  # ATLAS_QUERY_TIMEOUT=30000 # Default: 30s in milliseconds
47
47
 
48
48
  # === Production Deployment ===
49
- # Required for production (Railway, Render, etc.):
49
+ # Required for production (Railway, etc.):
50
50
  # ATLAS_PROVIDER + its API key (e.g. ANTHROPIC_API_KEY)
51
51
  # ATLAS_DATASOURCE_URL=postgresql://user:pass@host:5432/dbname
52
52
  #
@@ -54,9 +54,9 @@
54
54
  # ATLAS_MODEL, ATLAS_ROW_LIMIT, ATLAS_QUERY_TIMEOUT
55
55
  # PORT (set automatically by most platforms)
56
56
 
57
- # === Explore Sandbox (Railway / Render) ===
57
+ # === Explore Sandbox (Railway) ===
58
58
  # The sidecar provides isolated shell execution for the explore tool on platforms
59
- # where nsjail can't run (Railway, Render). Deploy it as a second service.
59
+ # where nsjail can't run (Railway). Deploy it as a second service.
60
60
  # ATLAS_SANDBOX_URL=http://sidecar.railway.internal:8080 # Railway private networking
61
61
  # SIDECAR_AUTH_TOKEN= # Shared secret — set on both services
62
62
 
@@ -0,0 +1,28 @@
1
+ FROM oven/bun:1.3.10-debian AS base
2
+
3
+ # Install only the tools needed for explore mode
4
+ RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ bash coreutils grep findutils tree \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ RUN useradd -r -s /bin/false sandbox || true
9
+
10
+ WORKDIR /app
11
+
12
+ # Copy sidecar source
13
+ COPY sidecar/server.ts ./server.ts
14
+
15
+ # Semantic layer from project root
16
+ COPY semantic/ /semantic/
17
+ RUN chmod -R a-w /semantic/
18
+
19
+ # Keep this image minimal — adding packages or env vars weakens the isolation model
20
+
21
+ # No secrets, no database drivers, no node_modules beyond bun runtime
22
+ EXPOSE 8080
23
+ ENV PORT=8080
24
+ ENV SEMANTIC_DIR=/semantic
25
+
26
+ USER sandbox
27
+
28
+ CMD ["bun", "run", "server.ts"]
@@ -19,7 +19,7 @@ describe("pluginTemplate", () => {
19
19
  const result = pluginTemplate("my-source", "datasource");
20
20
  expect(result).toContain('import { definePlugin } from "@useatlas/plugin-sdk"');
21
21
  expect(result).toContain('id: "my-source"');
22
- expect(result).toContain('type: "datasource"');
22
+ expect(result).toContain('types: ["datasource"]');
23
23
  expect(result).toContain("satisfies AtlasDatasourcePlugin");
24
24
  expect(result).toContain("connection:");
25
25
  expect(result).toContain("dbType:");
@@ -28,7 +28,7 @@ describe("pluginTemplate", () => {
28
28
  test("generates context template with contextProvider", () => {
29
29
  const result = pluginTemplate("my-ctx", "context");
30
30
  expect(result).toContain('id: "my-ctx"');
31
- expect(result).toContain('type: "context"');
31
+ expect(result).toContain('types: ["context"]');
32
32
  expect(result).toContain("contextProvider:");
33
33
  expect(result).toContain("satisfies AtlasContextPlugin");
34
34
  });
@@ -36,7 +36,7 @@ describe("pluginTemplate", () => {
36
36
  test("generates interaction template with routes", () => {
37
37
  const result = pluginTemplate("my-interaction", "interaction");
38
38
  expect(result).toContain('id: "my-interaction"');
39
- expect(result).toContain('type: "interaction"');
39
+ expect(result).toContain('types: ["interaction"]');
40
40
  expect(result).toContain("routes(app:");
41
41
  expect(result).toContain("satisfies AtlasInteractionPlugin");
42
42
  });
@@ -44,7 +44,7 @@ describe("pluginTemplate", () => {
44
44
  test("generates action template with actions array", () => {
45
45
  const result = pluginTemplate("my-action", "action");
46
46
  expect(result).toContain('id: "my-action"');
47
- expect(result).toContain('type: "action"');
47
+ expect(result).toContain('types: ["action"]');
48
48
  expect(result).toContain("actions:");
49
49
  expect(result).toContain("satisfies AtlasActionPlugin");
50
50
  expect(result).toContain('import { tool } from "ai"');
@@ -60,7 +60,7 @@ describe("pluginTestTemplate", () => {
60
60
  test("generates test with correct plugin id assertion", () => {
61
61
  const result = pluginTestTemplate("test-plugin", "datasource");
62
62
  expect(result).toContain('expect(plugin.id).toBe("test-plugin")');
63
- expect(result).toContain('expect(plugin.type).toBe("datasource")');
63
+ expect(result).toContain('expect(plugin.types).toContain("datasource")');
64
64
  expect(result).toContain("healthCheck");
65
65
  });
66
66
  });
@@ -125,7 +125,7 @@ describe("handlePluginCreate", () => {
125
125
  expect(fs.existsSync(path.join(pluginDir, "tsconfig.json"))).toBe(true);
126
126
 
127
127
  const indexContent = fs.readFileSync(path.join(pluginDir, "src", "index.ts"), "utf-8");
128
- expect(indexContent).toContain('type: "datasource"');
128
+ expect(indexContent).toContain('types: ["datasource"]');
129
129
  expect(indexContent).toContain('id: "test-ds"');
130
130
 
131
131
  const pkgJson = JSON.parse(fs.readFileSync(path.join(pluginDir, "package.json"), "utf-8"));
@@ -139,7 +139,7 @@ describe("handlePluginCreate", () => {
139
139
  expect(fs.existsSync(path.join(pluginDir, "src", "index.ts"))).toBe(true);
140
140
 
141
141
  const indexContent = fs.readFileSync(path.join(pluginDir, "src", "index.ts"), "utf-8");
142
- expect(indexContent).toContain('type: "action"');
142
+ expect(indexContent).toContain('types: ["action"]');
143
143
  expect(indexContent).toContain("actions:");
144
144
  });
145
145
 
@@ -148,7 +148,7 @@ describe("handlePluginCreate", () => {
148
148
 
149
149
  const pluginDir = path.join(tmpDir, "plugins", "my-ctx");
150
150
  const indexContent = fs.readFileSync(path.join(pluginDir, "src", "index.ts"), "utf-8");
151
- expect(indexContent).toContain('type: "context"');
151
+ expect(indexContent).toContain('types: ["context"]');
152
152
  expect(indexContent).toContain("contextProvider:");
153
153
  });
154
154
 
@@ -157,7 +157,7 @@ describe("handlePluginCreate", () => {
157
157
 
158
158
  const pluginDir = path.join(tmpDir, "plugins", "my-web");
159
159
  const indexContent = fs.readFileSync(path.join(pluginDir, "src", "index.ts"), "utf-8");
160
- expect(indexContent).toContain('type: "interaction"');
160
+ expect(indexContent).toContain('types: ["interaction"]');
161
161
  expect(indexContent).toContain("routes(app:");
162
162
  });
163
163