inlaycms 0.0.0-stage → 0.1.0

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 (364) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +462 -2
  3. package/assets/admin/admin.css +2 -0
  4. package/assets/admin/admin.js +1 -0
  5. package/assets/admin/editor.js +125 -0
  6. package/dist/adapters/admin/activity.d.ts +17 -0
  7. package/dist/adapters/admin/activity.js +59 -0
  8. package/dist/adapters/admin/assets.d.ts +14 -0
  9. package/dist/adapters/admin/assets.js +64 -0
  10. package/dist/adapters/admin/attention.d.ts +15 -0
  11. package/dist/adapters/admin/attention.js +34 -0
  12. package/dist/adapters/admin/context.d.ts +40 -0
  13. package/dist/adapters/admin/context.js +142 -0
  14. package/dist/adapters/admin/form/walk.d.ts +61 -0
  15. package/dist/adapters/admin/form/walk.js +565 -0
  16. package/dist/adapters/admin/pages.d.ts +38 -0
  17. package/dist/adapters/admin/pages.js +66 -0
  18. package/dist/adapters/admin/publish.d.ts +12 -0
  19. package/dist/adapters/admin/publish.js +195 -0
  20. package/dist/adapters/admin/routes.d.ts +47 -0
  21. package/dist/adapters/admin/routes.js +255 -0
  22. package/dist/adapters/admin/screens/backups.d.ts +11 -0
  23. package/dist/adapters/admin/screens/backups.js +223 -0
  24. package/dist/adapters/admin/screens/dashboard.d.ts +4 -0
  25. package/dist/adapters/admin/screens/dashboard.js +160 -0
  26. package/dist/adapters/admin/screens/editor.d.ts +67 -0
  27. package/dist/adapters/admin/screens/editor.js +416 -0
  28. package/dist/adapters/admin/screens/history.d.ts +4 -0
  29. package/dist/adapters/admin/screens/history.js +105 -0
  30. package/dist/adapters/admin/screens/lists.d.ts +4 -0
  31. package/dist/adapters/admin/screens/lists.js +297 -0
  32. package/dist/adapters/admin/screens/media.d.ts +20 -0
  33. package/dist/adapters/admin/screens/media.js +186 -0
  34. package/dist/adapters/admin/screens/pickers.d.ts +29 -0
  35. package/dist/adapters/admin/screens/pickers.js +134 -0
  36. package/dist/adapters/admin/screens/preview-pane.d.ts +10 -0
  37. package/dist/adapters/admin/screens/preview-pane.js +74 -0
  38. package/dist/adapters/admin/screens/redirects.d.ts +4 -0
  39. package/dist/adapters/admin/screens/redirects.js +137 -0
  40. package/dist/adapters/admin/screens/releases.d.ts +7 -0
  41. package/dist/adapters/admin/screens/releases.js +287 -0
  42. package/dist/adapters/admin/screens/search.d.ts +22 -0
  43. package/dist/adapters/admin/screens/search.js +113 -0
  44. package/dist/adapters/admin/screens/security.d.ts +4 -0
  45. package/dist/adapters/admin/screens/security.js +85 -0
  46. package/dist/adapters/admin/screens/users.d.ts +4 -0
  47. package/dist/adapters/admin/screens/users.js +330 -0
  48. package/dist/adapters/admin/theme.d.ts +1 -0
  49. package/dist/adapters/admin/theme.js +1 -0
  50. package/dist/adapters/admin/translations.d.ts +16 -0
  51. package/dist/adapters/admin/translations.js +23 -0
  52. package/dist/adapters/admin/upload.d.ts +8 -0
  53. package/dist/adapters/admin/upload.js +116 -0
  54. package/dist/adapters/admin/views/data-table.d.ts +82 -0
  55. package/dist/adapters/admin/views/data-table.js +117 -0
  56. package/dist/adapters/admin/views/icons.d.ts +48 -0
  57. package/dist/adapters/admin/views/icons.js +47 -0
  58. package/dist/adapters/admin/views/layout.d.ts +51 -0
  59. package/dist/adapters/admin/views/layout.js +145 -0
  60. package/dist/adapters/admin/views/sheet.d.ts +15 -0
  61. package/dist/adapters/admin/views/sheet.js +6 -0
  62. package/dist/adapters/admin/views/status.d.ts +32 -0
  63. package/dist/adapters/admin/views/status.js +74 -0
  64. package/dist/adapters/auth/handler.d.ts +10 -0
  65. package/dist/adapters/auth/handler.js +63 -0
  66. package/dist/adapters/auth/request.d.ts +8 -0
  67. package/dist/adapters/auth/request.js +14 -0
  68. package/dist/adapters/cli/bin.d.ts +2 -0
  69. package/dist/adapters/cli/bin.js +42 -0
  70. package/dist/adapters/cli/main.d.ts +7 -0
  71. package/dist/adapters/cli/main.js +982 -0
  72. package/dist/adapters/cli/remote.d.ts +52 -0
  73. package/dist/adapters/cli/remote.js +161 -0
  74. package/dist/adapters/mcp/agent-refs.d.ts +9 -0
  75. package/dist/adapters/mcp/agent-refs.js +25 -0
  76. package/dist/adapters/mcp/documents.d.ts +15 -0
  77. package/dist/adapters/mcp/documents.js +26 -0
  78. package/dist/adapters/mcp/fetch-url.d.ts +19 -0
  79. package/dist/adapters/mcp/fetch-url.js +244 -0
  80. package/dist/adapters/mcp/request-state.d.ts +15 -0
  81. package/dist/adapters/mcp/request-state.js +38 -0
  82. package/dist/adapters/mcp/results.d.ts +20 -0
  83. package/dist/adapters/mcp/results.js +61 -0
  84. package/dist/adapters/mcp/route.d.ts +34 -0
  85. package/dist/adapters/mcp/route.js +52 -0
  86. package/dist/adapters/mcp/server.d.ts +44 -0
  87. package/dist/adapters/mcp/server.js +49 -0
  88. package/dist/adapters/mcp/tools/history.d.ts +5 -0
  89. package/dist/adapters/mcp/tools/history.js +84 -0
  90. package/dist/adapters/mcp/tools/media.d.ts +5 -0
  91. package/dist/adapters/mcp/tools/media.js +102 -0
  92. package/dist/adapters/mcp/tools/publish.d.ts +5 -0
  93. package/dist/adapters/mcp/tools/publish.js +157 -0
  94. package/dist/adapters/mcp/tools/read.d.ts +5 -0
  95. package/dist/adapters/mcp/tools/read.js +279 -0
  96. package/dist/adapters/mcp/tools/redirects.d.ts +5 -0
  97. package/dist/adapters/mcp/tools/redirects.js +74 -0
  98. package/dist/adapters/mcp/tools/write.d.ts +5 -0
  99. package/dist/adapters/mcp/tools/write.js +304 -0
  100. package/dist/adapters/site/backup-schedule.d.ts +8 -0
  101. package/dist/adapters/site/backup-schedule.js +31 -0
  102. package/dist/adapters/site/cache.d.ts +29 -0
  103. package/dist/adapters/site/cache.js +63 -0
  104. package/dist/adapters/site/context.d.ts +29 -0
  105. package/dist/adapters/site/context.js +278 -0
  106. package/dist/adapters/site/head.d.ts +23 -0
  107. package/dist/adapters/site/head.js +44 -0
  108. package/dist/adapters/site/limiter.d.ts +17 -0
  109. package/dist/adapters/site/limiter.js +39 -0
  110. package/dist/adapters/site/lock.d.ts +30 -0
  111. package/dist/adapters/site/lock.js +143 -0
  112. package/dist/adapters/site/media-routes.d.ts +4 -0
  113. package/dist/adapters/site/media-routes.js +55 -0
  114. package/dist/adapters/site/plugin.d.ts +122 -0
  115. package/dist/adapters/site/plugin.js +436 -0
  116. package/dist/adapters/site/preview.d.ts +36 -0
  117. package/dist/adapters/site/preview.js +82 -0
  118. package/dist/adapters/site/public.d.ts +6 -0
  119. package/dist/adapters/site/public.js +87 -0
  120. package/dist/adapters/site/render.d.ts +45 -0
  121. package/dist/adapters/site/render.js +191 -0
  122. package/dist/adapters/site/routes.d.ts +17 -0
  123. package/dist/adapters/site/routes.js +125 -0
  124. package/dist/adapters/site/sitemap.d.ts +10 -0
  125. package/dist/adapters/site/sitemap.js +10 -0
  126. package/dist/adapters/web.d.ts +22 -0
  127. package/dist/adapters/web.js +75 -0
  128. package/dist/config.d.ts +21 -0
  129. package/dist/config.js +58 -0
  130. package/dist/core/agent/format.d.ts +62 -0
  131. package/dist/core/agent/format.js +211 -0
  132. package/dist/core/agent/schema.d.ts +6 -0
  133. package/dist/core/agent/schema.js +86 -0
  134. package/dist/core/archive.d.ts +12 -0
  135. package/dist/core/archive.js +72 -0
  136. package/dist/core/auth/auth.d.ts +4911 -0
  137. package/dist/core/auth/auth.js +61 -0
  138. package/dist/core/auth/roles.d.ts +10 -0
  139. package/dist/core/auth/roles.js +38 -0
  140. package/dist/core/auth/service.d.ts +118 -0
  141. package/dist/core/auth/service.js +424 -0
  142. package/dist/core/auth/upload-token.d.ts +8 -0
  143. package/dist/core/auth/upload-token.js +27 -0
  144. package/dist/core/backup/backup.d.ts +28 -0
  145. package/dist/core/backup/backup.js +126 -0
  146. package/dist/core/backup/restore.d.ts +41 -0
  147. package/dist/core/backup/restore.js +264 -0
  148. package/dist/core/backup/schedule.d.ts +12 -0
  149. package/dist/core/backup/schedule.js +29 -0
  150. package/dist/core/boot.d.ts +63 -0
  151. package/dist/core/boot.js +141 -0
  152. package/dist/core/check.d.ts +32 -0
  153. package/dist/core/check.js +111 -0
  154. package/dist/core/content/activity.d.ts +8 -0
  155. package/dist/core/content/activity.js +101 -0
  156. package/dist/core/content/delete.d.ts +5 -0
  157. package/dist/core/content/delete.js +100 -0
  158. package/dist/core/content/diff.d.ts +6 -0
  159. package/dist/core/content/diff.js +129 -0
  160. package/dist/core/content/dry-run.d.ts +24 -0
  161. package/dist/core/content/dry-run.js +69 -0
  162. package/dist/core/content/gaps.d.ts +25 -0
  163. package/dist/core/content/gaps.js +50 -0
  164. package/dist/core/content/hidden.d.ts +33 -0
  165. package/dist/core/content/hidden.js +103 -0
  166. package/dist/core/content/history.d.ts +15 -0
  167. package/dist/core/content/history.js +62 -0
  168. package/dist/core/content/patch.d.ts +40 -0
  169. package/dist/core/content/patch.js +287 -0
  170. package/dist/core/content/path.d.ts +6 -0
  171. package/dist/core/content/path.js +38 -0
  172. package/dist/core/content/publish.d.ts +26 -0
  173. package/dist/core/content/publish.js +211 -0
  174. package/dist/core/content/read.d.ts +99 -0
  175. package/dist/core/content/read.js +141 -0
  176. package/dist/core/content/reader.d.ts +37 -0
  177. package/dist/core/content/reader.js +195 -0
  178. package/dist/core/content/refs.d.ts +44 -0
  179. package/dist/core/content/refs.js +161 -0
  180. package/dist/core/content/release-migrations.d.ts +12 -0
  181. package/dist/core/content/release-migrations.js +154 -0
  182. package/dist/core/content/save.d.ts +25 -0
  183. package/dist/core/content/save.js +87 -0
  184. package/dist/core/content/schema.d.ts +22 -0
  185. package/dist/core/content/schema.js +127 -0
  186. package/dist/core/content/search.d.ts +8 -0
  187. package/dist/core/content/search.js +89 -0
  188. package/dist/core/content/shipped-input.d.ts +39 -0
  189. package/dist/core/content/shipped-input.js +221 -0
  190. package/dist/core/content/shipped.d.ts +112 -0
  191. package/dist/core/content/shipped.js +437 -0
  192. package/dist/core/content/slug.d.ts +23 -0
  193. package/dist/core/content/slug.js +182 -0
  194. package/dist/core/content/stats.d.ts +11 -0
  195. package/dist/core/content/stats.js +30 -0
  196. package/dist/core/content/translate.d.ts +3 -0
  197. package/dist/core/content/translate.js +68 -0
  198. package/dist/core/content/usages.d.ts +13 -0
  199. package/dist/core/content/usages.js +70 -0
  200. package/dist/core/content/validate.d.ts +21 -0
  201. package/dist/core/content/validate.js +124 -0
  202. package/dist/core/content/write.d.ts +10 -0
  203. package/dist/core/content/write.js +93 -0
  204. package/dist/core/core.d.ts +227 -0
  205. package/dist/core/core.js +251 -0
  206. package/dist/core/db/connection.d.ts +6 -0
  207. package/dist/core/db/connection.js +12 -0
  208. package/dist/core/db/migrate.d.ts +9 -0
  209. package/dist/core/db/migrate.js +42 -0
  210. package/dist/core/db/migrations/0001_content.d.ts +2 -0
  211. package/dist/core/db/migrations/0001_content.js +69 -0
  212. package/dist/core/db/migrations/0002_media.d.ts +2 -0
  213. package/dist/core/db/migrations/0002_media.js +26 -0
  214. package/dist/core/db/migrations/0003_redirects.d.ts +2 -0
  215. package/dist/core/db/migrations/0003_redirects.js +19 -0
  216. package/dist/core/db/migrations/0004_token_cutoffs.d.ts +3 -0
  217. package/dist/core/db/migrations/0004_token_cutoffs.js +8 -0
  218. package/dist/core/db/migrations/0005_site_lock.d.ts +3 -0
  219. package/dist/core/db/migrations/0005_site_lock.js +10 -0
  220. package/dist/core/db/migrations/0006_releases.d.ts +3 -0
  221. package/dist/core/db/migrations/0006_releases.js +34 -0
  222. package/dist/core/db/schema.d.ts +155 -0
  223. package/dist/core/db/schema.js +1 -0
  224. package/dist/core/errors.d.ts +27 -0
  225. package/dist/core/errors.js +15 -0
  226. package/dist/core/export/export.d.ts +17 -0
  227. package/dist/core/export/export.js +185 -0
  228. package/dist/core/export/format.d.ts +241 -0
  229. package/dist/core/export/format.js +106 -0
  230. package/dist/core/export/import.d.ts +54 -0
  231. package/dist/core/export/import.js +180 -0
  232. package/dist/core/export/read.d.ts +16 -0
  233. package/dist/core/export/read.js +234 -0
  234. package/dist/core/export/replace.d.ts +17 -0
  235. package/dist/core/export/replace.js +36 -0
  236. package/dist/core/export/report.d.ts +55 -0
  237. package/dist/core/export/report.js +50 -0
  238. package/dist/core/export/schema.d.ts +8 -0
  239. package/dist/core/export/schema.js +47 -0
  240. package/dist/core/export/stage.d.ts +25 -0
  241. package/dist/core/export/stage.js +192 -0
  242. package/dist/core/fields/builtins.d.ts +70 -0
  243. package/dist/core/fields/builtins.js +335 -0
  244. package/dist/core/fields/define.d.ts +86 -0
  245. package/dist/core/fields/define.js +34 -0
  246. package/dist/core/fields/walk.d.ts +49 -0
  247. package/dist/core/fields/walk.js +270 -0
  248. package/dist/core/fields/widgets.d.ts +27 -0
  249. package/dist/core/fields/widgets.js +330 -0
  250. package/dist/core/fields/zod-internals.d.ts +29 -0
  251. package/dist/core/fields/zod-internals.js +28 -0
  252. package/dist/core/media/detect.d.ts +5 -0
  253. package/dist/core/media/detect.js +66 -0
  254. package/dist/core/media/labels.d.ts +6 -0
  255. package/dist/core/media/labels.js +17 -0
  256. package/dist/core/media/library.d.ts +45 -0
  257. package/dist/core/media/library.js +239 -0
  258. package/dist/core/media/store.d.ts +11 -0
  259. package/dist/core/media/store.js +49 -0
  260. package/dist/core/media/variants.d.ts +10 -0
  261. package/dist/core/media/variants.js +59 -0
  262. package/dist/core/messages/en.d.ts +1278 -0
  263. package/dist/core/messages/en.js +1287 -0
  264. package/dist/core/messages/index.d.ts +7 -0
  265. package/dist/core/messages/index.js +14 -0
  266. package/dist/core/preview.d.ts +16 -0
  267. package/dist/core/preview.js +42 -0
  268. package/dist/core/redirects/collapse.d.ts +68 -0
  269. package/dist/core/redirects/collapse.js +153 -0
  270. package/dist/core/redirects/csv.d.ts +15 -0
  271. package/dist/core/redirects/csv.js +68 -0
  272. package/dist/core/redirects/redirects.d.ts +58 -0
  273. package/dist/core/redirects/redirects.js +545 -0
  274. package/dist/core/registry/content.d.ts +26 -0
  275. package/dist/core/registry/content.js +9 -0
  276. package/dist/core/registry/define.d.ts +145 -0
  277. package/dist/core/registry/define.js +41 -0
  278. package/dist/core/registry/migration.d.ts +44 -0
  279. package/dist/core/registry/migration.js +4 -0
  280. package/dist/core/registry/registry.d.ts +18 -0
  281. package/dist/core/registry/registry.js +255 -0
  282. package/dist/core/registry/render.d.ts +98 -0
  283. package/dist/core/registry/render.js +1 -0
  284. package/dist/core/registry/route.d.ts +42 -0
  285. package/dist/core/registry/route.js +3 -0
  286. package/dist/core/release/bundle.d.ts +21 -0
  287. package/dist/core/release/bundle.js +252 -0
  288. package/dist/core/release/keys.d.ts +11 -0
  289. package/dist/core/release/keys.js +60 -0
  290. package/dist/core/release/manifest.d.ts +103 -0
  291. package/dist/core/release/manifest.js +138 -0
  292. package/dist/core/release/pack.d.ts +20 -0
  293. package/dist/core/release/pack.js +97 -0
  294. package/dist/core/release/pointer.d.ts +19 -0
  295. package/dist/core/release/pointer.js +53 -0
  296. package/dist/core/release/read.d.ts +59 -0
  297. package/dist/core/release/read.js +256 -0
  298. package/dist/core/report.d.ts +31 -0
  299. package/dist/core/report.js +37 -0
  300. package/dist/core/richtext/html.d.ts +15 -0
  301. package/dist/core/richtext/html.js +81 -0
  302. package/dist/core/richtext/markdown.d.ts +19 -0
  303. package/dist/core/richtext/markdown.js +951 -0
  304. package/dist/core/richtext/schema.d.ts +98 -0
  305. package/dist/core/richtext/schema.js +275 -0
  306. package/dist/core/site/live.d.ts +56 -0
  307. package/dist/core/site/live.js +145 -0
  308. package/dist/core/site/paths.d.ts +15 -0
  309. package/dist/core/site/paths.js +64 -0
  310. package/dist/core/site/resolve.d.ts +9 -0
  311. package/dist/core/site/resolve.js +202 -0
  312. package/dist/core/site/sitemap.d.ts +11 -0
  313. package/dist/core/site/sitemap.js +24 -0
  314. package/dist/core/site-lock/site-lock.d.ts +21 -0
  315. package/dist/core/site-lock/site-lock.js +65 -0
  316. package/dist/core/site-lock/token.d.ts +7 -0
  317. package/dist/core/site-lock/token.js +24 -0
  318. package/dist/core/theme.d.ts +22 -0
  319. package/dist/core/theme.js +133 -0
  320. package/dist/core/types.d.ts +253 -0
  321. package/dist/core/types.js +1 -0
  322. package/dist/core/version.d.ts +1 -0
  323. package/dist/core/version.js +5 -0
  324. package/dist/host/activate.d.ts +53 -0
  325. package/dist/host/activate.js +162 -0
  326. package/dist/host/app.d.ts +46 -0
  327. package/dist/host/app.js +129 -0
  328. package/dist/host/bin.d.ts +5 -0
  329. package/dist/host/bin.js +8 -0
  330. package/dist/host/config.d.ts +36 -0
  331. package/dist/host/config.js +152 -0
  332. package/dist/host/dev.d.ts +10 -0
  333. package/dist/host/dev.js +293 -0
  334. package/dist/host/diff.d.ts +78 -0
  335. package/dist/host/diff.js +346 -0
  336. package/dist/host/hooks.d.ts +41 -0
  337. package/dist/host/hooks.js +49 -0
  338. package/dist/host/ipc.d.ts +123 -0
  339. package/dist/host/ipc.js +61 -0
  340. package/dist/host/preview-proxy.d.ts +24 -0
  341. package/dist/host/preview-proxy.js +154 -0
  342. package/dist/host/preview-worker.d.ts +42 -0
  343. package/dist/host/preview-worker.js +242 -0
  344. package/dist/host/primary.d.ts +38 -0
  345. package/dist/host/primary.js +357 -0
  346. package/dist/host/push.d.ts +125 -0
  347. package/dist/host/push.js +420 -0
  348. package/dist/host/serve.d.ts +16 -0
  349. package/dist/host/serve.js +150 -0
  350. package/dist/host/store.d.ts +48 -0
  351. package/dist/host/store.js +109 -0
  352. package/dist/host/worker.d.ts +67 -0
  353. package/dist/host/worker.js +310 -0
  354. package/dist/index.d.ts +47 -0
  355. package/dist/index.js +32 -0
  356. package/dist/jsx/html.d.ts +16 -0
  357. package/dist/jsx/html.js +65 -0
  358. package/dist/jsx/jsx-dev-runtime.d.ts +4 -0
  359. package/dist/jsx/jsx-dev-runtime.js +5 -0
  360. package/dist/jsx/jsx-runtime.d.ts +17 -0
  361. package/dist/jsx/jsx-runtime.js +41 -0
  362. package/dist/site.d.ts +17 -0
  363. package/dist/site.js +14 -0
  364. package/package.json +111 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Don Stephan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,463 @@
1
- # Temporary Holding Version
1
+ # inlay
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Inlay is a CMS for content sites. You build the site in code: its templates, the blocks they're made of, its collections, site-wide content and languages. The site's owner fills in the content, in the slots you cut for it. Everything lives in one SQLite file. Inlay is the whole server: you pack the site into a signed release, push it to a host running `inlaycms serve`, preview it on the live content and activate it when it's ready.
4
+
5
+ ## Why we made it
6
+
7
+ The CMSs we tried all sat at the wrong point:
8
+
9
+ - **Schema in the database** (WordPress-style systems, Directus). The content model is reshaped at runtime, so rebuilding a site from code means replaying seed files, and editors and plugins can move the walls.
10
+ - **App frameworks** (Payload, Strapi). The right model, with the schema in code, but heavy: you end up building a whole app.
11
+ - **Git- or file-based** (Keystatic, Tina, Decap). Also the right model, but too light: there's no real server, so no history, no sign-in, and nothing for an assistant to talk to.
12
+
13
+ Inlay sits between them. Templates and schema are code, the database only ever holds content, and the server is real enough to provide history, drafts and publishing, accounts, backups and an MCP server.
14
+
15
+ That last one matters most. We expect most owners to run their site by talking to an AI assistant: "change the home page headline", "write a post from these notes", "translate About into Spanish". The admin is for looking, checking and fixing, and has full hand-editing as the fallback. The goal is a site a non-technical owner can run mostly through an assistant, without ever being able to break the design the developer built.
16
+
17
+ A few things follow from that:
18
+
19
+ - **No page builder.** Editors fill slots. They never rearrange the layout or add sections, so every arrangement a page can take is one the developer designed.
20
+ - **Problems are caught before deploy.** `inlaycms check` tells you whether the content fits new site code before you ship it, rather than a running site finding out.
21
+ - **The site belongs to its owner.** It runs on their server, with their data and their backups, and the export format is documented well enough to read without Inlay.
22
+ - **One install per site.** An agency with ten clients runs ten installs, and can come back months later to push an update.
23
+
24
+ ## Quickstart
25
+
26
+ Inlay needs Node 24 or newer, and Fastify 5. Or skip Node altogether and run every command through the Docker image: see [Without Node: the Docker image](#without-node-the-docker-image).
27
+
28
+ ```sh
29
+ npm install inlaycms fastify
30
+ npm install --save-dev typescript
31
+ ```
32
+
33
+ TypeScript is optional: `inlaycms pack` type-checks the site when it's installed. The CLI loads the site's TypeScript and JSX itself, so no loader such as tsx is needed.
34
+
35
+ Templates render with JSX, so point your `tsconfig.json` at Inlay's runtime. Inlay bundles the site's code itself, so type-check it as bundled code, which also needs no `"type": "module"` in `package.json`:
36
+
37
+ ```json
38
+ {
39
+ "compilerOptions": {
40
+ "module": "preserve",
41
+ "moduleResolution": "bundler",
42
+ "jsx": "react-jsx",
43
+ "jsxImportSource": "inlaycms",
44
+ "strict": true
45
+ }
46
+ }
47
+ ```
48
+
49
+ Define the site in `site.tsx`. A template says which fields a page has and how it renders, and a singleton is one page built from it:
50
+
51
+ ```tsx
52
+ import { defineContent, defineSingleton, defineSite, defineTemplate, f, z } from 'inlaycms/site'
53
+
54
+ const Page = defineTemplate({
55
+ name: 'page',
56
+ label: 'Page',
57
+ fields: z.object({
58
+ title: f.text({ label: 'Title' }),
59
+ body: f.richText({ label: 'Body' }),
60
+ }),
61
+ render: ({ fields }, ctx) => (
62
+ <html lang={ctx.locale}>
63
+ <body>
64
+ <h1>{fields.title}</h1>
65
+ {ctx.richText(fields.body)}
66
+ </body>
67
+ </html>
68
+ ),
69
+ })
70
+
71
+ export const site = defineSite({
72
+ locales: ['en'],
73
+ defaultLocale: 'en',
74
+ singletons: [
75
+ defineSingleton({
76
+ name: 'home',
77
+ label: 'Home page',
78
+ help: 'The front page of the site.',
79
+ template: Page,
80
+ path: '/',
81
+ }),
82
+ ],
83
+ content: [
84
+ defineContent('home', {
85
+ edition: 1,
86
+ content: { en: { fields: { title: 'Hello', body: 'Your first page. Ask your assistant to change it.' } } },
87
+ }),
88
+ ],
89
+ })
90
+ ```
91
+
92
+ Labels and `help` are what editors and their assistants see, so write them for the owner, not for yourself. `content` is the content shipped with the site: `defineContent` for a singleton or global, `defineEntries` for a collection's entries, each with a stable `key`. Bump an `edition` to replace what the client has with the new shipped content; an equal or lower edition leaves their edits alone. Collections, globals, blocks, slots and more languages work the same way. `example/site.tsx` uses all of them.
93
+
94
+ Point Inlay at it with `inlay.config.ts`, next to `site.tsx`:
95
+
96
+ ```ts
97
+ import { defineConfig } from 'inlaycms/site'
98
+ import { site } from './site.js'
99
+
100
+ export default defineConfig({ site })
101
+ ```
102
+
103
+ Then run it from source:
104
+
105
+ ```sh
106
+ npx inlaycms dev
107
+ ```
108
+
109
+ `inlaycms dev` serves the site at `http://localhost:3000` (`--port` changes the port, `--config` the config file) and restarts it whenever you save a file in the site's folder. Its database, media and backups go in `data/` next to the config file; keep that folder out of git. It needs no settings: `INLAY_BASE_URL` defaults to the local address and `INLAY_SECRET` to a fixed development value, and any other `INLAY_` setting from [Running a host](#running-a-host) can still be set. Set the secrets the site declares in the environment, as on a host.
110
+
111
+ On each start, Inlay brings the database up to date and applies the shipped content: documents that don't exist yet are created, and ones with a newer edition are replaced. Stored content is read against the current code: values that fit are used and the rest take their defaults, so a schema change never stops the site from starting. Open `http://localhost:3000` for the site and `http://localhost:3000/admin` to create the owner account.
112
+
113
+ To put the site online, pack it into a release and run it on a host with `inlaycms serve`: see [Packing a release](#packing-a-release) and [Running a host](#running-a-host).
114
+
115
+ ### The CLI
116
+
117
+ The commands that work on a site's code or database (`check`, `backup`, `export`, `import`, `restore-backup`, `create-owner`, `create-token`, `reset-password`, `keygen`, `pack`, `push`) read `inlay.config.ts` (or `.js`, `.mjs`) in the current directory, or the file given with `--config`. On a host, which has no config file, `backup`, `export`, `import`, `restore-backup`, `create-owner`, `create-token` and `reset-password` work on its data folder instead (see [Running a host](#running-a-host)):
118
+
119
+ ```ts
120
+ import { defineConfig } from 'inlaycms/site'
121
+ import { site } from './site.js'
122
+
123
+ export default defineConfig({ site, db: './data/inlay.db' })
124
+ ```
125
+
126
+ Paths in it are relative to the config file.
127
+
128
+ ```sh
129
+ npx inlaycms check
130
+ ```
131
+
132
+ Run `inlaycms check` before every deploy. When the config's database doesn't exist yet, as in a fresh checkout or CI, it checks the code alone; `--db` names a database it must check against. `npx inlaycms --help` lists every command and option.
133
+
134
+ ### Packing a release
135
+
136
+ A release is your whole site in one signed file: the bundled site code, the shipped content and its images, and the files in `public/`. Secret values are never in it; it lists only the secret names the site declares (`secrets` in `defineSite`), and the host provides the values.
137
+
138
+ Make a signing key pair once, on the machine you release from:
139
+
140
+ ```sh
141
+ npx inlaycms keygen --out keys --name release
142
+ ```
143
+
144
+ This writes `keys/release.key` (the private key: keep it secret and out of the repo) and `keys/release.pub`, a one-line public key such as `ed25519:...`. Give the public key to every host that should run your releases: a host only accepts a release whose signature verifies against one of its trusted keys, and refuses it before reading anything else in it.
145
+
146
+ Then pack:
147
+
148
+ ```sh
149
+ npx inlaycms pack --key keys/release.key --out release.tgz
150
+ ```
151
+
152
+ `pack` type-checks the site first when a `tsconfig.json` sits next to the config (`--no-typecheck` skips that). The key can also come from `INLAY_SIGNING_KEY`, as the key itself or a path to it.
153
+
154
+ Site code imports Inlay from `inlaycms/site` (and JSX from `inlaycms/jsx-runtime`), never from `inlaycms` itself, which is the host's side. `pack` refuses a site that imports anything else it can't bundle, such as Node's built-in modules or `inlaycms`, and site code that uses `process`, `require`, `eval` or `Function` (also as `globalThis.eval` and the like) or an `import()` of a computed name. An `import()` of a template under a relative folder, such as ``import(`./locales/${lang}.js`)``, is fine: every matching file is bundled. Those checks catch mistakes; they don't make a release safe to run. What makes a release trusted is its signature: a host runs only releases signed with a key it trusts, so trust a key only if you trust everyone who can sign with it.
155
+
156
+ The example site in `example/` commits a key pair in `example/keys/` (`dev.key`, `dev.pub`) so `pnpm run example:pack` works out of the box. It is for development only: never trust `example/keys/dev.pub` on a real host.
157
+
158
+ ### Running a host
159
+
160
+ `inlaycms serve` runs the site and the admin from a data folder, with its settings in `INLAY_` environment variables: `INLAY_DATA_DIR` (the folder holding `inlay.db`, `media/`, `backups/` and `releases/`), `INLAY_BASE_URL`, `INLAY_SECRET` (32 characters or more) and `INLAY_TRUSTED_KEYS` (the public keys whose releases it accepts; or `INLAY_TRUSTED_KEYS_FILE`). The secrets a release declares are read from the host's environment by name. The optional ones are `INLAY_PORT` (default 3000), `INLAY_HOST` (default `0.0.0.0`), `INLAY_RATE_LIMIT` (`on` or `off`), `INLAY_TRUST_PROXY` (the reverse proxies to trust; see [Behind a reverse proxy](#behind-a-reverse-proxy)), `INLAY_UPLOAD_MAX_BYTES`, `INLAY_BACKUP_KEEP`, `INLAY_PUBLIC_MAX_AGE`, `INLAY_CDN_MAX_AGE` and `INLAY_CDN_STALE_IF_ERROR`.
161
+
162
+ ```sh
163
+ export INLAY_DATA_DIR=/srv/inlay INLAY_BASE_URL=https://example.com
164
+ export INLAY_SECRET="$(cat /etc/inlay/secret)" INLAY_TRUSTED_KEYS="$(cat release.pub)"
165
+ npx inlaycms activate release.tgz # the first release, while the server is stopped
166
+ npx inlaycms serve
167
+ ```
168
+
169
+ `serve` runs the live release in a worker process and keeps the database untouched at start: shipped content is applied only when a release is activated. With no release yet, the site shows a plain "no site yet" page (status 200, not indexed) and the admin works. When a live site can't be served (its release is missing from the data folder, needs another version of Inlay, or keeps crashing), visitors get a "temporarily unavailable" page instead, with status 503 and `Retry-After`, so search engines keep the site; the admin still works. A worker that crashes is started again. On SIGTERM or SIGINT it finishes the requests in flight, closes the database and exits.
170
+
171
+ The Docker image (`Dockerfile`, also the CLI: see [Without Node: the Docker image](#without-node-the-docker-image)) runs `inlaycms serve` with `INLAY_DATA_DIR=/data` on a volume and port 3000: `docker compose up serve` with `INLAY_SECRET` and `INLAY_TRUSTED_KEYS` set in your shell. Run `inlaycms activate` in the same container to give it its first release. The release file must be inside the container, so mount it: `docker compose run --rm -v "$PWD/release.tgz:/release.tgz:ro" serve inlaycms activate /release.tgz`. The image holds the packed `inlaycms` with its production dependencies only, with `inlaycms` on the `PATH`.
172
+
173
+ To give a host its first release, or to make a release live while it is stopped:
174
+
175
+ ```sh
176
+ npx inlaycms activate release.tgz [--data <dir>] [--name <name>]
177
+ npx inlaycms activate <release-id>
178
+ npx inlaycms releases [--data <dir>] [--json]
179
+ ```
180
+
181
+ `activate` with a file stores the release (its signature must verify against a trusted key) and makes it live; with an ID it makes a release already on the host live again, which is how you roll back. A release made for another version of Inlay is refused. It applies the release's shipped content, runs its migration functions and prints what it did; a backup is taken first when the site has content (and before the database structure is updated, when this version of Inlay needs to). A shipped slug or path that is already taken doesn't stop it: the document keeps the slug and path it had (a new one gets a free slug and no path of its own), and a warning says so; `inlaycms check` reports these as problems. Activation writes its changes in one database transaction that locks the database for writing from start to end; the media files the shipped content names are stored before it starts, but the release's migration functions run inside it. While it runs, saves in the admin wait up to 5 seconds and then fail, so keep migration functions quick and activate when few people are editing. It uses the same environment as `serve`, and `--data` stands in for `INLAY_DATA_DIR`. Stop the server first: a running server wouldn't see the change, so `activate` refuses while the database looks in use (see [Backups from the command line](#backups-from-the-command-line)); add `--server-stopped` if the server crashed and left files behind. `releases` lists every release on the host with its ID, name, state and when it was pushed and made live; it needs only the data folder and works while the server runs.
182
+
183
+ On a host, `backup`, `export`, `import`, `restore-backup`, `create-owner`, `create-token` and `reset-password` take the data folder from `--data <dir>`, or from `INLAY_DATA_DIR` when there's no config file in the current directory, and need no config file. When both are there, the command says which one it uses. `export`, `import` and `create-owner` use the site of the live release; `import` refuses when there is none.
184
+
185
+ ### Deploying
186
+
187
+ Once a host is running, send it releases from your machine or CI with `inlaycms push`, which needs a push token: an owner's API key that may push releases. An owner makes one in the admin (an API key with "Can push releases" turned on), or on the host with the CLI, which prints the key once (alone on standard output, so a script can capture it) and works whether the server is running or not:
188
+
189
+ ```sh
190
+ npx inlaycms create-token --email owner@example.com --name ci --push [--data <dir>]
191
+ ```
192
+
193
+ Then push:
194
+
195
+ ```sh
196
+ export INLAY_PUSH_TOKEN=... # or --token <token>
197
+ npx inlaycms push https://example.com --key keys/release.key
198
+ ```
199
+
200
+ `push` packs the site into a temporary file (as `pack` does, type check included; `--key` or `INLAY_SIGNING_KEY`, `--name`, `--no-typecheck`), or sends the release file given with `--file`. The host checks its signature, the Inlay version and the secrets it needs, keeps it as staged (not live yet) and answers with what it would change, which `push` prints one line per item: content types, slots, languages and fields added or removed (removed content is hidden, never deleted), the published documents a new required field leaves with a gap, the shipped documents it will create or replace, migration functions, routes and secrets. It also warns about shipped content that changed while its edition didn't ("`home` content changed but is still edition 2; it won't be applied"): bump the edition to have it applied. Several releases can be staged at once.
201
+
202
+ A staged release also gets a preview link, which `push` prints: opening it shows the whole site as that release would, on a copy of the live content, for 24 hours, in that browser only. Nothing can be changed in a preview; the admin stays the live site's. Exit the preview at `/_inlay/preview/exit`.
203
+
204
+ Owners can do the same from the admin's **Releases** screen (see [Releases](#releases)): upload a release file, see what it would change, preview it, activate it and delete releases that aren't live.
205
+
206
+ A push runs the release's code on the host straight away, a dry run too: the host starts the release's preview to work out what it would change in your content. So the signature is what stands between the host and the code it runs: only trust keys whose private half you control, and keep that half out of the repository.
207
+
208
+ - `--dry-run` reports the same and keeps nothing on the host. It can't be combined with `--activate`.
209
+ - `--activate` makes the release live right after: the host starts the new release next to the old one and switches over once it is ready, so no request is refused, then prints what activating did. If the connection drops or a proxy gives up before the answer, the push may still have gone through: `push` says so, and `inlaycms releases <host>` shows where things stand.
210
+ - `inlaycms activate <host> <id>` makes a staged or earlier release live. That is also how you roll back: activate the release that was live before.
211
+ - `inlaycms releases <host> [--json]` lists the releases on the host with their IDs and states.
212
+
213
+ All three take the token from `--token` or `INLAY_PUSH_TOKEN`. They exit 1 when the host refuses (printing its reason, such as a release signed with a key it doesn't trust, or a token that may not push) and 2 when the token, signing key or release file is missing. A host address starts with `http://` or `https://`; without one, `activate` and `releases` work offline on the data folder as described above. The token is only sent over plain `http://` to this computer (`localhost`, `127.0.0.1`, `[::1]`), unless you add `--insecure`; and it is never sent on to another address the host redirects to.
214
+
215
+ ### Type-checking your site
216
+
217
+ If your site's `tsconfig.json` has `skipLibCheck: false`, `tsc` reports one error from better-auth's own type files, which Inlay depends on: `Cannot find module 'bun:sqlite'`. It comes from types for running under Bun, has no effect on a Node site, and isn't something your code or Inlay can fix. Leave `skipLibCheck` on (`true`), or ignore that one error.
218
+
219
+ ## Without Node: the Docker image
220
+
221
+ The Inlay image holds the whole CLI as well as the host, so a computer with Docker needs no Node or npm. Build it from this repository with `pnpm run image` (it's tagged `inlaycms`), and install the `inlaycms` script it carries:
222
+
223
+ ```sh
224
+ docker run --rm inlaycms cat /opt/inlaycms/wrapper/inlaycms > ~/.local/bin/inlaycms
225
+ chmod +x ~/.local/bin/inlaycms
226
+ ```
227
+
228
+ Then use `inlaycms` in a site's folder as anywhere else in this README: `inlaycms dev`, `inlaycms check`, `inlaycms pack`, `inlaycms push`. A site needs no `node_modules`: its `inlaycms` imports load the image's copy, and `inlaycms pack` type-checks with the image's TypeScript when the site has a `tsconfig.json`. A site that uses npm packages installs them as usual, with npm or through the image (`docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:$PWD" -w "$PWD" -e HOME=/tmp inlay npm install <package>`).
229
+
230
+ The script runs the image on the current folder, mounted at the same path, so paths mean the same inside and out; files outside the folder aren't visible to the command. What it writes belongs to you. `dev` and `serve` publish their port on this computer only (`127.0.0.1`). Without `INLAY_DATA_DIR`, `dev` and the database commands keep their data in the site folder, as without Docker; with it, that folder is mounted too. Its settings:
231
+
232
+ - `INLAY_IMAGE`: the image to run (default `inlaycms`), such as a tag from a registry.
233
+ - `INLAY_DOCKER_ARGS`: more `docker run` options, split on spaces. Pass a secret the site declares with `-e CAPTCHA_SECRET`, and reach a server on this computer for `inlaycms push http://localhost:3000` with `--network host`.
234
+ - Every other `INLAY_` variable is passed to the command.
235
+
236
+ The image's default command is `inlaycms serve`, with its data in a volume at `/data` (see [Running a host](#running-a-host)).
237
+
238
+ ### Types in your editor
239
+
240
+ Without `node_modules`, an editor on your computer can't find Inlay's types. Open the site in a dev container on the image instead (VS Code's Dev Containers, or any editor that reads `.devcontainer/devcontainer.json`): the editor runs inside the image, where `inlaycms` resolves from any folder.
241
+
242
+ ```json
243
+ {
244
+ "name": "Inlay site",
245
+ "image": "inlaycms",
246
+ "containerEnv": { "INLAY_DATA_DIR": "" },
247
+ "forwardPorts": [3000]
248
+ }
249
+ ```
250
+
251
+ In its terminal, run `inlaycms dev` and the other commands directly, without the script. Or install `inlaycms` with npm only for the types and keep using the image to run it.
252
+
253
+ ## Connect your assistant
254
+
255
+ Editors run the site from an AI assistant such as Claude, through the MCP server at `https://<your-site>/mcp`.
256
+
257
+ 1. **First run.** Open `https://<your-site>/admin`. With no users yet, it sends you to `/admin/setup`, where you create the owner account. On a server without a browser, `inlaycms create-owner --email <email> --name <name>` does the same and reads the password from stdin. If you are locked out of the only owner account, run `inlaycms reset-password --email <email>` on the server to set a new password.
258
+ 2. **Connect.** Add `https://<your-site>/mcp` to your assistant as a custom connector. In Claude Code, that's `claude mcp add --transport http inlay https://<your-site>/mcp`.
259
+ 3. **Log in.** The assistant opens the Inlay login page. Sign in with your Inlay account, then allow the assistant on the consent page. The consent page names the assistant and where it will send you back to, so check both before you allow it.
260
+
261
+ Every change the assistant makes is a draft with a preview link. Nothing goes live until you confirm a publish, either in the assistant or on the confirmation page it links to.
262
+
263
+ `describe_site` tells the assistant the name of the release the site runs and, per type, how many published pages and entries are missing something the site now requires (a required field a release added after they were published). `list_gaps` lists those pages and entries with each missing field, so the assistant can fill them in and publish again. Content a release hid (types or languages the site no longer has) isn't readable over MCP; `describe_type` on such a type says it is hidden. Releases can't be pushed or activated over MCP.
264
+
265
+ The manual check against Claude clients is in `docs/mcp-acceptance.md`.
266
+
267
+ ## Admin
268
+
269
+ The admin lives at `https://<your-site>/admin`. Owners and editors use it to edit pages, entries and site-wide content, preview and publish, look back through history, and manage media and redirects. Owners also manage users, backups and releases there.
270
+
271
+ When a release adds a required field, published content that leaves it empty stays live as it is, but the admin points it out: the dashboard counts it per type ("Missing information on the live site"), lists mark each page or entry with "Needs attention", and the editor says which fields to fill in before publishing again.
272
+
273
+ ### Releases
274
+
275
+ Owners find every release on the host under **Releases**: its name, state (live, ready to activate, previously live or deleted), who pushed it and when, and when it was made live. A release's page shows what it would change against the live release (as `inlaycms push` reports it), the secrets it needs, the key it was signed with and its migration functions; the live release's page also lists the content it hides (types, languages, slots and fields the site no longer has, with how many documents hold them). From there an owner can:
276
+
277
+ - **Upload** a release file, which goes through the same checks as `inlaycms push` (signature, Inlay version, secrets) and is kept as staged. Without the running host (under `inlaycms dev`) the signature and Inlay version are checked on upload, and the secrets when the release is activated. A host with no trusted keys refuses uploads.
278
+ - **Preview** a staged release, which opens the preview link in a new tab.
279
+ - **Activate** a staged or earlier release, which makes it live the same way `push --activate` does; this is also how you roll back from the admin.
280
+ - **Delete** a release that isn't live, which removes its files and stops its preview.
281
+
282
+ Preview, activation and the part of the diff that looks at your content need the site to run under `inlaycms serve`. Under `inlaycms dev` the screen still lists, compares, uploads and deletes releases in the data folder, and says that activation needs the host. Inside a staged release's preview the admin is read-only, with a banner naming the release.
283
+
284
+ ### Branding
285
+
286
+ Set `admin` in `defineSite` to put your name, logo and colors on it:
287
+
288
+ ```ts
289
+ export const site = defineSite({
290
+ ...,
291
+ admin: {
292
+ name: 'Example Studio', // shown in the header and the page titles; defaults to "Inlay"
293
+ logo: '/public/logo.svg', // a URL path under /public/
294
+ theme: 'corporate', // or custom colors, below
295
+ },
296
+ })
297
+ ```
298
+
299
+ - **`logo`** is the URL of an image the site serves under `/public/`, shown as an image in the admin's header. The brand name is the logo's alt text.
300
+ - **`theme`** is one of daisyUI's built-in theme names (`light`, `dark`, `corporate`, `nord`, `dracula`, `emerald`, `business`, `winter` and the rest), or custom colors laid over a base theme:
301
+
302
+ ```ts
303
+ theme: {
304
+ base: 'corporate', // optional; Inlay's own `inlay` theme by default
305
+ scheme: 'light', // optional; 'light' or 'dark', for browser controls such as scrollbars
306
+ colors: { primary: '#0b5fff', 'primary-content': '#ffffff' },
307
+ }
308
+ ```
309
+
310
+ The color keys are daisyUI's (`base-100`, `base-200`, `base-300`, `base-content`, and `primary`, `secondary`, `accent`, `neutral`, `info`, `success`, `warning` and `error`, each with a `-content` partner). Values are hex (`#0b5fff`) or CSS color functions such as `oklch(…)`. Anything else stops the site at startup.
311
+ - **Contrast warnings.** When a text color and its background are both hex values and their contrast is below 4.5:1 (WCAG AA), Inlay logs a warning once at startup. The site still starts. Inlay's default theme passes AA.
312
+
313
+ ### Custom field widgets
314
+
315
+ Every built-in field brings its own control. A field you define with `defineField` can bring one too, through `admin`: `render` draws the control for one value, and `parse` reads it back from the submitted form.
316
+
317
+ ```tsx
318
+ import { defineField, z, type AdminWidget } from 'inlaycms/site'
319
+
320
+ const colorWidget: AdminWidget = {
321
+ render: ({ id, name, value, describedBy, invalid, readOnly }) => (
322
+ <input
323
+ type="color"
324
+ id={id}
325
+ name={name}
326
+ value={typeof value === 'string' ? value : '#000000'}
327
+ disabled={readOnly}
328
+ aria-describedby={describedBy}
329
+ aria-invalid={invalid ? 'true' : undefined}
330
+ class="input input-bordered w-full"
331
+ />
332
+ ),
333
+ parse: (form, name) => form.get(name),
334
+ }
335
+
336
+ export const color = (opts: { label: string; help?: string }) =>
337
+ defineField(z.string().regex(/^#[0-9a-f]{6}$/i), { kind: 'color', ...opts, admin: colorWidget })
338
+ ```
339
+
340
+ - The form supplies the label, the help text and any problems. Give the main control `id`, and pass `describedBy` and `invalid` on so screen readers hear the hints. A widget with several controls sets `fieldset: true`, and the form then wraps it in a `<fieldset>` with the label as its `<legend>`.
341
+ - `parse` returns `undefined` when the value is absent. Its `optional` argument says whether the field may be left out.
342
+ - The admin's CSS is prebuilt, so use classes the admin already uses (daisyUI's `input`, `select`, `textarea`, `btn` and so on) rather than new Tailwind classes.
343
+ - A field without `admin` gets a text box holding its value as JSON.
344
+
345
+ ### JavaScript
346
+
347
+ Most of the admin is plain forms and works without JavaScript. Choosing images, files and linked pages, and editing formatted text, need it; the admin says so when it is off.
348
+
349
+ ## Backups, export and restore
350
+
351
+ Inlay keeps two kinds of copy, for different jobs.
352
+
353
+ - **A backup** is the whole site as it is on disk: the database (users, sessions and API keys too), the media and, on a host, the live release. Use it to recover the same install, for example after a disk failure or a bad deploy.
354
+ - **An export** is the content only: documents, their history, redirects and media, in a documented format ([docs/export-format.md](docs/export-format.md)). It has no users or passwords. Use it to move content to another install, or to a newer version of your site code.
355
+
356
+ ### Daily and post-publish backups
357
+
358
+ Inlay writes a backup once a day and keeps the newest 14. It checks when the site starts and every hour after that, and backs up when the newest daily backup is 24 hours old or older, so restarts never skip or double a day.
359
+
360
+ On the same hourly check, if something was published or unpublished after the newest backup of any kind, Inlay writes a post-publish backup. So published changes are in a backup within about an hour, and a busy day of publishing makes at most one backup an hour. It keeps the newest 14 of these too.
361
+
362
+ Only daily and post-publish backups are pruned. Backups made by hand, before a migration, before an import or before a release went live are kept.
363
+
364
+ On a host, `INLAY_BACKUP_KEEP` sets how many of each kind are kept (default 14). Backups go to `backups/` in the data folder (under `inlaycms dev`, next to the database). Copy them somewhere off the server.
365
+
366
+ ### Backups from the command line
367
+
368
+ ```sh
369
+ npx inlaycms backup
370
+ npx inlaycms restore-backup <file> [--server-stopped]
371
+ ```
372
+
373
+ Stop the server before `restore-backup`. It refuses to run while the database looks in use; if the server crashed and left files behind, add `--server-stopped`.
374
+
375
+ "Looks in use" means the database's `-wal` or `-shm` file is still there. SQLite removes them only when the last connection closes cleanly, which `inlaycms serve` and `inlaycms dev` do when they get SIGTERM or SIGINT, so `docker stop` leaves nothing behind. A server that was killed does, and then `restore-backup` and `import` think it is still running. On a host, give the data folder with `--data` (`npx inlaycms backup --data /srv/inlay`), or set `INLAY_DATA_DIR`. The database and media you replace are kept next to the originals as `*.before-restore-*`, and the command prints their paths. A bare file name that isn't in the current directory is looked up in the backups folder. The next start applies any pending migrations.
376
+
377
+ On a host, a backup also holds the release that was live (`release.tgz` and `release.json` in the archive), and `restore-backup` puts it back in `releases/` and makes it the live one again, so a host restored onto a fresh machine serves the site without pushing the release again. The release file must be the one the backup's database recorded, and must suit the running version of Inlay; when `INLAY_TRUSTED_KEYS` (or `INLAY_TRUSTED_KEYS_FILE`) is set, its signature is checked too, and otherwise the command says it wasn't. Releases that weren't live aren't backed up; push them again if you need them. Restoring an older backup without a release leaves the stored releases alone, but none of them is live afterwards: activate one to bring the site back.
378
+
379
+ ### Export and import
380
+
381
+ ```sh
382
+ npx inlaycms export [--out <file>]
383
+ npx inlaycms import <file> [--dry-run] [--server-stopped]
384
+ npx inlaycms check --export <file>
385
+ ```
386
+
387
+ `import` always dry-runs first. `--dry-run` and `check --export` print the report and change nothing. A real import first takes a "before restoring content" backup, then replaces the content (documents, history, redirects and media) in one step. Users, sessions and API keys stay as they are. Like `restore-backup`, a real import refuses while the server is running.
388
+
389
+ The report says what would happen to each content type:
390
+
391
+ - **compatible**: restored and read against your site code. Values that fit are used and the rest take their defaults.
392
+ - **hidden**: your site code doesn't have it. The content is kept and stays hidden.
393
+
394
+ For each type, the report also counts the documents that will need attention because a required field is empty (gaps). Languages are reported the same way. Problems with the export as a whole refuse the import (exit code 1).
395
+
396
+ Owners can also export and import from the **Backups & export** screen in the admin. Restoring a backup is command-line only, and none of this is available to assistants over MCP.
397
+
398
+ ## Behind a reverse proxy
399
+
400
+ If the site runs behind a reverse proxy (nginx, Caddy, a load balancer), set `INLAY_TRUST_PROXY` to the proxy's address, so Inlay takes each visitor's address from the `X-Forwarded-For` header the proxy adds:
401
+
402
+ ```sh
403
+ INLAY_TRUST_PROXY=127.0.0.1 # a proxy on the same machine
404
+ INLAY_TRUST_PROXY=10.0.0.0/8,192.168.0.0/16 # proxies in these ranges
405
+ INLAY_TRUST_PROXY=uniquelocal # private networks, such as Docker's
406
+ ```
407
+
408
+ It takes IP addresses and ranges, separated by commas, and the names `loopback`, `linklocal` and `uniquelocal`; the default is `off`. There's no setting that trusts every address.
409
+
410
+ Login attempts are rate-limited per visitor address, so this matters:
411
+
412
+ - **Without it**, every visitor seems to come from the proxy. Anyone can then use up the shared limit with wrong passwords and keep the owner from logging in.
413
+ - **Trusting every address** would let anyone send a made-up `X-Forwarded-For` with every attempt and never hit the limit. That's why the setting only takes the proxies' own addresses: a header from anyone else is ignored.
414
+
415
+ Inlay logs a warning on the first request when `INLAY_BASE_URL` is https, Inlay isn't serving https itself, and no proxy is trusted.
416
+
417
+ ## Behind a CDN
418
+
419
+ Inlay keeps rendered pages in memory and clears them on every publish, so a single server serves a site from memory on its own. In front of a CDN or caching proxy, published pages also carry the headers shared caches need, with no provider-specific setup:
420
+
421
+ - An `ETag` over the rendered page. A request with a matching `If-None-Match` gets a 304 without rendering, so unchanged pages cost the origin almost nothing to revalidate.
422
+ - `Cache-Control: public, max-age=0, s-maxage=15, stale-if-error=86400`. Browsers revalidate on every visit, so an editor who publishes and refreshes sees the change at once. Shared caches may serve a page for 15 seconds before checking back, and keep serving the last good copy for a day if the origin is down.
423
+ - Media files are content-addressed and sent with a one-year immutable lifetime.
424
+
425
+ Tune the shared lifetime with `INLAY_CDN_MAX_AGE` (seconds, default 15) and `INLAY_CDN_STALE_IF_ERROR` (seconds, default 86400). `INLAY_CDN_MAX_AGE=0` makes shared caches revalidate on every request, which still saves bandwidth through the 304s. Preview pages are never cached (`no-store`), so a draft cannot reach a shared cache. Published pages are marked `Vary: Cookie`; if your CDN ignores that header for HTML, add a rule to bypass its cache when the `inlay_preview` cookie is present, or editors with a preview cookie may be served the cached public page.
426
+
427
+ ## Site password
428
+
429
+ An owner can lock the whole public site behind one shared password from the admin's **Security** page, for a site that isn't launched yet or a staging copy. While the lock is on, every public request gets a neutral password screen instead: pages, media, the sitemap and the site's own routes. After the right password the visitor returns to the page they asked for, and stays unlocked in that browser for 30 days, or until an owner changes the password. People signed in to the admin and people opening a preview link skip the screen. `robots.txt` answers `Disallow: /` while the site is locked.
430
+
431
+ These stay reachable without the password: the admin (`/admin`), sign-in (`/api/auth`), MCP (`/mcp` and `/.well-known/*`), the site's files under `/public/`, and Inlay's own `/_inlay/*` paths. To keep one of the site's own routes open, such as a load balancer's health check, list its path in the site's `publicPaths`. Entries are exact paths, so `/healthz` doesn't open `/healthz/x`:
432
+
433
+ ```ts
434
+ export const site = defineSite({
435
+ ...,
436
+ routes: [defineRoute({ method: 'GET', path: '/healthz', handler: async () => ({ body: 'ok' }) })],
437
+ publicPaths: ['/healthz'],
438
+ })
439
+ ```
440
+
441
+ While the lock is on, every response carries `X-Robots-Tag: noindex`, and what unlocked visitors get is sent as `Cache-Control: private` instead of `public`, so CDNs and proxies don't store it. The password screen itself is `no-store`. With the lock off, responses are exactly as described above.
442
+
443
+ A CDN keeps whatever it cached while the site was public until it's purged, and Inlay can't purge it. Turn the lock on before the site is ever public, or purge the CDN after locking a site that was public.
444
+
445
+ ## Working on Inlay
446
+
447
+ The repo uses pnpm, not npm.
448
+
449
+ - `pnpm test` runs the tests and `pnpm run typecheck` checks the types. `pnpm run build` builds the package into `dist/`.
450
+ - `pnpm run dev` runs the example site in `example/` through `inlaycms dev` at `http://localhost:3000`, with its data in `example/data/`: it restarts the site when a file in `example/` changes and rebuilds the admin's assets when `client/admin/` changes. A change to Inlay's own code in `src/` restarts `inlaycms dev` itself. Reload the page to see a change. `docker compose up dev` does the same in a container. It joins the external `inlay-dev` network, which you create once with `docker network create inlay-dev`.
451
+ - The admin's CSS and JavaScript are built from `client/admin/` into `assets/admin/`, which ships in the package. `pnpm run build:admin` builds them once. `pnpm run build` runs it first, and `pnpm test` runs it when the files are missing.
452
+ - `pnpm run example:pack` packs the example site into `example/data/release.tgz`, signed with the development key in `example/keys/`.
453
+ - `docker compose run --rm pack-test` packs Inlay, installs the tarball into a fresh copy of `example/`, packs the example into a release, activates it offline into a fresh data folder, runs `inlaycms serve` on it, pushes a second release to the running host and rolls back, and checks the site, admin, MCP and every CLI command. Run it before a release.
454
+
455
+ ### Trying the deploy path locally
456
+
457
+ `docker compose run --rm pack-test` is the deploy path end to end: it makes the first release and an owner offline, mints a push key with `inlaycms create-token --push`, starts `inlaycms serve`, pushes a second release with `inlaycms push --activate`, checks the diff and the site, confirms that a `--dry-run` push changes nothing, and rolls back with `inlaycms activate <host> <id>`. To try it by hand, run `docker compose up serve` (see [Running a host](#running-a-host)), create a push key in the same container, and push to `http://localhost:3000`.
458
+
459
+ The manual checks in a real browser and against Claude clients are in `docs/admin-acceptance.md` and `docs/mcp-acceptance.md`.
460
+
461
+ ## License
462
+
463
+ MIT. See [LICENSE](LICENSE).