fimo 0.0.0 → 0.2.1-experimental.1781864090656

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 (376) hide show
  1. package/README.md +344 -0
  2. package/assets/agent-templates/_default/GOAL.md +11 -0
  3. package/assets/agent-templates/_default/config.yaml +4 -0
  4. package/assets/agent-templates/broken-link-sweeper/GOAL.md +51 -0
  5. package/assets/agent-templates/broken-link-sweeper/capabilities.yaml +6 -0
  6. package/assets/agent-templates/broken-link-sweeper/config.yaml +12 -0
  7. package/assets/agent-templates/content-translator/GOAL.md +37 -0
  8. package/assets/agent-templates/content-translator/capabilities.yaml +10 -0
  9. package/assets/agent-templates/content-translator/config.yaml +11 -0
  10. package/assets/agent-templates/content-translator/scripts/translate-entries.ts +66 -0
  11. package/assets/agent-templates/content-translator/scripts/write-locale-files.ts +66 -0
  12. package/assets/agent-templates/post-deploy-check/GOAL.md +23 -0
  13. package/assets/agent-templates/post-deploy-check/capabilities.yaml +2 -0
  14. package/assets/agent-templates/post-deploy-check/config.yaml +9 -0
  15. package/assets/agent-templates/post-deploy-check/scripts/check-logs.ts +39 -0
  16. package/assets/agent-templates/post-deploy-check/scripts/probe-routes.ts +53 -0
  17. package/assets/agent-templates/seo-audit/GOAL.md +39 -0
  18. package/assets/agent-templates/seo-audit/capabilities.yaml +5 -0
  19. package/assets/agent-templates/seo-audit/config.yaml +13 -0
  20. package/assets/agent-templates/seo-audit/references/report-template.md +28 -0
  21. package/assets/agent-templates/seo-audit/references/scoring-methodology.md +30 -0
  22. package/assets/agent-templates/seo-audit/scripts/analyze-html.ts +82 -0
  23. package/assets/agent-templates/seo-audit/scripts/fetch-page.ts +39 -0
  24. package/assets/agent-templates/seo-audit/scripts/list-routes.ts +46 -0
  25. package/assets/agent-templates/seo-audit/scripts/report.ts +82 -0
  26. package/assets/agent-templates/seo-audit/scripts/score.ts +131 -0
  27. package/assets/agents-starter/AGENTS.md +54 -0
  28. package/assets/agents-starter/claude/settings.json +19 -0
  29. package/assets/content-templates/form-template.eta +188 -0
  30. package/assets/content-templates/hooks-template.eta +315 -0
  31. package/assets/legal-templates/privacy.eta +64 -0
  32. package/assets/legal-templates/terms.eta +41 -0
  33. package/assets/skills/fimo/SKILL.md +65 -0
  34. package/assets/skills/fimo/references/assets.md +68 -0
  35. package/assets/skills/fimo/references/content.md +261 -0
  36. package/assets/skills/fimo/references/design.md +142 -0
  37. package/assets/skills/fimo/references/forms.md +106 -0
  38. package/assets/skills/fimo/references/setup-plain-vite.md +218 -0
  39. package/assets/skills/fimo/references/setup-react-router.md +257 -0
  40. package/assets/skills/fimo/references/translations.md +75 -0
  41. package/assets/skills/fimo/references/ui.md +86 -0
  42. package/assets/skills/fimo-cli/SKILL.md +115 -0
  43. package/assets/skills/fimo-cli/references/account.md +49 -0
  44. package/assets/skills/fimo-cli/references/agent-setup.md +120 -0
  45. package/assets/skills/fimo-cli/references/agents.md +84 -0
  46. package/assets/skills/fimo-cli/references/analytics.md +62 -0
  47. package/assets/skills/fimo-cli/references/assets.md +147 -0
  48. package/assets/skills/fimo-cli/references/branches.md +106 -0
  49. package/assets/skills/fimo-cli/references/content.md +82 -0
  50. package/assets/skills/fimo-cli/references/create.md +90 -0
  51. package/assets/skills/fimo-cli/references/credits.md +84 -0
  52. package/assets/skills/fimo-cli/references/deploy.md +101 -0
  53. package/assets/skills/fimo-cli/references/describe.md +79 -0
  54. package/assets/skills/fimo-cli/references/domains.md +139 -0
  55. package/assets/skills/fimo-cli/references/forms.md +67 -0
  56. package/assets/skills/fimo-cli/references/integrations/firecrawl.md +224 -0
  57. package/assets/skills/fimo-cli/references/integrations.md +106 -0
  58. package/assets/skills/fimo-cli/references/invite.md +94 -0
  59. package/assets/skills/fimo-cli/references/media.md +179 -0
  60. package/assets/skills/fimo-cli/references/preview.md +53 -0
  61. package/assets/skills/fimo-cli/references/project-vars-and-secrets.md +68 -0
  62. package/assets/skills/fimo-cli/references/projects.md +42 -0
  63. package/assets/skills/fimo-cli/references/translations.md +43 -0
  64. package/assets/skills/fimo-migration/SKILL.md +138 -0
  65. package/assets/skills/fimo-migration/agents/openai.yaml +4 -0
  66. package/assets/skills/fimo-migration/references/content.md +61 -0
  67. package/assets/skills/fimo-migration/references/forms.md +54 -0
  68. package/assets/skills/fimo-migration/references/import-contract.md +102 -0
  69. package/assets/skills/fimo-migration/references/manifest.md +160 -0
  70. package/assets/skills/fimo-migration/references/media.md +65 -0
  71. package/assets/skills/fimo-migration/references/platforms.md +54 -0
  72. package/assets/skills/fimo-migration/references/qa.md +91 -0
  73. package/assets/skills/fimo-migration/references/workflow.md +173 -0
  74. package/assets/skills/fimo-migration/scripts/build-canonical-manifest.mjs +560 -0
  75. package/assets/skills/fimo-migration/scripts/write-migration-report.mjs +462 -0
  76. package/assets/skills/fimo-studio/SKILL.md +59 -0
  77. package/assets/skills/fimo-studio/references/ai-chat.md +54 -0
  78. package/assets/skills/fimo-studio/references/billing-and-credits.md +43 -0
  79. package/assets/skills/fimo-studio/references/cms.md +66 -0
  80. package/assets/skills/fimo-studio/references/code-editor.md +65 -0
  81. package/assets/skills/fimo-studio/references/custom-domains.md +52 -0
  82. package/assets/skills/fimo-studio/references/drawing-and-wireframing.md +63 -0
  83. package/assets/skills/fimo-studio/references/media-library.md +65 -0
  84. package/assets/skills/fimo-studio/references/preview-and-responsive.md +50 -0
  85. package/assets/skills/fimo-studio/references/project-creation.md +24 -0
  86. package/assets/skills/fimo-studio/references/publish-and-deploy.md +38 -0
  87. package/assets/skills/fimo-studio/references/seo-settings.md +31 -0
  88. package/assets/skills/fimo-studio/references/sharing-and-collaboration.md +36 -0
  89. package/assets/skills/fimo-studio/references/version-history.md +42 -0
  90. package/assets/skills/fimo-studio/references/visual-editing.md +35 -0
  91. package/dist/build/vite/index.d.ts +32 -0
  92. package/dist/build/vite/index.d.ts.map +1 -0
  93. package/dist/build/vite/index.js +90 -0
  94. package/dist/build/vite/plugins/content-sync.d.ts +13 -0
  95. package/dist/build/vite/plugins/content-sync.d.ts.map +1 -0
  96. package/dist/build/vite/plugins/content-sync.js +50 -0
  97. package/dist/build/vite/plugins/data-id.d.ts +3 -0
  98. package/dist/build/vite/plugins/data-id.d.ts.map +1 -0
  99. package/dist/build/vite/plugins/data-id.js +104 -0
  100. package/dist/build/vite/plugins/fimo-config.d.ts +12 -0
  101. package/dist/build/vite/plugins/fimo-config.d.ts.map +1 -0
  102. package/dist/build/vite/plugins/fimo-config.js +52 -0
  103. package/dist/build/vite/plugins/overlay.d.ts +3 -0
  104. package/dist/build/vite/plugins/overlay.d.ts.map +1 -0
  105. package/dist/build/vite/plugins/overlay.js +154 -0
  106. package/dist/build/vite/plugins/robots.d.ts +10 -0
  107. package/dist/build/vite/plugins/robots.d.ts.map +1 -0
  108. package/dist/build/vite/plugins/robots.js +56 -0
  109. package/dist/build/vite/plugins/seo.d.ts +3 -0
  110. package/dist/build/vite/plugins/seo.d.ts.map +1 -0
  111. package/dist/build/vite/plugins/seo.js +112 -0
  112. package/dist/build/vite/plugins/server-config.d.ts +3 -0
  113. package/dist/build/vite/plugins/server-config.d.ts.map +1 -0
  114. package/dist/build/vite/plugins/server-config.js +23 -0
  115. package/dist/build/vite/plugins/sitemap.d.ts +3 -0
  116. package/dist/build/vite/plugins/sitemap.d.ts.map +1 -0
  117. package/dist/build/vite/plugins/sitemap.js +73 -0
  118. package/dist/build/vite/plugins/translations.d.ts +9 -0
  119. package/dist/build/vite/plugins/translations.d.ts.map +1 -0
  120. package/dist/build/vite/plugins/translations.js +61 -0
  121. package/dist/cli/bundle.json +10 -0
  122. package/dist/cli/index.js +106724 -0
  123. package/dist/runtime/app/FimoProviders.d.ts +16 -0
  124. package/dist/runtime/app/FimoProviders.d.ts.map +1 -0
  125. package/dist/runtime/app/FimoProviders.js +75 -0
  126. package/dist/runtime/app/FimoScripts.d.ts +14 -0
  127. package/dist/runtime/app/FimoScripts.d.ts.map +1 -0
  128. package/dist/runtime/app/FimoScripts.js +48 -0
  129. package/dist/runtime/app/index.d.ts +4 -0
  130. package/dist/runtime/app/index.d.ts.map +1 -0
  131. package/dist/runtime/app/index.js +2 -0
  132. package/dist/runtime/app/prefetch.d.ts +6 -0
  133. package/dist/runtime/app/prefetch.d.ts.map +1 -0
  134. package/dist/runtime/app/prefetch.js +74 -0
  135. package/dist/runtime/content/DataSourcesProvider.d.ts +4 -0
  136. package/dist/runtime/content/DataSourcesProvider.d.ts.map +1 -0
  137. package/dist/runtime/content/DataSourcesProvider.js +63 -0
  138. package/dist/runtime/content/RefreshContentProvider.d.ts +3 -0
  139. package/dist/runtime/content/RefreshContentProvider.d.ts.map +1 -0
  140. package/dist/runtime/content/RefreshContentProvider.js +22 -0
  141. package/dist/runtime/content/utils/retrieve-data-sources.d.ts +15 -0
  142. package/dist/runtime/content/utils/retrieve-data-sources.d.ts.map +1 -0
  143. package/dist/runtime/content/utils/retrieve-data-sources.js +70 -0
  144. package/dist/runtime/core/AppErrorBoundary.d.ts +10 -0
  145. package/dist/runtime/core/AppErrorBoundary.d.ts.map +1 -0
  146. package/dist/runtime/core/AppErrorBoundary.js +27 -0
  147. package/dist/runtime/core/ViteLifecycles.d.ts +5 -0
  148. package/dist/runtime/core/ViteLifecycles.d.ts.map +1 -0
  149. package/dist/runtime/core/ViteLifecycles.js +31 -0
  150. package/dist/runtime/iframe/ConsoleErrorProvider.d.ts +3 -0
  151. package/dist/runtime/iframe/ConsoleErrorProvider.d.ts.map +1 -0
  152. package/dist/runtime/iframe/ConsoleErrorProvider.js +103 -0
  153. package/dist/runtime/iframe/ScreenshotProvider.d.ts +3 -0
  154. package/dist/runtime/iframe/ScreenshotProvider.d.ts.map +1 -0
  155. package/dist/runtime/iframe/ScreenshotProvider.js +60 -0
  156. package/dist/runtime/iframe/runtime/overlay-hmr.d.ts +2 -0
  157. package/dist/runtime/iframe/runtime/overlay-hmr.d.ts.map +1 -0
  158. package/dist/runtime/iframe/runtime/overlay-hmr.js +24 -0
  159. package/dist/runtime/iframe/runtime/overlay-runtime.d.ts +2 -0
  160. package/dist/runtime/iframe/runtime/overlay-runtime.d.ts.map +1 -0
  161. package/dist/runtime/iframe/runtime/overlay-runtime.js +103 -0
  162. package/dist/runtime/index.d.ts +11 -0
  163. package/dist/runtime/index.d.ts.map +1 -0
  164. package/dist/runtime/index.js +14 -0
  165. package/dist/runtime/paths/get-fimo-paths.d.ts +31 -0
  166. package/dist/runtime/paths/get-fimo-paths.d.ts.map +1 -0
  167. package/dist/runtime/paths/get-fimo-paths.js +164 -0
  168. package/dist/runtime/paths/index.d.ts +3 -0
  169. package/dist/runtime/paths/index.d.ts.map +1 -0
  170. package/dist/runtime/paths/index.js +1 -0
  171. package/dist/runtime/paths/types.d.ts +28 -0
  172. package/dist/runtime/paths/types.d.ts.map +1 -0
  173. package/dist/runtime/paths/types.js +1 -0
  174. package/dist/runtime/primitives/components/Boolean.d.ts +29 -0
  175. package/dist/runtime/primitives/components/Boolean.d.ts.map +1 -0
  176. package/dist/runtime/primitives/components/Boolean.js +33 -0
  177. package/dist/runtime/primitives/components/Date.d.ts +30 -0
  178. package/dist/runtime/primitives/components/Date.d.ts.map +1 -0
  179. package/dist/runtime/primitives/components/Date.js +43 -0
  180. package/dist/runtime/primitives/components/Image.d.ts +72 -0
  181. package/dist/runtime/primitives/components/Image.d.ts.map +1 -0
  182. package/dist/runtime/primitives/components/Image.js +108 -0
  183. package/dist/runtime/primitives/components/RichText.d.ts +9 -0
  184. package/dist/runtime/primitives/components/RichText.d.ts.map +1 -0
  185. package/dist/runtime/primitives/components/RichText.js +135 -0
  186. package/dist/runtime/primitives/components/StaticImage.d.ts +44 -0
  187. package/dist/runtime/primitives/components/StaticImage.d.ts.map +1 -0
  188. package/dist/runtime/primitives/components/StaticImage.js +73 -0
  189. package/dist/runtime/primitives/components/Text.d.ts +24 -0
  190. package/dist/runtime/primitives/components/Text.d.ts.map +1 -0
  191. package/dist/runtime/primitives/components/Text.js +35 -0
  192. package/dist/runtime/primitives/components/Video.d.ts +31 -0
  193. package/dist/runtime/primitives/components/Video.d.ts.map +1 -0
  194. package/dist/runtime/primitives/components/Video.js +34 -0
  195. package/dist/runtime/primitives/components/index.d.ts +6 -0
  196. package/dist/runtime/primitives/components/index.d.ts.map +1 -0
  197. package/dist/runtime/primitives/components/index.js +5 -0
  198. package/dist/runtime/primitives/index.d.ts +11 -0
  199. package/dist/runtime/primitives/index.d.ts.map +1 -0
  200. package/dist/runtime/primitives/index.js +14 -0
  201. package/dist/runtime/primitives/lib/image-optimization.d.ts +50 -0
  202. package/dist/runtime/primitives/lib/image-optimization.d.ts.map +1 -0
  203. package/dist/runtime/primitives/lib/image-optimization.js +183 -0
  204. package/dist/runtime/primitives/lib/index.d.ts +5 -0
  205. package/dist/runtime/primitives/lib/index.d.ts.map +1 -0
  206. package/dist/runtime/primitives/lib/index.js +4 -0
  207. package/dist/runtime/primitives/lib/primitives.d.ts +179 -0
  208. package/dist/runtime/primitives/lib/primitives.d.ts.map +1 -0
  209. package/dist/runtime/primitives/lib/primitives.js +224 -0
  210. package/dist/runtime/primitives/lib/query.d.ts +46 -0
  211. package/dist/runtime/primitives/lib/query.d.ts.map +1 -0
  212. package/dist/runtime/primitives/lib/query.js +1 -0
  213. package/dist/runtime/primitives/lib/template.d.ts +13 -0
  214. package/dist/runtime/primitives/lib/template.d.ts.map +1 -0
  215. package/dist/runtime/primitives/lib/template.js +26 -0
  216. package/dist/runtime/primitives/lib/useFimoLiveValue.d.ts +22 -0
  217. package/dist/runtime/primitives/lib/useFimoLiveValue.d.ts.map +1 -0
  218. package/dist/runtime/primitives/lib/useFimoLiveValue.js +49 -0
  219. package/dist/runtime/primitives/translations.d.ts +20 -0
  220. package/dist/runtime/primitives/translations.d.ts.map +1 -0
  221. package/dist/runtime/primitives/translations.js +25 -0
  222. package/dist/runtime/react-router/index.d.ts +8 -0
  223. package/dist/runtime/react-router/index.d.ts.map +1 -0
  224. package/dist/runtime/react-router/index.js +15 -0
  225. package/dist/runtime/routing/AppResetScrollOnNavigate.d.ts +2 -0
  226. package/dist/runtime/routing/AppResetScrollOnNavigate.d.ts.map +1 -0
  227. package/dist/runtime/routing/AppResetScrollOnNavigate.js +12 -0
  228. package/dist/runtime/routing/AppRoutesProvider.d.ts +25 -0
  229. package/dist/runtime/routing/AppRoutesProvider.d.ts.map +1 -0
  230. package/dist/runtime/routing/AppRoutesProvider.js +92 -0
  231. package/dist/runtime/seo/buildSeoForPath.d.ts +76 -0
  232. package/dist/runtime/seo/buildSeoForPath.d.ts.map +1 -0
  233. package/dist/runtime/seo/buildSeoForPath.js +52 -0
  234. package/dist/runtime/seo/htmlProps.d.ts +10 -0
  235. package/dist/runtime/seo/htmlProps.d.ts.map +1 -0
  236. package/dist/runtime/seo/htmlProps.js +14 -0
  237. package/dist/runtime/seo/index.d.ts +9 -0
  238. package/dist/runtime/seo/index.d.ts.map +1 -0
  239. package/dist/runtime/seo/index.js +8 -0
  240. package/dist/runtime/seo/resolver.d.ts +39 -0
  241. package/dist/runtime/seo/resolver.d.ts.map +1 -0
  242. package/dist/runtime/seo/resolver.js +144 -0
  243. package/dist/runtime/shared/fimo-config.server.d.ts +8 -0
  244. package/dist/runtime/shared/fimo-config.server.d.ts.map +1 -0
  245. package/dist/runtime/shared/fimo-config.server.js +39 -0
  246. package/dist/runtime/shared/fimo-config.types.d.ts +40 -0
  247. package/dist/runtime/shared/fimo-config.types.d.ts.map +1 -0
  248. package/dist/runtime/shared/fimo-config.types.js +1 -0
  249. package/dist/runtime/t/OptionalTracking.d.ts +13 -0
  250. package/dist/runtime/t/OptionalTracking.d.ts.map +1 -0
  251. package/dist/runtime/t/OptionalTracking.js +28 -0
  252. package/dist/runtime/t/OptionalTracking.test.d.ts +2 -0
  253. package/dist/runtime/t/OptionalTracking.test.d.ts.map +1 -0
  254. package/dist/runtime/t/OptionalTracking.test.js +11 -0
  255. package/dist/runtime/t/Pageview.d.ts +9 -0
  256. package/dist/runtime/t/Pageview.d.ts.map +1 -0
  257. package/dist/runtime/t/Pageview.js +118 -0
  258. package/dist/runtime/templates.d.ts +62 -0
  259. package/dist/runtime/templates.d.ts.map +1 -0
  260. package/dist/runtime/templates.js +145 -0
  261. package/dist/scripts/export-static.d.ts +12 -0
  262. package/dist/scripts/export-static.js +47 -0
  263. package/dist/scripts/extract-translations.d.ts +13 -0
  264. package/dist/scripts/extract-translations.js +124 -0
  265. package/dist/scripts/inject-translations.d.ts +6 -0
  266. package/dist/scripts/inject-translations.js +168 -0
  267. package/dist/scripts/lib/parse-routes-file.d.ts +14 -0
  268. package/dist/scripts/lib/parse-routes-file.js +43 -0
  269. package/dist/scripts/lib/validation-report.d.ts +44 -0
  270. package/dist/scripts/lib/validation-report.js +84 -0
  271. package/dist/scripts/lint-translation-keys.d.ts +13 -0
  272. package/dist/scripts/lint-translation-keys.js +137 -0
  273. package/dist/scripts/resolve-routes.d.ts +9 -0
  274. package/dist/scripts/resolve-routes.js +222 -0
  275. package/dist/scripts/sync-forms.d.ts +10 -0
  276. package/dist/scripts/sync-forms.js +125 -0
  277. package/dist/scripts/sync-schemas.d.ts +10 -0
  278. package/dist/scripts/sync-schemas.js +107 -0
  279. package/dist/scripts/utils/assets.d.ts +1 -0
  280. package/dist/scripts/utils/assets.js +14 -0
  281. package/dist/scripts/validate-route-metadata.d.ts +8 -0
  282. package/dist/scripts/validate-route-metadata.js +139 -0
  283. package/package.json +99 -6
  284. package/release.json +5 -0
  285. package/scripts/add-ext.mjs +47 -0
  286. package/scripts/bump-version.mjs +77 -0
  287. package/scripts/bundle-cli.mjs +123 -0
  288. package/scripts/install-cli.mjs +36 -0
  289. package/scripts/lib/channels.mjs +69 -0
  290. package/scripts/lib/cleanup-release.mjs +64 -0
  291. package/scripts/lib/cleanup-release.test.ts +142 -0
  292. package/scripts/lib/postinstall-onboarding.mjs +40 -0
  293. package/scripts/lib/postinstall-onboarding.test.ts +82 -0
  294. package/scripts/lib/release-core.mjs +122 -0
  295. package/scripts/postinstall.mjs +132 -0
  296. package/scripts/publish-npm.mjs +136 -0
  297. package/scripts/publish-tarball.mjs +245 -0
  298. package/templates/react-router/_gitignore +14 -0
  299. package/templates/react-router/components.json +21 -0
  300. package/templates/react-router/fimo-config.json +23 -0
  301. package/templates/react-router/index.html +15 -0
  302. package/templates/react-router/package.json +63 -0
  303. package/templates/react-router/pnpm-workspace.yaml +3 -0
  304. package/templates/react-router/public/favicon.ico +0 -0
  305. package/templates/react-router/public/favicon.svg +4 -0
  306. package/templates/react-router/public/robots.txt +4 -0
  307. package/templates/react-router/react-router.config.ts +17 -0
  308. package/templates/react-router/src/components/ui/accordion.tsx +51 -0
  309. package/templates/react-router/src/components/ui/alert-dialog.tsx +163 -0
  310. package/templates/react-router/src/components/ui/alert.tsx +49 -0
  311. package/templates/react-router/src/components/ui/aspect-ratio.tsx +9 -0
  312. package/templates/react-router/src/components/ui/avatar.tsx +87 -0
  313. package/templates/react-router/src/components/ui/badge.tsx +40 -0
  314. package/templates/react-router/src/components/ui/breadcrumb.tsx +92 -0
  315. package/templates/react-router/src/components/ui/button-group.tsx +75 -0
  316. package/templates/react-router/src/components/ui/button.tsx +62 -0
  317. package/templates/react-router/src/components/ui/calendar.tsx +159 -0
  318. package/templates/react-router/src/components/ui/card.tsx +56 -0
  319. package/templates/react-router/src/components/ui/carousel.tsx +216 -0
  320. package/templates/react-router/src/components/ui/chart.tsx +306 -0
  321. package/templates/react-router/src/components/ui/checkbox.tsx +29 -0
  322. package/templates/react-router/src/components/ui/collapsible.tsx +15 -0
  323. package/templates/react-router/src/components/ui/combobox.tsx +267 -0
  324. package/templates/react-router/src/components/ui/command.tsx +137 -0
  325. package/templates/react-router/src/components/ui/context-menu.tsx +211 -0
  326. package/templates/react-router/src/components/ui/dialog.tsx +136 -0
  327. package/templates/react-router/src/components/ui/direction.tsx +18 -0
  328. package/templates/react-router/src/components/ui/drawer.tsx +106 -0
  329. package/templates/react-router/src/components/ui/dropdown-menu.tsx +219 -0
  330. package/templates/react-router/src/components/ui/empty.tsx +85 -0
  331. package/templates/react-router/src/components/ui/field.tsx +226 -0
  332. package/templates/react-router/src/components/ui/form.tsx +136 -0
  333. package/templates/react-router/src/components/ui/hover-card.tsx +36 -0
  334. package/templates/react-router/src/components/ui/input-group.tsx +147 -0
  335. package/templates/react-router/src/components/ui/input-otp.tsx +68 -0
  336. package/templates/react-router/src/components/ui/input.tsx +21 -0
  337. package/templates/react-router/src/components/ui/item.tsx +158 -0
  338. package/templates/react-router/src/components/ui/kbd.tsx +22 -0
  339. package/templates/react-router/src/components/ui/label.tsx +19 -0
  340. package/templates/react-router/src/components/ui/menubar.tsx +236 -0
  341. package/templates/react-router/src/components/ui/native-select.tsx +52 -0
  342. package/templates/react-router/src/components/ui/navigation-menu.tsx +142 -0
  343. package/templates/react-router/src/components/ui/pagination.tsx +100 -0
  344. package/templates/react-router/src/components/ui/popover.tsx +52 -0
  345. package/templates/react-router/src/components/ui/progress.tsx +24 -0
  346. package/templates/react-router/src/components/ui/radio-group.tsx +31 -0
  347. package/templates/react-router/src/components/ui/resizable.tsx +47 -0
  348. package/templates/react-router/src/components/ui/scroll-area.tsx +46 -0
  349. package/templates/react-router/src/components/ui/select.tsx +162 -0
  350. package/templates/react-router/src/components/ui/separator.tsx +26 -0
  351. package/templates/react-router/src/components/ui/sheet.tsx +107 -0
  352. package/templates/react-router/src/components/ui/sidebar.tsx +675 -0
  353. package/templates/react-router/src/components/ui/skeleton.tsx +7 -0
  354. package/templates/react-router/src/components/ui/slider.tsx +54 -0
  355. package/templates/react-router/src/components/ui/sonner.tsx +34 -0
  356. package/templates/react-router/src/components/ui/spinner.tsx +9 -0
  357. package/templates/react-router/src/components/ui/switch.tsx +33 -0
  358. package/templates/react-router/src/components/ui/table.tsx +78 -0
  359. package/templates/react-router/src/components/ui/tabs.tsx +69 -0
  360. package/templates/react-router/src/components/ui/textarea.tsx +18 -0
  361. package/templates/react-router/src/components/ui/toggle-group.tsx +80 -0
  362. package/templates/react-router/src/components/ui/toggle.tsx +41 -0
  363. package/templates/react-router/src/components/ui/tooltip.tsx +42 -0
  364. package/templates/react-router/src/hooks/use-mobile.ts +19 -0
  365. package/templates/react-router/src/index.css +147 -0
  366. package/templates/react-router/src/lib/utils.ts +6 -0
  367. package/templates/react-router/src/pages/Index.tsx +108 -0
  368. package/templates/react-router/src/pages/Privacy.tsx +79 -0
  369. package/templates/react-router/src/pages/Terms.tsx +48 -0
  370. package/templates/react-router/src/pages/legal/LegalPage.tsx +42 -0
  371. package/templates/react-router/src/root.tsx +53 -0
  372. package/templates/react-router/src/routes.ts +13 -0
  373. package/templates/react-router/src/vite-env.d.ts +11 -0
  374. package/templates/react-router/translations/en.json +1 -0
  375. package/templates/react-router/tsconfig.json +35 -0
  376. package/templates/react-router/vite.config.ts +63 -0
package/README.md ADDED
@@ -0,0 +1,344 @@
1
+ # fimo
2
+
3
+ Fimo project CLI **and** library. One npm package, three surfaces:
4
+
5
+ - `fimo` binary — `fimo create`, `fimo deploy`, `fimo switch`, …
6
+ - `fimo/ui` — React runtime (providers, components, `useTranslations`).
7
+ - `fimo/vite` — Vite plugin that composes Fimo's build-time plugins and auto-regenerates the schema/form TS clients.
8
+
9
+ ## Using the library inside a Fimo project
10
+
11
+ ```jsonc
12
+ // package.json (scaffolded by `fimo create`)
13
+ {
14
+ "scripts": {
15
+ "dev": "vite",
16
+ "build": "vite build",
17
+ "preview": "vite preview",
18
+ },
19
+ "dependencies": { "fimo": "^0.0.1", "react": "...", "react-router": "..." },
20
+ "devDependencies": { "vite": "...", "oxlint": "...", "typescript": "..." },
21
+ }
22
+ ```
23
+
24
+ ```ts
25
+ // vite.config.ts
26
+ import { defineConfig } from 'vite';
27
+ import { fimo } from 'fimo/vite';
28
+ export default defineConfig({ plugins: [fimo()] });
29
+ ```
30
+
31
+ ```ts
32
+ // src/main.tsx
33
+ import { AppRoutesProvider } from 'fimo/ui';
34
+ ```
35
+
36
+ The vite plugin:
37
+
38
+ - Injects `fimo-config.json` constants as build-time defines.
39
+ - Registers the SEO, data-id, overlay, preview-script, and translations plugins.
40
+ - Watches `src/{schemas,forms}/**/*.json` and regenerates the corresponding `.ts` clients on change. No separate prebuild script needed.
41
+
42
+ ## Running the CLI during dev
43
+
44
+ ```sh
45
+ # from the monorepo root
46
+ pnpm -F fimo start -- <command>
47
+ # e.g.
48
+ pnpm -F fimo start -- login
49
+ pnpm -F fimo start -- create my-site
50
+ pnpm -F fimo start -- deploy --publish
51
+ pnpm -F fimo start -- invite
52
+ pnpm -F fimo start -- referral link
53
+ pnpm -F fimo start -- referral stats
54
+ ```
55
+
56
+ ## Install `fimo` as a global command
57
+
58
+ ```sh
59
+ # from the monorepo root
60
+ pnpm install-cli
61
+ ```
62
+
63
+ That one command:
64
+
65
+ 1. Builds the CLI (three-way tsc build for `dist/{cli,ui,vite,scripts}`).
66
+ 2. Makes `apps/cli/dist/cli/index.js` executable.
67
+ 3. Creates a symlink at `~/.local/bin/fimo` pointing at the built entry.
68
+ 4. Warns if `~/.local/bin` is not on your `PATH`.
69
+
70
+ Add `~/.local/bin` to your shell rc if the script warned you:
71
+
72
+ ```sh
73
+ export PATH="$HOME/.local/bin:$PATH"
74
+ ```
75
+
76
+ Verify:
77
+
78
+ ```sh
79
+ fimo --help
80
+ ```
81
+
82
+ After that `fimo create my-site`, `fimo deploy`, etc. work from any directory.
83
+
84
+ > The symlink points at the built entry inside the monorepo, so after `git pull` just re-run `pnpm install-cli` (or `pnpm -F cli build`) to refresh — the symlink itself stays valid.
85
+
86
+ ### Why this works anywhere
87
+
88
+ - The **project template** lives at `apps/cli/templates/<framework>/` (currently just `react-router/`) and the **`.claude/` starter** lives under `apps/cli/assets/agents-starter/`. The CLI resolves both relative to its own file location (via `import.meta.url`, see `apps/cli/src/runtime/templates.ts`). There is no cross-package runtime path — `fimo` needs nothing outside the CLI package.
89
+ - The scaffolded homepage is intentionally a single-page starter so `fimo create` produces something visible and editable immediately, rather than a blank screen.
90
+ - That homepage is intentionally disposable. Real generations should replace its content/style instead of iterating on the default Fimo-branded design. Run `fimo check-starter` against a generated project to catch leaked starter copy.
91
+
92
+ ## Previewing the scaffold without `fimo create`
93
+
94
+ - The source for the scaffolded project is checked in at `apps/cli/templates/react-router/`, so you can inspect the exact files that `fimo create` copies without creating a project first.
95
+ - There is not currently a dedicated one-command preview flow for that template inside the monorepo. To render it as a website, you still need to run the template itself or scaffold a project from it.
96
+
97
+ ## Environment variables
98
+
99
+ | Variable | Default | Purpose |
100
+ | -------------- | ----------------------- | -------------------------------------------------------------------------------------------- |
101
+ | `FIMO_API_URL` | `http://localhost:3000` | Base URL of the Fimo HTTP API (management + tenant). Point at staging/prod to test remotely. |
102
+ | `FIMO_WEB_URL` | `http://localhost:5173` | Base URL of the Fimo web app. The login flow opens `<FIMO_WEB_URL>/auth/cli` in the browser. |
103
+
104
+ ### Pointing the CLI at another environment (staging, prod, preview)
105
+
106
+ Export both vars before running any command so login, API calls, and the browser callback all target the same environment:
107
+
108
+ ```sh
109
+ export FIMO_API_URL="<staging-api-base-url>"
110
+ export FIMO_WEB_URL="<staging-web-base-url>"
111
+
112
+ fimo login
113
+ fimo create my-staging-site
114
+ ```
115
+
116
+ Credentials are scoped per-backend (hashed on `apiUrl`). `fimo login` writes to `~/.config/fimo/credentials/<host>-<hash>.json`; switching `FIMO_API_URL` and re-running `fimo login` writes a fresh slot without disturbing the old one.
117
+
118
+ ## Active organization
119
+
120
+ `fimo login` automatically persists your personal org (or the first org you belong to) as the **active organization** in `credentials.json`. `fimo create` uses it — no prompt.
121
+
122
+ To switch:
123
+
124
+ ```sh
125
+ fimo switch
126
+ ```
127
+
128
+ `fimo whoami` prints the currently active organization. `fimo create --org <id>` still works for one-off overrides.
129
+
130
+ ## Envs (M07 — branch = env)
131
+
132
+ Every project has one or more **envs** (`main`, `feat/seo`, `release/v1.4.2`, …). Each `fimo` command auto-targets the env from the **current git branch**, falling back to `main` when there's no branch:
133
+
134
+ ```sh
135
+ git checkout feat/seo
136
+ fimo cms entries list BlogPost # → env: feat/seo (from git branch)
137
+
138
+ git checkout main
139
+ fimo cms entries list BlogPost # → env: main (from git branch)
140
+ ```
141
+
142
+ A `release/<tag>` checkout maps to the well-known `prod` shorthand and is **read-only** — mutating commands refuse to run:
143
+
144
+ ```sh
145
+ git checkout release/v1.4.2
146
+ fimo cms entries create BlogPost --body '{...}' # ✗ refuses (read-only env 'prod')
147
+ fimo cms entries list BlogPost # ok (read-only)
148
+ ```
149
+
150
+ ### Override with `--env <name>`
151
+
152
+ The `--env` root flag overrides the auto-target for one invocation:
153
+
154
+ ```sh
155
+ fimo --env staging cms entries list BlogPost
156
+ fimo --env release/v1 cms entries get BlogPost the-launch-day
157
+ ```
158
+
159
+ The CLI prints a one-line banner on stderr so you can see what env each command targeted:
160
+
161
+ ```
162
+ → env: staging (from --env)
163
+ ```
164
+
165
+ Behind the scenes the CLI sends `X-Fimo-Env: <env>` on every request; the server's `resolveEnv` middleware picks it up. Branch and override names are validated client-side against the canonical regex (`/^[a-zA-Z0-9._/-]+$/`, ≤255 chars).
166
+
167
+ ### Common errors
168
+
169
+ | Error | Hint |
170
+ | ------------------------------------------------------- | ----------------------------------------------------------------------------- |
171
+ | `You are not in a Fimo project.` | `cd` into a directory containing `.fimo.settings.json`, or run `fimo create`. |
172
+ | `In a git repository but no branch could be detected …` | Detached HEAD — `git checkout main` or pass `--env <name>`. |
173
+ | `--env value '...' is invalid` | Env names must match `/^[a-zA-Z0-9._/-]+$/` and not start with `-`. |
174
+ | `Env '...' not found on the server.` | `fimo branch` to list envs; `fimo branch <name>` to create one. |
175
+
176
+ ## Git-shaped CLI (M08)
177
+
178
+ The `fimo` command set mirrors git's shape — same verbs, multi-surface semantics:
179
+
180
+ ```sh
181
+ fimo branch # list envs (current marked with *)
182
+ fimo branch -v # + show archived + preview URLs
183
+ fimo branch feat/seo # create env off current
184
+ fimo branch -d feat/old # archive (refuses if unmerged)
185
+ fimo branch -D feat/old # force-delete
186
+ fimo branch -m feat/typo feat/fixed # rename
187
+
188
+ fimo checkout feat/seo # switch env + git branch
189
+ fimo checkout -b feat/new # create + switch
190
+
191
+ fimo switch feat/seo # alias for `fimo checkout`
192
+ fimo organizations switch # (the old `fimo switch` org switcher moved here)
193
+
194
+ fimo pull # sync current env from parent
195
+ fimo pull --from main # explicit parent override
196
+
197
+ fimo diff # current vs main, across all surfaces
198
+ fimo diff feat/seo main # explicit
199
+ fimo diff --surface schemas # filter to one surface
200
+ fimo diff --surface code # drops to `git diff` locally
201
+ fimo diff --json # raw JSON for pipes/agents
202
+
203
+ fimo merge feat/seo # multi-surface merge (refuses on main)
204
+ fimo merge feat/seo --allow-direct-merge # override the protected-flow gate
205
+ fimo merge feat/seo -y # parent-wins for every conflict
206
+
207
+ fimo status # the showcase: 8 surfaces in one report
208
+ fimo status --short # one line per surface
209
+ fimo status --vs main # explicit comparison target
210
+ fimo status --code --content # surface filters (any combo)
211
+ fimo status --json # raw JSON
212
+
213
+ fimo publish --version 1.4.2 # tag release/v1.4.2 + trigger prod swap
214
+
215
+ fimo agents list # (M13 stub — full impl lands with the agent system)
216
+ ```
217
+
218
+ ### Surfaces
219
+
220
+ Every multi-surface command spans the same 8 surfaces in the same canonical order:
221
+
222
+ ```
223
+ code · schemas · content · translations · routes · assets · forms · activations
224
+ ```
225
+
226
+ The renderer prints them grouped, with `+` (added) / `-` (removed) / `~` (changed) / `!` (conflict) glyphs and a dim summary line per section. Each surface check has a 2 s soft timeout — a slow surface renders as `(surface check timed out)` and the rest of the report still draws.
227
+
228
+ ### Protected flow
229
+
230
+ `fimo merge` refuses to merge directly onto `main` by default. Use the PR/review flow, or pass `--allow-direct-merge` to override (useful for cutover-style operator work). `fimo publish` similarly requires you to already be on `main`.
231
+
232
+ ### `NO_COLOR` / `--no-color`
233
+
234
+ The CLI honors the [NO_COLOR](https://no-color.org/) standard. Every multi-surface command also accepts a per-invocation `--no-color` flag for piping into tools that don't strip ANSI escapes.
235
+
236
+ ## Inviting users
237
+
238
+ `fimo invite` opens an interactive flow that mirrors the UI sharing dialogs:
239
+
240
+ - choose whether to invite someone to an **organization** or a **project**
241
+ - enter the invitee email
242
+ - pick the organization role (`member`, `admin`, `owner`) or project access level (`view`, `comment`, `edit`, `full`)
243
+
244
+ Examples:
245
+
246
+ ```sh
247
+ # interactive
248
+ fimo invite
249
+
250
+ # invite to the active organization
251
+ fimo invite --target organization --email jane@acme.com --role admin
252
+
253
+ # invite to the current project from .fimo.settings.json
254
+ fimo invite --target project --email jane@acme.com --role edit
255
+
256
+ # invite to a specific project
257
+ fimo invite --target project --project <projectId> --email jane@acme.com --role full
258
+ ```
259
+
260
+ ## Referral link
261
+
262
+ Use `fimo referral link` to print your public referral link directly in the terminal:
263
+
264
+ ```sh
265
+ fimo referral link
266
+ ```
267
+
268
+ The command uses the current signed-in user and prints a shareable URL like:
269
+
270
+ ```text
271
+ https://fimo.ai/invite/<your-user-id>
272
+ ```
273
+
274
+ ## Referral stats
275
+
276
+ Use `fimo referral stats` to print the same referral summary exposed in the UI:
277
+
278
+ ```sh
279
+ fimo referral stats
280
+ ```
281
+
282
+ It shows:
283
+
284
+ - total referrals
285
+ - signed up referrals
286
+ - activated referrals
287
+ - AI credits earned
288
+
289
+ ## Publishing a test tarball (R2)
290
+
291
+ The CLI ships as a single self-contained tarball (template + compiled JS). For internal distribution we upload it to a Cloudflare R2 bucket via `wrangler`.
292
+
293
+ ```sh
294
+ # from apps/cli
295
+ pnpm publish-cli
296
+ # or from anywhere:
297
+ pnpm -F fimo publish-cli
298
+ ```
299
+
300
+ What this does:
301
+
302
+ 1. `pnpm -F fimo build` → compiles TS and refreshes the bundled template.
303
+ 2. `pnpm pack` → produces `apps/cli/fimo-<version>.tgz` (~175 KB).
304
+ 3. `wrangler r2 object put` → uploads it to `r2://<bucket>/cli/fimo-<version>.tgz` **and** `r2://<bucket>/cli/fimo-latest.tgz`.
305
+
306
+ ### Env vars
307
+
308
+ | Variable | Default | Purpose |
309
+ | ----------------------- | --------------- | -------------------------- |
310
+ | `FIMO_CLI_R2_BUCKET` | `fimo-cli-test` | Target R2 bucket name |
311
+ | `CLOUDFLARE_API_TOKEN` | — | wrangler auth (standard) |
312
+ | `CLOUDFLARE_ACCOUNT_ID` | — | wrangler account selection |
313
+
314
+ ### Overrides
315
+
316
+ ```sh
317
+ # different bucket
318
+ FIMO_CLI_R2_BUCKET=fimo-cli-staging pnpm -F fimo publish-cli
319
+
320
+ # upload to the local wrangler dev store instead of the real R2 (dry-run style)
321
+ pnpm -F fimo publish-cli -- --local
322
+ ```
323
+
324
+ ### Installing the tarball on a test machine
325
+
326
+ The test bucket is publicly served at **`https://pub-41cdea46386f4b238d8c528c4327dfc1.r2.dev`**.
327
+
328
+ ```sh
329
+ # always-latest
330
+ npm install -g https://pub-41cdea46386f4b238d8c528c4327dfc1.r2.dev/cli/fimo-latest.tgz
331
+
332
+ # pin a specific version
333
+ npm install -g https://pub-41cdea46386f4b238d8c528c4327dfc1.r2.dev/cli/fimo-0.0.1.tgz
334
+
335
+ fimo --help
336
+ ```
337
+
338
+ Interactive global installs ask whether to run `fimo skills install` so the user's AI coding tools can load the Fimo skills immediately. Non-interactive installs, CI, and `FIMO_SKIP_POSTINSTALL_PROMPT=1` skip the prompt and print the manual command instead. The installer also prints `fimo login` as the next account step, but it does not open the browser login flow from `postinstall`.
339
+
340
+ > `publish-cli` uploads both `cli/fimo-<version>.tgz` and `cli/fimo-latest.tgz` on every run.
341
+
342
+ ## Credentials
343
+
344
+ Stored at `${XDG_CONFIG_HOME:-~/.config}/fimo/credentials/<host>-<hash>.json` (one file per backend). Each file contains the access token, user info, and the active organization. Delete the file (or run `fimo login` against a new `FIMO_API_URL`) to switch accounts.
@@ -0,0 +1,11 @@
1
+ # Agent goal
2
+
3
+ Describe what this agent should do. The whole of GOAL.md is the agent's
4
+ prompt — there's no frontmatter or structured fields, just plain English.
5
+
6
+ Some good things to include:
7
+
8
+ - The end state you want when the agent succeeds
9
+ - Inputs the agent should expect (CLI args, files, API responses)
10
+ - Anything the agent should **not** do
11
+ - The format of the report / output the agent should produce
@@ -0,0 +1,4 @@
1
+ # Minimum-viable config. Add triggers / composition / data_sources as needed.
2
+ # See https://fimo.dev/docs/agents/bundle for the full reference.
3
+ version: 1
4
+ description: 'A new Fimo agent. Edit this tagline to describe what it does.'
@@ -0,0 +1,51 @@
1
+ # Broken-link sweeper
2
+
3
+ Crawl the project's published site once a week, find every broken link
4
+ (404s on internal routes, dead external destinations), classify them by
5
+ the page they live on, and propose a per-page fix on its own branch.
6
+
7
+ ## Inputs
8
+
9
+ - The project's `sitemap.xml`, fetched from the published origin.
10
+ - Each page's HTML, fetched fresh on every run.
11
+ - The project's analytics (read-only) — used to rank which pages to
12
+ triage first when the broken-link count is large.
13
+
14
+ ## What to do
15
+
16
+ 1. Fetch `sitemap.xml` and enumerate the canonical URL set.
17
+ 2. For each URL, fetch the HTML and collect every `<a href>` plus every
18
+ `<link rel="canonical">` and every `<img src>` target.
19
+ 3. Classify each link:
20
+ - **internal-404** — same-origin route that returns 4xx.
21
+ - **external-dead** — third-party host that returns 4xx/5xx or
22
+ times out after a reasonable retry.
23
+ - **internal-redirect** — internal route that 301s to a different
24
+ path (worth flagging, not always worth fixing).
25
+ 4. Group findings by the source page that contains them.
26
+ 5. For each affected page, open a fresh branch off `main` and commit a
27
+ draft fix:
28
+ - **internal-404** → propose a route alias or update the link to the
29
+ closest live route (if the analytics show traffic to the dead path,
30
+ prefer the alias; otherwise update in place).
31
+ - **external-dead** → remove the link and replace its anchor text
32
+ with plain text, leaving a TODO comment for a human to revisit.
33
+ - **internal-redirect** → update the link to the canonical target.
34
+ 6. Open one `agent_branch_proposal` per affected page so the owner can
35
+ review each batch independently.
36
+
37
+ ## What to produce
38
+
39
+ - One branch per affected page, named `agent/broken-links/<page-slug>`.
40
+ - One proposal per branch summarising the findings and the fix.
41
+ - A single run report at `reports/broken-links-<YYYY-MM-DD>.md` with
42
+ the overall counts, the top 5 dead external destinations, and a
43
+ trend footer (`<!-- agent-summary: ... -->`) for diffing across
44
+ runs.
45
+
46
+ ## What NOT to do
47
+
48
+ - Don't merge any branch — every fix goes through human review.
49
+ - Don't follow `noindex` or `disallow`'d routes; respect the project's
50
+ robots policy.
51
+ - Don't fetch a URL more than once per run, and back off on 5xx.
@@ -0,0 +1,6 @@
1
+ - net:fetch
2
+ - files:read
3
+ - files:write
4
+ - git:branch
5
+ - git:commit
6
+ - fimo:analytics:read
@@ -0,0 +1,12 @@
1
+ version: 1
2
+ description: 'Crawl the published site and flag broken outbound links in a weekly report.'
3
+
4
+ runtime:
5
+ cloud: true
6
+ long_running: true
7
+
8
+ triggers:
9
+ - type: manual
10
+ - type: schedule
11
+ cron: '0 4 * * MON'
12
+ tz: UTC
@@ -0,0 +1,37 @@
1
+ # Content translator
2
+
3
+ Translate CMS entries from the project's default locale into every
4
+ non-default locale declared in `fimo.config.json`. Writes go through
5
+ the `agent` branch and never directly to `main` — the M19 lifecycle
6
+ engine picks the branch up and either auto-merges or proposes it for
7
+ review.
8
+
9
+ ## Inputs
10
+
11
+ - The list of CMS entries that have a non-empty default-locale field
12
+ but an empty translation for any non-default locale.
13
+ - The configured target locales (read from `fimo.config.json`).
14
+
15
+ ## What to do
16
+
17
+ For each entry:
18
+
19
+ 1. Read the default-locale field via `cms:read`.
20
+ 2. Translate to every missing locale (via `net:fetch` to your translation
21
+ provider of choice).
22
+ 3. Write the translation back to the entry via `cms:write`.
23
+ 4. Commit the change on the agent's branch.
24
+
25
+ ## What NOT to do
26
+
27
+ - Don't translate fields that the entry's schema marks `translate: false`.
28
+ - Don't overwrite an existing translation, even if it looks lower quality.
29
+ - Don't auto-merge to main — the lifecycle engine will propose a PR
30
+ when `agents.auto_merge.enabled` is true and the diff classifies as
31
+ `low_risk` or `trivial`.
32
+
33
+ ## v1.x note
34
+
35
+ Cloud-time activation of this agent requires
36
+ `agents.notifications.email_recipients` to be non-empty (per ADR-0009).
37
+ Add at least one address before running `fimo agents activate`.
@@ -0,0 +1,10 @@
1
+ # Reads CMS, writes translations + i18n + files. Net for the translation provider.
2
+ - cms:read
3
+ - cms:write
4
+ - i18n:read
5
+ - i18n:write
6
+ - files:read
7
+ - files:write
8
+ - net:fetch
9
+ - git:branch
10
+ - git:commit
@@ -0,0 +1,11 @@
1
+ version: 1
2
+ description: 'Translate CMS content into the project locales whenever an entry is published.'
3
+ data_sources:
4
+ - main
5
+
6
+ # Trigger on every CMS publish event. The runtime debounces — multiple
7
+ # publishes within ~30s collapse into a single agent run.
8
+ triggers:
9
+ - type: manual
10
+ - type: event
11
+ event: cms.publish
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Tool: translate-entries
3
+ *
4
+ * Walk every CMS entry, find translatable fields missing translations,
5
+ * call the configured translation provider, and write back through the
6
+ * Fimo API. Skips fields marked `translate: false` in the schema.
7
+ *
8
+ * Provider is configured via env (FIMO_AGENT_TRANSLATE_PROVIDER) — the
9
+ * runtime threads project secrets through when the v1.x secrets API
10
+ * lands. For now this template uses the OpenAI fallback.
11
+ */
12
+
13
+ interface Entry {
14
+ id: string;
15
+ type: string;
16
+ data: Record<string, unknown>;
17
+ }
18
+
19
+ interface TranslateOptions {
20
+ fromLocale: string;
21
+ toLocales: string[];
22
+ api: { base: string; projectId: string; env: string };
23
+ }
24
+
25
+ async function listMissing(_opts: TranslateOptions): Promise<Entry[]> {
26
+ // Stub — wired to the Fimo API by the runtime. Returns entries with
27
+ // at least one non-default-locale field that's empty while the
28
+ // default-locale field is populated.
29
+ return [];
30
+ }
31
+
32
+ async function translate(text: string, _to: string): Promise<string> {
33
+ // Stub — call the configured provider. Returns the translated string.
34
+ return text;
35
+ }
36
+
37
+ async function writeBack(_entry: Entry, _locale: string, _value: string): Promise<void> {
38
+ // Stub — PATCH the entry via `/api/management/projects/:id/envs/:env/cms/:type/:id`.
39
+ }
40
+
41
+ async function main(): Promise<void> {
42
+ const fromLocale = process.env.FIMO_DEFAULT_LOCALE ?? 'en';
43
+ const toLocales = (process.env.FIMO_TARGET_LOCALES ?? '').split(',').filter(Boolean);
44
+ const api = {
45
+ base: process.env.FIMO_API_URL ?? 'http://localhost:3000',
46
+ projectId: process.env.FIMO_PROJECT_ID ?? '',
47
+ env: process.env.FIMO_ENV ?? 'main',
48
+ };
49
+
50
+ const entries = await listMissing({ fromLocale, toLocales, api });
51
+ for (const entry of entries) {
52
+ for (const locale of toLocales) {
53
+ const sourceValue = (entry.data[fromLocale] as Record<string, string> | undefined)?.title;
54
+ if (!sourceValue) {
55
+ continue;
56
+ }
57
+ const translated = await translate(sourceValue, locale);
58
+ await writeBack(entry, locale, translated);
59
+ }
60
+ }
61
+ }
62
+
63
+ main().catch((err) => {
64
+ console.error(err);
65
+ process.exit(1);
66
+ });
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Tool: write-locale-files
3
+ *
4
+ * For locale-keyed JSON files in `src/locales/<locale>.json`, fill in
5
+ * missing keys from the default-locale file using the configured
6
+ * translation provider. Run after translate-entries when projects mix
7
+ * CMS-driven copy with hardcoded i18n strings.
8
+ */
9
+
10
+ import { promises as fs } from 'node:fs';
11
+ import path from 'node:path';
12
+
13
+ interface Catalog {
14
+ [key: string]: string;
15
+ }
16
+
17
+ async function readCatalog(file: string): Promise<Catalog> {
18
+ try {
19
+ const text = await fs.readFile(file, 'utf8');
20
+ return JSON.parse(text) as Catalog;
21
+ } catch {
22
+ return {};
23
+ }
24
+ }
25
+
26
+ async function writeCatalog(file: string, catalog: Catalog): Promise<void> {
27
+ await fs.writeFile(file, JSON.stringify(catalog, null, 2) + '\n', 'utf8');
28
+ }
29
+
30
+ async function translate(text: string, _to: string): Promise<string> {
31
+ // Stub — provider-specific call.
32
+ return text;
33
+ }
34
+
35
+ async function main(): Promise<void> {
36
+ const defaultLocale = process.env.FIMO_DEFAULT_LOCALE ?? 'en';
37
+ const targetLocales = (process.env.FIMO_TARGET_LOCALES ?? '').split(',').filter(Boolean);
38
+ const localesDir = process.env.FIMO_LOCALES_DIR ?? 'src/locales';
39
+
40
+ const defaultFile = path.join(localesDir, `${defaultLocale}.json`);
41
+ const defaultCatalog = await readCatalog(defaultFile);
42
+
43
+ for (const target of targetLocales) {
44
+ const targetFile = path.join(localesDir, `${target}.json`);
45
+ const targetCatalog = await readCatalog(targetFile);
46
+ let dirty = false;
47
+
48
+ for (const [key, sourceValue] of Object.entries(defaultCatalog)) {
49
+ if (targetCatalog[key]) {
50
+ continue;
51
+ }
52
+ targetCatalog[key] = await translate(sourceValue, target);
53
+ dirty = true;
54
+ }
55
+
56
+ if (dirty) {
57
+ await writeCatalog(targetFile, targetCatalog);
58
+ console.log(`Wrote ${targetFile}`);
59
+ }
60
+ }
61
+ }
62
+
63
+ main().catch((err) => {
64
+ console.error(err);
65
+ process.exit(1);
66
+ });
@@ -0,0 +1,23 @@
1
+ # Post-deploy check
2
+
3
+ Run a quick health probe every time the project deploys, and post a
4
+ summary back to the deploy log. Triggered automatically by the
5
+ `deploy.succeeded` event.
6
+
7
+ ## What to do
8
+
9
+ 1. Read the routes the deploy declares as critical (`probe-routes.ts`).
10
+ 2. For each one, fetch and assert that the response is 2xx and renders
11
+ the expected key element (a known DOM selector).
12
+ 3. Read the last 5 minutes of production logs (`check-logs.ts`) and
13
+ surface any errors emitted during the deploy window.
14
+ 4. Write a single-line summary to stdout that the deploy notification
15
+ includes verbatim. Examples:
16
+ - `✅ 12 routes pass · 0 errors`
17
+ - `❌ /pricing failed (500) · 3 errors in last 5min`
18
+
19
+ ## What NOT to do
20
+
21
+ - Don't roll back the deploy — that's a separate human-in-the-loop
22
+ decision; this agent only reports.
23
+ - Don't write to CMS or files. Read-only probes plus log reads.
@@ -0,0 +1,2 @@
1
+ - net:fetch
2
+ - fimo:logs:read
@@ -0,0 +1,9 @@
1
+ version: 1
2
+ description: 'Probe routes and inspect logs after a deploy; report any issues to email recipients.'
3
+ data_sources:
4
+ - prod
5
+
6
+ triggers:
7
+ - type: manual
8
+ - type: webhook
9
+ path: deploy-done