@kayjs/kay 1.108.0 → 1.110.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 (595) hide show
  1. package/dist/eslint.js +2093 -3774
  2. package/editors/zed/extension.toml +2 -2
  3. package/llms/action-protection.md +1 -1
  4. package/llms/actions-from-islands.md +5 -5
  5. package/llms/actions-refused-fields.md +4 -4
  6. package/llms/api-from-islands.md +6 -6
  7. package/llms/browser-only.md +2 -2
  8. package/llms/cdn-caching.md +1 -1
  9. package/llms/checks.md +1 -1
  10. package/llms/code-lints.md +1 -2
  11. package/llms/component-library-conventions.md +1 -1
  12. package/llms/components.md +5 -5
  13. package/llms/deprecated-lints.md +2 -7
  14. package/llms/effects.md +1 -1
  15. package/llms/errors.md +2 -2
  16. package/llms/events.md +1 -1
  17. package/llms/guards.md +1 -1
  18. package/llms/head.md +1 -1
  19. package/llms/hooks.md +2 -2
  20. package/llms/images.md +1 -1
  21. package/llms/island-and-form-lints.md +4 -2
  22. package/llms/island-sources.md +1 -1
  23. package/llms/islands-state-to-ids.md +2 -2
  24. package/llms/islands.md +8 -4
  25. package/llms/lints.md +1 -1
  26. package/llms/live-values.md +4 -4
  27. package/llms/local-collections.md +1 -1
  28. package/llms/locales.md +1 -1
  29. package/llms/mcp.md +2 -2
  30. package/llms/metrics.md +1 -1
  31. package/llms/navigation-from-code.md +7 -7
  32. package/llms/navigation.md +4 -2
  33. package/llms/prerendering.md +1 -0
  34. package/llms/production.md +2 -2
  35. package/llms/project-new-and-add.md +1 -1
  36. package/llms/project.md +4 -4
  37. package/llms/proxy-and-security.md +1 -1
  38. package/llms/queues.md +1 -1
  39. package/llms/rate-limits.md +4 -4
  40. package/llms/rendering.md +1 -1
  41. package/llms/server-islands.md +2 -2
  42. package/llms/server.md +1 -1
  43. package/llms/stores.md +1 -1
  44. package/llms/styles-and-assets.md +1 -1
  45. package/llms/templates-elements-slots-snippets.md +2 -2
  46. package/llms/testing-mount.md +49 -0
  47. package/llms/testing.md +4 -45
  48. package/llms/upgrading-1-105-config.md +13 -13
  49. package/llms/upgrading-archive.md +64 -74
  50. package/llms/upgrading.md +92 -70
  51. package/llms/whats-new.md +24 -0
  52. package/llms.txt +5 -6
  53. package/package.json +6 -10
  54. package/src/build/route-sizes.ts +2 -3
  55. package/src/build/variants.ts +132 -18
  56. package/src/check/browser-global-reads.ts +2 -2
  57. package/src/check/config-objects.ts +1 -1
  58. package/src/check/diagnose.ts +0 -22
  59. package/src/check/env-types.ts +1 -1
  60. package/src/check/export-homes.ts +1 -1
  61. package/src/check/guards.ts +3 -3
  62. package/src/check/index.ts +2 -7
  63. package/src/check/moved-keys.ts +1 -1
  64. package/src/check/project.ts +6 -7
  65. package/src/check/schema-builders.ts +125 -26
  66. package/src/check/shadow-types.ts +0 -86
  67. package/src/commands/check.ts +2 -2
  68. package/src/commands/env.ts +25 -3
  69. package/src/commands/upgrade.ts +2 -1
  70. package/src/compiler/allow-comments.ts +38 -2
  71. package/src/compiler/ast.ts +21 -19
  72. package/src/compiler/browser.ts +2 -14
  73. package/src/compiler/class-items.ts +16 -0
  74. package/src/compiler/codegen.ts +10 -10
  75. package/src/compiler/deprecated-library.ts +0 -12
  76. package/src/compiler/deprecated-lints-1-106.ts +2 -2
  77. package/src/compiler/deprecated-lints.ts +3 -495
  78. package/src/compiler/deprecated-ui-props.ts +5 -5
  79. package/src/compiler/errors.ts +2 -2
  80. package/src/compiler/fence-checks.ts +2 -121
  81. package/src/compiler/hand-parts.ts +83 -0
  82. package/src/compiler/helper-imports.ts +2 -2
  83. package/src/compiler/image-attributes.ts +1 -3
  84. package/src/compiler/index.ts +23 -23
  85. package/src/compiler/island-arguments.ts +17 -95
  86. package/src/compiler/island-cause.ts +7 -7
  87. package/src/compiler/island-declaration.ts +2 -8
  88. package/src/compiler/island-lints.ts +19 -0
  89. package/src/compiler/island-marker.ts +3 -3
  90. package/src/compiler/island-problems.ts +25 -0
  91. package/src/compiler/items.ts +12 -0
  92. package/src/compiler/jsx-class.ts +1 -25
  93. package/src/compiler/jsx.ts +7 -6
  94. package/src/compiler/kay-exports.ts +0 -2
  95. package/src/compiler/link-flags.ts +9 -38
  96. package/src/compiler/lints.ts +10 -18
  97. package/src/compiler/markup.ts +33 -41
  98. package/src/compiler/module-signals.ts +2 -2
  99. package/src/compiler/names.ts +1 -1
  100. package/src/compiler/page-settings.ts +11 -0
  101. package/src/compiler/parser.ts +6 -8
  102. package/src/compiler/plan.ts +1 -3
  103. package/src/compiler/removed-lints.ts +90 -0
  104. package/src/compiler/rewrite.ts +3 -18
  105. package/src/compiler/script-server.ts +8 -3
  106. package/src/compiler/signal-from-prop.ts +141 -0
  107. package/src/compiler/template-reads.ts +16 -0
  108. package/src/compiler/validate.ts +3 -8
  109. package/src/config-loader.ts +14 -4
  110. package/src/config-resolve.ts +18 -142
  111. package/src/config-shape.ts +44 -34
  112. package/src/config.ts +10 -114
  113. package/src/dev/preload.ts +4 -1
  114. package/src/lsp/server.ts +4 -0
  115. package/src/migrate/markup.ts +4 -1
  116. package/src/runtime/action-call.ts +0 -8
  117. package/src/runtime/action-encode.ts +26 -0
  118. package/src/runtime/action-error.ts +3 -11
  119. package/src/runtime/action-protection.ts +2 -2
  120. package/src/runtime/action-run.ts +2 -27
  121. package/src/runtime/action-shared.ts +14 -37
  122. package/src/runtime/action-stream.ts +0 -1
  123. package/src/runtime/action.ts +1 -1
  124. package/src/runtime/call-result.ts +2 -10
  125. package/src/runtime/checks.ts +25 -13
  126. package/src/runtime/client.ts +7 -11
  127. package/src/runtime/core.ts +5 -23
  128. package/src/runtime/dom.ts +1 -1
  129. package/src/runtime/html.ts +1 -1
  130. package/src/runtime/i18n.client.ts +1 -4
  131. package/src/runtime/i18n.server.ts +1 -4
  132. package/src/runtime/i18n.ts +3 -3
  133. package/src/runtime/image.ts +2 -19
  134. package/src/runtime/index.ts +3 -3
  135. package/src/runtime/island.server.ts +56 -13
  136. package/src/runtime/live-resource.server.ts +0 -1
  137. package/src/runtime/live-value.server.ts +2 -2
  138. package/src/runtime/live-value.shared.ts +7 -20
  139. package/src/runtime/live.ts +1 -12
  140. package/src/runtime/local-types.ts +1 -11
  141. package/src/runtime/local.ts +4 -14
  142. package/src/runtime/navigate-api.ts +2 -5
  143. package/src/runtime/navigate.ts +9 -0
  144. package/src/runtime/navigation-state.ts +0 -12
  145. package/src/runtime/navigation.ts +5 -1
  146. package/src/runtime/page-swap.ts +8 -8
  147. package/src/runtime/persist.ts +11 -3
  148. package/src/runtime/persisted.ts +4 -30
  149. package/src/runtime/presence.ts +6 -7
  150. package/src/runtime/query-param.ts +20 -12
  151. package/src/runtime/reactive.ts +3 -1
  152. package/src/runtime/refuse.ts +3 -17
  153. package/src/runtime/store-base.ts +4 -6
  154. package/src/runtime/swap-fetch.ts +1 -1
  155. package/src/runtime/swap-flight.ts +10 -10
  156. package/src/runtime/swap-kept.ts +69 -29
  157. package/src/runtime/swap-morph.ts +49 -9
  158. package/src/runtime/text-hash.ts +17 -0
  159. package/src/runtime/uid.server.ts +6 -4
  160. package/src/runtime/values.ts +52 -23
  161. package/src/runtime/with-query.ts +9 -0
  162. package/src/server/action-hooks.ts +8 -8
  163. package/src/server/actions.ts +13 -14
  164. package/src/server/api-modules.ts +2 -3
  165. package/src/server/app-stages.ts +15 -33
  166. package/src/server/app.ts +10 -5
  167. package/src/server/auth-mails.ts +0 -2
  168. package/src/server/env-state.ts +40 -10
  169. package/src/server/flash.ts +1 -1
  170. package/src/server/guard-requirement.ts +4 -4
  171. package/src/server/image.ts +2 -2
  172. package/src/server/index.ts +0 -2
  173. package/src/server/job-context.ts +3 -3
  174. package/src/server/jobs-page.ts +1 -1
  175. package/src/server/jobs.ts +5 -9
  176. package/src/server/kept-exports.ts +0 -2
  177. package/src/server/kv.ts +11 -14
  178. package/src/server/library.ts +1 -3
  179. package/src/server/live.ts +2 -2
  180. package/src/server/mcp.ts +3 -9
  181. package/src/server/metrics.ts +2 -4
  182. package/src/server/page-settings.ts +10 -19
  183. package/src/server/prerender.ts +19 -2
  184. package/src/server/protection.ts +15 -18
  185. package/src/server/queue.ts +3 -6
  186. package/src/server/rate-limit.ts +0 -3
  187. package/src/server/render-document.ts +9 -7
  188. package/src/server/render.ts +1 -1
  189. package/src/server/routes.ts +7 -3
  190. package/src/server/scope.ts +3 -2
  191. package/src/server/session.ts +5 -6
  192. package/src/server/setup.ts +1 -1
  193. package/src/server/signals.ts +17 -7
  194. package/src/server/signed.ts +1 -3
  195. package/src/server/source.ts +20 -4
  196. package/src/server/speculation.ts +1 -1
  197. package/src/server/storage.ts +3 -8
  198. package/src/server/validate.ts +1 -1
  199. package/src/server/vitals.ts +1 -3
  200. package/src/server/work-scope.ts +2 -4
  201. package/src/server/work.ts +1 -1
  202. package/src/server/workflow.ts +1 -1
  203. package/src/test/index.ts +2 -1
  204. package/src/test/site-actions.ts +16 -6
  205. package/src/test/site-keys.ts +10 -15
  206. package/src/test/site-socket.ts +1 -2
  207. package/src/test/site-types.ts +0 -8
  208. package/types/build/route-sizes.d.ts.map +1 -1
  209. package/types/build/variants.d.ts +9 -1
  210. package/types/build/variants.d.ts.map +1 -1
  211. package/types/check/diagnose.d.ts.map +1 -1
  212. package/types/check/index.d.ts +1 -2
  213. package/types/check/index.d.ts.map +1 -1
  214. package/types/check/project.d.ts.map +1 -1
  215. package/types/check/schema-builders.d.ts.map +1 -1
  216. package/types/check/shadow-types.d.ts.map +1 -1
  217. package/types/commands/env.d.ts.map +1 -1
  218. package/types/commands/upgrade.d.ts.map +1 -1
  219. package/types/compiler/allow-comments.d.ts +2 -0
  220. package/types/compiler/allow-comments.d.ts.map +1 -1
  221. package/types/compiler/ast.d.ts +1 -2
  222. package/types/compiler/ast.d.ts.map +1 -1
  223. package/types/compiler/browser.d.ts.map +1 -1
  224. package/types/compiler/class-items.d.ts +7 -0
  225. package/types/compiler/class-items.d.ts.map +1 -0
  226. package/types/compiler/deprecated-library.d.ts.map +1 -1
  227. package/types/compiler/deprecated-lints-1-106.d.ts +2 -2
  228. package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -1
  229. package/types/compiler/deprecated-lints.d.ts +2 -553
  230. package/types/compiler/deprecated-lints.d.ts.map +1 -1
  231. package/types/compiler/deprecated-ui-props.d.ts +1 -8
  232. package/types/compiler/deprecated-ui-props.d.ts.map +1 -1
  233. package/types/compiler/errors.d.ts +2 -2
  234. package/types/compiler/errors.d.ts.map +1 -1
  235. package/types/compiler/fence-checks.d.ts +0 -1
  236. package/types/compiler/fence-checks.d.ts.map +1 -1
  237. package/types/compiler/hand-parts.d.ts +10 -0
  238. package/types/compiler/hand-parts.d.ts.map +1 -0
  239. package/types/compiler/image-attributes.d.ts +0 -1
  240. package/types/compiler/image-attributes.d.ts.map +1 -1
  241. package/types/compiler/index.d.ts.map +1 -1
  242. package/types/compiler/island-arguments.d.ts +7 -11
  243. package/types/compiler/island-arguments.d.ts.map +1 -1
  244. package/types/compiler/island-cause.d.ts +1 -1
  245. package/types/compiler/island-cause.d.ts.map +1 -1
  246. package/types/compiler/island-declaration.d.ts +1 -3
  247. package/types/compiler/island-declaration.d.ts.map +1 -1
  248. package/types/compiler/island-lints.d.ts +17 -0
  249. package/types/compiler/island-lints.d.ts.map +1 -0
  250. package/types/compiler/island-problems.d.ts +7 -0
  251. package/types/compiler/island-problems.d.ts.map +1 -0
  252. package/types/compiler/items.d.ts +1 -0
  253. package/types/compiler/items.d.ts.map +1 -1
  254. package/types/compiler/jsx-class.d.ts +1 -2
  255. package/types/compiler/jsx-class.d.ts.map +1 -1
  256. package/types/compiler/jsx.d.ts.map +1 -1
  257. package/types/compiler/kay-exports.d.ts.map +1 -1
  258. package/types/compiler/link-flags.d.ts +0 -6
  259. package/types/compiler/link-flags.d.ts.map +1 -1
  260. package/types/compiler/lints.d.ts +21 -566
  261. package/types/compiler/lints.d.ts.map +1 -1
  262. package/types/compiler/markup.d.ts +1 -1
  263. package/types/compiler/markup.d.ts.map +1 -1
  264. package/types/compiler/module-signals.d.ts.map +1 -1
  265. package/types/compiler/names.d.ts.map +1 -1
  266. package/types/compiler/page-settings.d.ts +4 -0
  267. package/types/compiler/page-settings.d.ts.map +1 -1
  268. package/types/compiler/parser.d.ts.map +1 -1
  269. package/types/compiler/plan.d.ts.map +1 -1
  270. package/types/compiler/removed-lints.d.ts +3 -0
  271. package/types/compiler/removed-lints.d.ts.map +1 -0
  272. package/types/compiler/script-server.d.ts.map +1 -1
  273. package/types/compiler/signal-from-prop.d.ts +4 -0
  274. package/types/compiler/signal-from-prop.d.ts.map +1 -0
  275. package/types/compiler/template-reads.d.ts +1 -0
  276. package/types/compiler/template-reads.d.ts.map +1 -1
  277. package/types/compiler/validate.d.ts.map +1 -1
  278. package/types/config-loader.d.ts.map +1 -1
  279. package/types/config-resolve.d.ts.map +1 -1
  280. package/types/config-shape.d.ts +1 -1
  281. package/types/config-shape.d.ts.map +1 -1
  282. package/types/config.d.ts +5 -105
  283. package/types/config.d.ts.map +1 -1
  284. package/types/dev/preload.d.ts.map +1 -1
  285. package/types/lsp/server.d.ts.map +1 -1
  286. package/types/migrate/markup.d.ts.map +1 -1
  287. package/types/runtime/action-call.d.ts.map +1 -1
  288. package/types/runtime/action-encode.d.ts +1 -0
  289. package/types/runtime/action-encode.d.ts.map +1 -1
  290. package/types/runtime/action-error.d.ts +1 -2
  291. package/types/runtime/action-error.d.ts.map +1 -1
  292. package/types/runtime/action-run.d.ts.map +1 -1
  293. package/types/runtime/action-shared.d.ts +1 -27
  294. package/types/runtime/action-shared.d.ts.map +1 -1
  295. package/types/runtime/action-stream.d.ts.map +1 -1
  296. package/types/runtime/action.d.ts +1 -1
  297. package/types/runtime/action.d.ts.map +1 -1
  298. package/types/runtime/call-result.d.ts +0 -10
  299. package/types/runtime/call-result.d.ts.map +1 -1
  300. package/types/runtime/checks.d.ts +14 -11
  301. package/types/runtime/checks.d.ts.map +1 -1
  302. package/types/runtime/client.d.ts.map +1 -1
  303. package/types/runtime/core.d.ts +2 -20
  304. package/types/runtime/core.d.ts.map +1 -1
  305. package/types/runtime/dom.d.ts +1 -1
  306. package/types/runtime/dom.d.ts.map +1 -1
  307. package/types/runtime/html.d.ts +1 -1
  308. package/types/runtime/html.d.ts.map +1 -1
  309. package/types/runtime/i18n.client.d.ts +0 -1
  310. package/types/runtime/i18n.client.d.ts.map +1 -1
  311. package/types/runtime/i18n.d.ts +1 -1
  312. package/types/runtime/i18n.d.ts.map +1 -1
  313. package/types/runtime/i18n.server.d.ts +0 -1
  314. package/types/runtime/i18n.server.d.ts.map +1 -1
  315. package/types/runtime/image.d.ts.map +1 -1
  316. package/types/runtime/index.d.ts +3 -3
  317. package/types/runtime/index.d.ts.map +1 -1
  318. package/types/runtime/island.server.d.ts +2 -0
  319. package/types/runtime/island.server.d.ts.map +1 -1
  320. package/types/runtime/live-resource.server.d.ts.map +1 -1
  321. package/types/runtime/live-value.shared.d.ts +7 -15
  322. package/types/runtime/live-value.shared.d.ts.map +1 -1
  323. package/types/runtime/live.d.ts +0 -11
  324. package/types/runtime/live.d.ts.map +1 -1
  325. package/types/runtime/local-types.d.ts +0 -14
  326. package/types/runtime/local-types.d.ts.map +1 -1
  327. package/types/runtime/navigate-api.d.ts +0 -4
  328. package/types/runtime/navigate-api.d.ts.map +1 -1
  329. package/types/runtime/navigate.d.ts.map +1 -1
  330. package/types/runtime/navigation-state.d.ts +0 -4
  331. package/types/runtime/navigation-state.d.ts.map +1 -1
  332. package/types/runtime/navigation.d.ts +2 -0
  333. package/types/runtime/navigation.d.ts.map +1 -1
  334. package/types/runtime/page-swap.d.ts.map +1 -1
  335. package/types/runtime/persist.d.ts +1 -0
  336. package/types/runtime/persist.d.ts.map +1 -1
  337. package/types/runtime/persisted.d.ts +0 -15
  338. package/types/runtime/persisted.d.ts.map +1 -1
  339. package/types/runtime/presence.d.ts +0 -2
  340. package/types/runtime/presence.d.ts.map +1 -1
  341. package/types/runtime/query-param.d.ts.map +1 -1
  342. package/types/runtime/reactive.d.ts +2 -1
  343. package/types/runtime/reactive.d.ts.map +1 -1
  344. package/types/runtime/refuse.d.ts +0 -7
  345. package/types/runtime/refuse.d.ts.map +1 -1
  346. package/types/runtime/store-base.d.ts +1 -2
  347. package/types/runtime/store-base.d.ts.map +1 -1
  348. package/types/runtime/swap-flight.d.ts +1 -1
  349. package/types/runtime/swap-flight.d.ts.map +1 -1
  350. package/types/runtime/swap-kept.d.ts.map +1 -1
  351. package/types/runtime/swap-morph.d.ts.map +1 -1
  352. package/types/runtime/text-hash.d.ts +2 -0
  353. package/types/runtime/text-hash.d.ts.map +1 -0
  354. package/types/runtime/uid.server.d.ts.map +1 -1
  355. package/types/runtime/values.d.ts +6 -1
  356. package/types/runtime/values.d.ts.map +1 -1
  357. package/types/runtime/with-query.d.ts +2 -0
  358. package/types/runtime/with-query.d.ts.map +1 -1
  359. package/types/server/action-hooks.d.ts +4 -4
  360. package/types/server/action-hooks.d.ts.map +1 -1
  361. package/types/server/actions.d.ts.map +1 -1
  362. package/types/server/api-modules.d.ts +0 -1
  363. package/types/server/api-modules.d.ts.map +1 -1
  364. package/types/server/app-stages.d.ts +5 -13
  365. package/types/server/app-stages.d.ts.map +1 -1
  366. package/types/server/app.d.ts +3 -8
  367. package/types/server/app.d.ts.map +1 -1
  368. package/types/server/auth-mails.d.ts +0 -5
  369. package/types/server/auth-mails.d.ts.map +1 -1
  370. package/types/server/env-state.d.ts +1 -0
  371. package/types/server/env-state.d.ts.map +1 -1
  372. package/types/server/guard-requirement.d.ts +0 -1
  373. package/types/server/guard-requirement.d.ts.map +1 -1
  374. package/types/server/image.d.ts +0 -1
  375. package/types/server/image.d.ts.map +1 -1
  376. package/types/server/index.d.ts +0 -2
  377. package/types/server/index.d.ts.map +1 -1
  378. package/types/server/job-context.d.ts +1 -1
  379. package/types/server/job-context.d.ts.map +1 -1
  380. package/types/server/jobs.d.ts +0 -4
  381. package/types/server/jobs.d.ts.map +1 -1
  382. package/types/server/kept-exports.d.ts.map +1 -1
  383. package/types/server/kv.d.ts +4 -4
  384. package/types/server/kv.d.ts.map +1 -1
  385. package/types/server/library.d.ts +1 -3
  386. package/types/server/library.d.ts.map +1 -1
  387. package/types/server/mcp.d.ts +0 -1
  388. package/types/server/mcp.d.ts.map +1 -1
  389. package/types/server/metrics.d.ts +0 -5
  390. package/types/server/metrics.d.ts.map +1 -1
  391. package/types/server/page-settings.d.ts +3 -3
  392. package/types/server/page-settings.d.ts.map +1 -1
  393. package/types/server/prerender.d.ts.map +1 -1
  394. package/types/server/protection.d.ts +6 -6
  395. package/types/server/protection.d.ts.map +1 -1
  396. package/types/server/queue.d.ts +1 -3
  397. package/types/server/queue.d.ts.map +1 -1
  398. package/types/server/rate-limit.d.ts +0 -2
  399. package/types/server/rate-limit.d.ts.map +1 -1
  400. package/types/server/render-document.d.ts +1 -1
  401. package/types/server/render-document.d.ts.map +1 -1
  402. package/types/server/routes.d.ts +1 -1
  403. package/types/server/routes.d.ts.map +1 -1
  404. package/types/server/scope.d.ts.map +1 -1
  405. package/types/server/session.d.ts +1 -1
  406. package/types/server/session.d.ts.map +1 -1
  407. package/types/server/signals.d.ts.map +1 -1
  408. package/types/server/signed.d.ts +0 -2
  409. package/types/server/signed.d.ts.map +1 -1
  410. package/types/server/source.d.ts +1 -1
  411. package/types/server/source.d.ts.map +1 -1
  412. package/types/server/storage.d.ts +0 -4
  413. package/types/server/storage.d.ts.map +1 -1
  414. package/types/server/vitals.d.ts +0 -1
  415. package/types/server/vitals.d.ts.map +1 -1
  416. package/types/server/work-scope.d.ts +0 -2
  417. package/types/server/work-scope.d.ts.map +1 -1
  418. package/types/server/workflow.d.ts +1 -1
  419. package/types/server/workflow.d.ts.map +1 -1
  420. package/types/test/index.d.ts.map +1 -1
  421. package/types/test/site-actions.d.ts +1 -1
  422. package/types/test/site-actions.d.ts.map +1 -1
  423. package/types/test/site-keys.d.ts +1 -1
  424. package/types/test/site-keys.d.ts.map +1 -1
  425. package/types/test/site-socket.d.ts +1 -1
  426. package/types/test/site-socket.d.ts.map +1 -1
  427. package/types/test/site-types.d.ts +0 -8
  428. package/types/test/site-types.d.ts.map +1 -1
  429. package/llms/deprecated-lints-1-105-libraries.md +0 -32
  430. package/llms/deprecated-lints-1-105.md +0 -58
  431. package/src/check/action-readers.ts +0 -115
  432. package/src/check/action-type.ts +0 -44
  433. package/src/check/ai-language.ts +0 -56
  434. package/src/check/app-hooks.ts +0 -90
  435. package/src/check/auth-methods.ts +0 -85
  436. package/src/check/auth-rate-limits.ts +0 -99
  437. package/src/check/call-result.ts +0 -242
  438. package/src/check/client-keys.ts +0 -10
  439. package/src/check/cms-options.ts +0 -81
  440. package/src/check/config-groups.ts +0 -22
  441. package/src/check/config-switches.ts +0 -38
  442. package/src/check/context-import.ts +0 -51
  443. package/src/check/env-files.ts +0 -31
  444. package/src/check/format-duration.ts +0 -75
  445. package/src/check/guard-options.ts +0 -58
  446. package/src/check/handler-events.ts +0 -149
  447. package/src/check/hook-context.ts +0 -94
  448. package/src/check/hook-names.ts +0 -104
  449. package/src/check/i18n-keys.ts +0 -50
  450. package/src/check/images-keys.ts +0 -54
  451. package/src/check/job-shapes.ts +0 -273
  452. package/src/check/link-flag-tests.ts +0 -130
  453. package/src/check/live-api.ts +0 -137
  454. package/src/check/mail-api.ts +0 -67
  455. package/src/check/one-state-api.ts +0 -357
  456. package/src/check/pages-options.ts +0 -35
  457. package/src/check/rate-enforce.ts +0 -53
  458. package/src/check/refusal-calls.ts +0 -185
  459. package/src/check/retired-lints.ts +0 -49
  460. package/src/check/route-keys.ts +0 -166
  461. package/src/check/secret-keys.ts +0 -83
  462. package/src/check/socket-frames.ts +0 -102
  463. package/src/check/source-readers.ts +0 -257
  464. package/src/check/store-ms.ts +0 -72
  465. package/src/check/store-names.ts +0 -88
  466. package/src/check/test-helpers.ts +0 -98
  467. package/src/check/ttl-names.ts +0 -142
  468. package/src/compiler/deprecated-ai-labels.ts +0 -97
  469. package/src/compiler/deprecated-ai-links.ts +0 -63
  470. package/src/compiler/deprecated-allow.ts +0 -50
  471. package/src/compiler/deprecated-auth-lints.ts +0 -14
  472. package/src/compiler/deprecated-auth-signed.ts +0 -29
  473. package/src/compiler/deprecated-children.ts +0 -66
  474. package/src/compiler/deprecated-image.ts +0 -116
  475. package/src/compiler/deprecated-island.ts +0 -155
  476. package/src/compiler/deprecated-lints-1-105.ts +0 -41
  477. package/src/compiler/deprecated-page.ts +0 -125
  478. package/src/compiler/deprecated-parts.ts +0 -22
  479. package/src/compiler/deprecated-typed-lints.ts +0 -23
  480. package/src/compiler/deprecated-ui-callbacks.ts +0 -66
  481. package/src/compiler/deprecated-ui-input.ts +0 -97
  482. package/src/compiler/deprecated-ui-items.ts +0 -47
  483. package/src/compiler/old-parts.ts +0 -84
  484. package/src/runtime/mount.compat.ts +0 -8
  485. package/src/server/moved-exports.ts +0 -17
  486. package/types/check/action-readers.d.ts +0 -3
  487. package/types/check/action-readers.d.ts.map +0 -1
  488. package/types/check/action-type.d.ts +0 -3
  489. package/types/check/action-type.d.ts.map +0 -1
  490. package/types/check/ai-language.d.ts +0 -3
  491. package/types/check/ai-language.d.ts.map +0 -1
  492. package/types/check/app-hooks.d.ts +0 -3
  493. package/types/check/app-hooks.d.ts.map +0 -1
  494. package/types/check/auth-methods.d.ts +0 -3
  495. package/types/check/auth-methods.d.ts.map +0 -1
  496. package/types/check/auth-rate-limits.d.ts +0 -3
  497. package/types/check/auth-rate-limits.d.ts.map +0 -1
  498. package/types/check/call-result.d.ts +0 -7
  499. package/types/check/call-result.d.ts.map +0 -1
  500. package/types/check/client-keys.d.ts +0 -3
  501. package/types/check/client-keys.d.ts.map +0 -1
  502. package/types/check/cms-options.d.ts +0 -3
  503. package/types/check/cms-options.d.ts.map +0 -1
  504. package/types/check/config-groups.d.ts +0 -3
  505. package/types/check/config-groups.d.ts.map +0 -1
  506. package/types/check/config-switches.d.ts +0 -3
  507. package/types/check/config-switches.d.ts.map +0 -1
  508. package/types/check/context-import.d.ts +0 -3
  509. package/types/check/context-import.d.ts.map +0 -1
  510. package/types/check/env-files.d.ts +0 -3
  511. package/types/check/env-files.d.ts.map +0 -1
  512. package/types/check/format-duration.d.ts +0 -5
  513. package/types/check/format-duration.d.ts.map +0 -1
  514. package/types/check/guard-options.d.ts +0 -3
  515. package/types/check/guard-options.d.ts.map +0 -1
  516. package/types/check/handler-events.d.ts +0 -9
  517. package/types/check/handler-events.d.ts.map +0 -1
  518. package/types/check/hook-context.d.ts +0 -3
  519. package/types/check/hook-context.d.ts.map +0 -1
  520. package/types/check/hook-names.d.ts +0 -3
  521. package/types/check/hook-names.d.ts.map +0 -1
  522. package/types/check/i18n-keys.d.ts +0 -3
  523. package/types/check/i18n-keys.d.ts.map +0 -1
  524. package/types/check/images-keys.d.ts +0 -3
  525. package/types/check/images-keys.d.ts.map +0 -1
  526. package/types/check/job-shapes.d.ts +0 -6
  527. package/types/check/job-shapes.d.ts.map +0 -1
  528. package/types/check/link-flag-tests.d.ts +0 -4
  529. package/types/check/link-flag-tests.d.ts.map +0 -1
  530. package/types/check/live-api.d.ts +0 -3
  531. package/types/check/live-api.d.ts.map +0 -1
  532. package/types/check/mail-api.d.ts +0 -3
  533. package/types/check/mail-api.d.ts.map +0 -1
  534. package/types/check/one-state-api.d.ts +0 -9
  535. package/types/check/one-state-api.d.ts.map +0 -1
  536. package/types/check/pages-options.d.ts +0 -3
  537. package/types/check/pages-options.d.ts.map +0 -1
  538. package/types/check/rate-enforce.d.ts +0 -3
  539. package/types/check/rate-enforce.d.ts.map +0 -1
  540. package/types/check/refusal-calls.d.ts +0 -3
  541. package/types/check/refusal-calls.d.ts.map +0 -1
  542. package/types/check/retired-lints.d.ts +0 -3
  543. package/types/check/retired-lints.d.ts.map +0 -1
  544. package/types/check/route-keys.d.ts +0 -3
  545. package/types/check/route-keys.d.ts.map +0 -1
  546. package/types/check/secret-keys.d.ts +0 -3
  547. package/types/check/secret-keys.d.ts.map +0 -1
  548. package/types/check/socket-frames.d.ts +0 -3
  549. package/types/check/socket-frames.d.ts.map +0 -1
  550. package/types/check/source-readers.d.ts +0 -3
  551. package/types/check/source-readers.d.ts.map +0 -1
  552. package/types/check/store-ms.d.ts +0 -3
  553. package/types/check/store-ms.d.ts.map +0 -1
  554. package/types/check/store-names.d.ts +0 -3
  555. package/types/check/store-names.d.ts.map +0 -1
  556. package/types/check/test-helpers.d.ts +0 -3
  557. package/types/check/test-helpers.d.ts.map +0 -1
  558. package/types/check/ttl-names.d.ts +0 -3
  559. package/types/check/ttl-names.d.ts.map +0 -1
  560. package/types/compiler/deprecated-ai-labels.d.ts +0 -5
  561. package/types/compiler/deprecated-ai-labels.d.ts.map +0 -1
  562. package/types/compiler/deprecated-ai-links.d.ts +0 -5
  563. package/types/compiler/deprecated-ai-links.d.ts.map +0 -1
  564. package/types/compiler/deprecated-allow.d.ts +0 -5
  565. package/types/compiler/deprecated-allow.d.ts.map +0 -1
  566. package/types/compiler/deprecated-auth-lints.d.ts +0 -12
  567. package/types/compiler/deprecated-auth-lints.d.ts.map +0 -1
  568. package/types/compiler/deprecated-auth-signed.d.ts +0 -5
  569. package/types/compiler/deprecated-auth-signed.d.ts.map +0 -1
  570. package/types/compiler/deprecated-children.d.ts +0 -4
  571. package/types/compiler/deprecated-children.d.ts.map +0 -1
  572. package/types/compiler/deprecated-image.d.ts +0 -5
  573. package/types/compiler/deprecated-image.d.ts.map +0 -1
  574. package/types/compiler/deprecated-island.d.ts +0 -9
  575. package/types/compiler/deprecated-island.d.ts.map +0 -1
  576. package/types/compiler/deprecated-lints-1-105.d.ts +0 -39
  577. package/types/compiler/deprecated-lints-1-105.d.ts.map +0 -1
  578. package/types/compiler/deprecated-page.d.ts +0 -4
  579. package/types/compiler/deprecated-page.d.ts.map +0 -1
  580. package/types/compiler/deprecated-parts.d.ts +0 -3
  581. package/types/compiler/deprecated-parts.d.ts.map +0 -1
  582. package/types/compiler/deprecated-typed-lints.d.ts +0 -21
  583. package/types/compiler/deprecated-typed-lints.d.ts.map +0 -1
  584. package/types/compiler/deprecated-ui-callbacks.d.ts +0 -5
  585. package/types/compiler/deprecated-ui-callbacks.d.ts.map +0 -1
  586. package/types/compiler/deprecated-ui-input.d.ts +0 -5
  587. package/types/compiler/deprecated-ui-input.d.ts.map +0 -1
  588. package/types/compiler/deprecated-ui-items.d.ts +0 -5
  589. package/types/compiler/deprecated-ui-items.d.ts.map +0 -1
  590. package/types/compiler/old-parts.d.ts +0 -9
  591. package/types/compiler/old-parts.d.ts.map +0 -1
  592. package/types/runtime/mount.compat.d.ts +0 -7
  593. package/types/runtime/mount.compat.d.ts.map +0 -1
  594. package/types/server/moved-exports.d.ts +0 -12
  595. package/types/server/moved-exports.d.ts.map +0 -1
package/llms/lints.md CHANGED
@@ -71,7 +71,7 @@ kay check --only seo
71
71
  - A problem prints as `error[missing-alt]: An \`img\` needs \`alt\``, then ` --> src/routes/index.kay:4:3`, the lines at fault with the span underlined and the other places involved labelled, then `= note:` saying why when the message does not, and `= help:` saying what to write.
72
72
  - A name in brackets is a lint's, and the project sets its level: `deny` reports it as an error, `warn` as a warning, and `allow` not at all.
73
73
  - `kay check` prints warnings beside the errors and counts them apart, failing on them only with `--deny-warnings`, which the `check` script `kay new` writes leaves out; `kay build` and `kay dev` never fail on one.
74
- - Lints are found while type checking, so a page with one still runs. A lint at `deny`, as `brace-in-attribute` and `unreturned-fail` are, fails `kay check` and `kay build`, which checks first; `kay build --no-check` skips it.
74
+ - Lints are found while type checking, so a page with one still runs. A lint at `deny`, as `brace-in-attribute` and `signal-set-call` are, fails `kay check` and `kay build`, which checks first; `kay build --no-check` skips it.
75
75
  - Beside each open file's problems, the editor runs what `kay check` finds across the project after a save or a change on disk, never on a keystroke: the config, the collections' entries, the locales' messages, what the server refuses when it boots, the settings libraries take and what guards, API modules and matchers export, each shown at its file.
76
76
  - `lints` in `kay.config.ts` sets levels over the defaults: `defineConfig({ lints: { 'positional-key': 'deny', 'unread-name': 'warn' } })`.
77
77
  - Each lint is in a group, `code`, `a11y`, `forms`, `islands`, `performance`, `seo`, `security`, `i18n` or `deprecated`, and `lints` takes a group's level for every lint in it, a lint's own level winning.
@@ -90,7 +90,7 @@ On an `api()` chain only, a message failing `body` is answered `{ error: { key,
90
90
  ### Live values
91
91
 
92
92
  - `live(initial)` is a `Live<T>`: `value()` reads, `value.set(next | updater)` writes; `live(key => initial)` is `LiveByKey`: `value(key)`, `value.set(next, { key })`, `value.delete(key)`. A key is a string, a key nothing was set for reads what the function gives, and `delete` puts it back.
93
- - `live(initial, { ttl: '7d' })` forgets a value that long after its last write (a duration such as '30m', '12h' or '30d', as `cached` takes; the options an object literal, as the build adds the id after it): every process and store then reads what the declaration gives again, as after `delete`, the memory, `sqliteData(path)` and `pgData(db)` alike. A `set` renews it, even of the value held, a keyed value expires per key, the watchers of an open page are told the value went back, and a value stored before the option was declared gets its end when a process first reads it, so it is forgotten one `ttl` after the deploy that declared it. A row past its end is left out when read and dropped from the table by the first write an hour after, apart from that write and under a time limit of its own; `kay_live` gains an `expires_at` column (a SQLite file adds it when opened, `pgData` adds it too, a role that may not alter tables has the owner run it again as [Jobs](queues.md) says). A `LiveStore` of your own takes `expiresAt` (milliseconds) as the fourth argument of `set` (and may offer `end(id, key, expiresAt)`, which dates a row that has no end without writing its text, and `endAll(id, ttl)`, `ttl` a `Duration` for a store with `durations: true`, which dates every row of an id that has none in one write and one event, so a store with many old rows is not written a row at a time), gives it as the fourth item of an `entries` row and of a `subscribe` call, and leaves out the rows past it.
93
+ - `live(initial, { ttl: '7d' })` forgets a value that long after its last write (a duration such as '30m', '12h' or '30d', as `cached` takes; the options an object literal, as the build adds the id after it): every process and store then reads what the declaration gives again, as after `delete`, the memory, `sqliteData(path)` and `pgData(db)` alike. A `set` renews it, even of the value held, a keyed value expires per key, the watchers of an open page are told the value went back, and a value stored before the option was declared gets its end when a process first reads it, so it is forgotten one `ttl` after the deploy that declared it. A row past its end is left out when read and dropped from the table by the first write an hour after, apart from that write and under a time limit of its own; `kay_live` gains an `expires_at` column (a SQLite file adds it when opened, `pgData` adds it too, a role that may not alter tables has the owner run it again as [Jobs](queues.md) says). A `LiveStore` of your own takes `expiresAt` (milliseconds) as the fourth argument of `set` (and may offer `end(id, key, expiresAt)`, which dates a row that has no end without writing its text, and `endAll(id, ttl)`, `ttl` a `Duration`, which dates every row of an id that has none in one write and one event, so a store with many old rows is not written a row at a time), gives it as the fourth item of an `entries` row and of a `subscribe` call, and leaves out the rows past it.
94
94
  - A value must cross to the browser as island props do (Dates, Maps and Sets included); a function, class instance or other unsendable value throws where it is set, naming the constant and its id. A `set` to the value it holds sends nothing.
95
95
  - A page's HTML holds the values it read, so an island hydrates with them and follows from there. One connection per page, `POST /_kay/live` (under `base`), carries every live value the page's islands read, opened once those hydrating as the page loads have all subscribed (a `visible` or `idle` island or a deferred server island, hydrating later, moves it, and an island whose code takes over 5 seconds to arrive, or never does, delays the connection by those 5 seconds at most), and none opens when they read none; a swap to another page keeps it, moving it to the keys the new page reads, and closes it when none is read. Changes of one tick are sent as one event.
96
96
  - A hidden tab closes the live-values connection and stops renewing its proof (unless it follows a presence key, below), and a tab shown again opens one that starts with every watched value as it is then; a page loaded in a hidden tab connects when it is shown. The connections of `socket()` and `stream()` are the app's and stay open.
@@ -99,13 +99,13 @@ On an `api()` chain only, a message failing `body` is answered `{ error: { key,
99
99
  - A page reading a live value is rendered per request: `kay build` skips keeping it, and `prerender` or a static export of it fails with `export-server-render`.
100
100
  - A value of each user (`{ user: true }`) is stored under the user's id, so `store: sqliteData(path)` and `pgData(db)` keep and share it as any keyed value. Its read is noted with the user the render was for: kay asks `userOf(request)` only for a page that reads one: the first request of such a page renders twice (its loads run again), the rest ask before rendering, and a page reading none never asks, a streamed page apart, which in an app declaring a value of each user asks before its body is sent. A page that read one has its whole proof bound to that user, as `signature|user` with the user in the signed text, so a user written into it by anyone else breaks it. The connection takes a bound proof only when its own request's `userOf` is that user, so after a sign-out, or another user in the same browser, it answers 403 and the tab takes the proofs of the page rendered for who is signed in now; the value is watched under the user the connection was proved for, and a key naming another user is refused. A deferred server island follows the viewer's value too: its fetch carries a script holding the value and a proof bound to the viewer, inside the island, and when the page renews its proofs, or a refused connection has it ask for new ones, an island holding such a value is fetched again, so it takes the new proofs (an app with `navigation: false` waits for the reload). The error and 404 pages resolve the viewer as a page does, so they show and follow the viewer's value, and a `userOf` that throws there leaves them as for nobody. A value read only inside a streamed `await` block is shown for the viewer but not followed. A sign-out in another tab is noticed at the next connection or renewal, within the proof's hour. A proof made before the user was bound, by a server not yet upgraded, still holds for its keys, and a bound proof sent to such a server is refused, so a tab refreshes.
101
101
  - Replicas and restarts: `store: sqliteData(path)` in kay.config.ts (or `store: { live: sqliteLive(path) }`) keeps every `live()` value in the file, and `pgData(db)` in the `kay_live` table of Postgres for replicas on several machines, heard by polling and a `NOTIFY` ([Jobs](queues.md)); so a `set` in one process reaches the tabs connected to another within about half a second, at once on Postgres after a quiet stretch, and a process starting reads what the store holds (a server at its start; `kay build --static` and `kay check` read none). Without a store the values live in one process's memory; a `bun test` site keeps them there too. Values are written as island props are, so a `Date` comes back a `Date`. A `set` reads this process's copy, up to half a second behind the store: an updater in two processes at once can lose one change, and a `set` of the value this process shows is skipped even when another process set a newer one, so set the value you mean. Another store implements `LiveStore` (`entries`, `set`, `delete`, `subscribe`, and `stop` and `hold(held)` when it polls: `hold(true)` is called while a page watches a value, to keep its pace); over a network `entries` answers with a promise the server waits for before serving, and `set` and `delete` answer with promises that must not reject (a failure is logged), written in the order they were made while `live.set` stays synchronous.
102
- - Limits: keyed entries stay until `delete` or their `ttl`; a proof lasts an hour, signed with `KAY_SECRET` or a key made at start-up; an open page asks for its own page again every half hour, and at once when a proof is refused with a 403 (a restart without `KAY_SECRET`), taking the fresh proofs; that renders the page again, so a server fence with side effects runs again, and a page that no longer holds a live value (a visitor who may not see it) is asked again only every five minutes; so one who may no longer see the page stops following within the hour; a dropped or refused connection (429, 5xx) is retried with a growing delay, not while the tab is hidden; one client, by `clientAddress()`, holds at most 20 live connections and opens 120 a minute, which `live: { connections, rateLimit: { max, window } }` in kay.config.ts changes, so behind a reverse proxy set `proxy` in kay.config.ts or every visitor shares one address and one cap; a live value an island imports is proven by every page rendering the island (a `--- client` island included), so one read behind a click or in the browser only is followed; a keyed value read only after the render is not, as its key is not known before, so read it in the template.
102
+ - Limits: keyed entries stay until `delete` or their `ttl`; a proof lasts an hour, signed with `KAY_SECRET` or a key made at start-up; an open page asks for its own page again every half hour, and at once when a proof is refused with a 403 (a restart without `KAY_SECRET`), taking the fresh proofs; that renders the page again, so a server fence with side effects runs again, and a page that no longer holds a live value (a visitor who may not see it) is asked again only every five minutes; so one who may no longer see the page stops following within the hour; a dropped or refused connection (429, 5xx) is retried with a growing delay, not while the tab is hidden; one client, by `clientAddress()`, holds at most 20 live connections and opens 120 a minute, which `live: { connections, rateLimit: { max, window } }` in kay.config.ts changes, so behind a reverse proxy set `proxy` in kay.config.ts or every visitor shares one address and one cap; a live value an island imports is proven by every page rendering the island (one declaring `island({ render: 'client' })` included), so one read behind a click or in the browser only is followed; a keyed value read only after the render is not, as its key is not known before, so read it in the template.
103
103
  - A queue's waiting and running jobs are followed the same way with `jobs(name)` from `kay`, the queue declaring `live` and nothing else written: [Queues](queues.md#show-a-queues-jobs-on-a-page).
104
104
 
105
105
  ### Following cached values
106
106
 
107
107
  - `cached(key, ttl, load, { live: true })` makes every page that read the key in its render follow it: once `invalidate` drops the key, a key its `load` read (a collection, another `cached`) or a `cache()` tag it names (also when the process no longer holds the value), each open tab shows the page as its loads give it now, with no island, route or socket written. Read it in the page's or a layout's server fence; a read after the document went out (an `await` block's) or in an API route is not followed.
108
- - The server pushes no value, only that the key changed: the tab runs `refresh()`, so the page is rendered again for that visitor, and a guard, a per-visitor branch, the locale and `base` apply as for any visit. A `persist` island is given the new props and keeps its state; any other island whose props changed hydrates afresh, as after an action.
108
+ - The server pushes no value, only that the key changed: the tab runs `refresh()`, so the page is rendered again for that visitor, and a guard, a per-visitor branch, the locale and `base` apply as for any visit. An island is given the new props and keeps its state, as after an action.
109
109
  - The page carries its `data-kay-live` script with `[kay:cache, key, readAt]` per followed key, covered by the same signed proof, and the entry script loads the `live-cache` chunk only then. `POST /_kay/live` first sends the time each key was last invalidated (0 when never), then one event per invalidation, as often as it happens; a tab refreshes when that time is at or after its page's read, both from the server's clock, so an invalidation between render and connect, or during a dropped connection, is not missed. A page reading no such key opens no connection and loads no code for it.
110
110
  - A refresh waits a random 0 to 750 ms so tabs do not render together, waits while the tab is hidden and runs once it is shown, and one in flight absorbs the events meanwhile. A dropped connection reconnects with a growing delay, from half a second, not while the tab is hidden or the browser offline; a 403 (a proof an hour old, a restart without `KAY_SECRET`, or any followed key whose proof is out of date) refreshes the page and every followed route for new ones. With `navigation: false` the page reloads instead, unless a `guardLeave` holds changes.
111
111
  - Several processes sharing a `sqliteCache`, the one `store: sqliteData(path)` gives included, or the Postgres one of `pgData(db)` ([Jobs](queues.md)), follow each other's `invalidate` (heard within about half a second, up to 5 seconds on a server idle for a few seconds with no tab watching a value: the poll slows while it hears nothing and returns to full pace on a write, a use of the store or while a tab watches; a live store while no `live()` value is declared, and a Postgres cache nothing has used, are not polled); with no shared store a process hears its own only. A key expiring by `ttl` refreshes in the background without telling tabs: only `invalidate` pushes.
@@ -117,7 +117,7 @@ On an `api()` chain only, a message failing `body` is answered `{ error: { key,
117
117
 
118
118
  - `presence({ room, member })` from `kay` in an island lists who else has a room open, with no route, socket or store line: `const here = presence({ room: `entry:${entry.id}`, member: me })`, then `here.others()` (the distinct members besides the visitor's own, in join order, so their other tabs are left out) and `here.count()` (the other tabs in the room, the visitor's own included) are reactive. `presence()`, or `presence({ member })`, is the page's own room, its path under `base` without a trailing slash (a locale prefix stays), with an anonymous member: `count()` is the other tabs on the page.
119
119
  - `member` is any value that crosses as island props do, compared as JSON; hand it in from the page's server fence (`me={{ name: user.name }}`), so what a visitor is listed as is what the server gave. Room and member are at most 256 characters together as JSON, a `RangeError` where `presence` is called (a long path included, for `presence()`).
120
- - The island's server render notes them as a keyed live read of `kay:presence`, so the page's signed proof covers exactly them: a room or member the render did not note, forged or edited in the browser, or an expired proof, gets a 403 and joins nothing, and a guard on the page covers who sees the members. Like any live read the page renders per request (`export-server-render` on a static export) with the members as they stood, and a `--- client` island notes nothing, so has no presence.
120
+ - The island's server render notes them as a keyed live read of `kay:presence`, so the page's signed proof covers exactly them: a room or member the render did not note, forged or edited in the browser, or an expired proof, gets a 403 and joins nothing, and a guard on the page covers who sees the members. Like any live read the page renders per request (`export-server-render` on a static export) with the members as they stood, and an island declaring `island({ render: 'client' })` notes nothing, so has no presence.
121
121
  - A tab joins when its live connection opens (`POST /_kay/live` first sends the room's members besides its own, then a changed list on each join and leave) and leaves when it ends: tab closed, page swapped to one without the room, connection dropped (a dead socket is found by the 5 second heartbeat) or the proof's hour out. A leave waits 3 seconds and a tab keeps one id across its connections, so a reconnect, a proof renewal or a swap to the same room shows the others no leave.
122
122
  - A hidden tab keeps its connection, and stays listed, while it follows a presence key, renewing its proof; live values on that connection keep following too. A page loaded in a hidden tab joins at once.
123
123
  - Members are kept in `store.rooms` of kay.config.ts, which `sqliteData(path)` holds, so replicas sharing a store share presence with no new line (`pgData(db)` does it over Postgres, a member of another replica listed within a poll); one process's memory otherwise. A join or leave reaches the other processes' streams as the store changes, a room is read again every 5 seconds, and a crashed process's members go after about 10 ([Rooms](rooms.md)). One member per open tab, so call `presence` once per room on a page; a page with no presence costs nothing, and a room of many tabs sends each the whole list on every join and leave.
@@ -61,7 +61,7 @@ for issue of todos.issues()
61
61
 
62
62
  ### What a collection is
63
63
 
64
- - `local({ key, read, put, remove?, version?, conflict?, onData?, onIssue?, onError? })` returns `data()`, `status()`, `pending()`, `error()`, `retry()`, `get(key)`, `put(row)`, `remove(key)`, `issues()`, `dismiss(id)`, `sync`, `clear()` and the hooks `onData`, `onIssue` and `onError` as methods. `data()`, `status()`, `pending()`, `error()`, `sync.status()`, `sync.queued()` and `issues()` are reactive; the rows come in key order. `data()`, `status()`, `pending()`, `error()`, `retry()`, `onData` and `onError` are what every source has ([Island sources](island-sources.md)): `status()` is `loading` until the browser's copy is read, then `ready`, or `failed` while `error()` is set, and `pending()` is true while it loads. What is a collection's own, its sync with the server, is under `sync`: `sync()` sends the queue and reads the server's rows again, `sync.status()` says where it stands and `sync.queued()` counts the writes the server has not taken. Before 1.105 `rows()`, `unsynced()`, `syncStatus()` and `onSync({ rows })` did these, and `pending()` and `status()` meant the count and the sync states; the first four work until 1.108 and `deprecated-source-readers` rewrites them.
64
+ - `local({ key, read, put, remove?, version?, conflict?, onData?, onIssue?, onError? })` returns `data()`, `status()`, `pending()`, `error()`, `retry()`, `get(key)`, `put(row)`, `remove(key)`, `issues()`, `dismiss(id)`, `sync`, `clear()` and the hooks `onData`, `onIssue` and `onError` as methods. `data()`, `status()`, `pending()`, `error()`, `sync.status()`, `sync.queued()` and `issues()` are reactive; the rows come in key order. `data()`, `status()`, `pending()`, `error()`, `retry()`, `onData` and `onError` are what every source has ([Island sources](island-sources.md)): `status()` is `loading` until the browser's copy is read, then `ready`, or `failed` while `error()` is set, and `pending()` is true while it loads. What is a collection's own, its sync with the server, is under `sync`: `sync()` sends the queue and reads the server's rows again, `sync.status()` says where it stands and `sync.queued()` counts the writes the server has not taken.
65
65
  - `key` names the field identifying a row, a string or a number. `put` is an action taking the row, `remove` an action taking `{ [key]: value }`, and `read` a function giving the server's rows (`call` or `resource`'s route, or any promise): all three are the app's own, so their guards, schemas, rate limits and cross-site checks apply as to any call.
66
66
  - The collection is named by its `put` action's URL, so declare it once per action; two islands declaring it share one mirror.
67
67
  - On the server, and in a browser without IndexedDB, `local()` gives an empty collection: `sync.status()` is `'loading'` on the server and `'unavailable'` where the browser keeps nothing, and a write there throws. Nothing loads on a page that does not import it.
package/llms/locales.md CHANGED
@@ -217,7 +217,7 @@ export default defineMessages({
217
217
  - Using it makes the component an island.
218
218
  - `T` renders a message holding markup, such as a link mid-sentence: see [Messages holding markup](#messages-holding-markup).
219
219
  - `formatNumber(value, options)` and `formatDate(value, options)` format through `Intl` for the request's locale, and so do `formatRelativeTime(date)`, a date relative to now in the largest unit it reaches, `3 days ago`, `yesterday` or `in 2 hours`, `formatRelativeTime(2, 'week')` in the unit given, and `formatList(['Ada', 'Grace'])`, `Ada and Grace`. Outside a request, in a job, an alert or a push, these and `direction()` use the site's default locale (`en` when the site names none) instead of throwing, so a page and a mail format the same date alike. Each takes a `locale` among its options (`formatDate(date, { locale: user.locale })`) that wins over the request's, for a mail written in its reader's language. `formatDate` options that name no part of the date (none, a `locale`, a lone `timeZone` or `calendar`) give the medium date, as no options do.
220
- - `formatBytes(1536)` is `1.5 kB` (a `ByteSize`: bytes or `'1.5kb'`) and `formatDuration('125m')` (a `Duration`, `'7500s'`, `'2h'`) is `2 hr 5 min`, a number of milliseconds being deprecated since 1.105 (`deprecated-format-duration`), each in the page's locale with a `locale` option of its own, `unitDisplay: 'long'` for the unit in full. `timeZone: 'Europe/Paris'` in kay.config.ts is the zone every `formatDate`, a message's date placeholder, `RelativeTime`'s tooltip write in; a chart's labels keep the machine's zone, on the server and in the islands alike, unless a call names its own `timeZone`, so on the server a time of day built from an instant is written in the server's zone until the island rewrites it in the visitor's, and `timeZone()` from `kay/i18n` reads it.
220
+ - `formatBytes(1536)` is `1.5 kB` (a `ByteSize`: bytes or `'1.5kb'`) and `formatDuration('125m')` (a `Duration`, `'7500s'`, `'2h'`) is `2 hr 5 min`, a number of milliseconds being no duration, each in the page's locale with a `locale` option of its own, `unitDisplay: 'long'` for the unit in full. `timeZone: 'Europe/Paris'` in kay.config.ts is the zone every `formatDate`, a message's date placeholder, `RelativeTime`'s tooltip write in; a chart's labels keep the machine's zone, on the server and in the islands alike, unless a call names its own `timeZone`, so on the server a time of day built from an instant is written in the server's zone until the island rewrites it in the visitor's, and `timeZone()` from `kay/i18n` reads it.
221
221
  - In an island, give `formatRelativeTime` the moment it is relative to, `{ now }`, from the server, so the browser renders what the server did, or use `relativeTime`.
222
222
  - `locales()` is the configured locales in `i18n`'s order, only the page's own without `i18n`; `localeName('fr')` is `Français`, `localeName('pt-BR')` is `Português (Brasil)`, each in its own language through `Intl.DisplayNames`, first letter capitalized, a code `Intl` cannot read as written.
223
223
  - `direction()` is `rtl` or `ltr`, for the request's locale or the one given.
package/llms/mcp.md CHANGED
@@ -47,10 +47,10 @@ expect(await site.mcp.call('add_note', { title: 'Milk' })).toMatchObject({ isErr
47
47
  - An `onRequest` hook that throws, the app's own Elysia one, a param matcher, `rewrite` or an extension's, is answered like a handler that throws: logged, handed to `onError`, and a 500 with `Internal Server Error` in production, the message in development, instead of Elysia's 200; a GET asking for HTML gets the routes directory's `_error.kay` (or kay's error page) in the default locale, any other request plain text. A `Response` the hook throws is answered as given, and an `onError` registered before `pages()` answers first. An `_error.kay` drawn for it reads in `ctx.locals` what a `derive` added before it threw.
48
48
  - `honeypot`, `minTime` and `proofOfWork` are skipped, as only a form a person filled in can pass them; a marker only the endpoint sets, a per-process secret no request can send, says so, and `rateLimit` still counts.
49
49
  - A path param is one segment: it is percent-encoded and an empty one, `.` or `..` is refused, so no value reaches another route.
50
- - A refused call is a result with `isError`: the schema's field errors, the `ctx.fail` data and status as `{ status, errors, data }` JSON, a route's own refusal text, a redirect naming where it leads. The agent corrects and calls again.
50
+ - A refused call is a result with `isError`: the schema's field errors, the `ctx.deny` data and status as `{ status, errors, data }` JSON, a route's own refusal text, a redirect naming where it leads. The agent corrects and calls again.
51
51
  - A guard answering 401 makes the endpoint answer 401 with `WWW-Authenticate: Bearer resource_metadata="<site>/.well-known/oauth-protected-resource"`, how a client learns to sign in (kay serves that document when kayjs-auth's OAuth server is on: see its "OAuth server for MCP clients"); any other refusal, 403 included, is a result. Only a guard's 401 does: a route answering 401 itself is a result too. A refused `tools/list` answers the same way (a redirect counting as a 401), as a JSON-RPC error. It keeps the guard's response headers, `Retry-After` of a 429 among them. A `tools/call` of a name no tool has is refused the same way, so names cannot be probed; a call to a tool runs its own guards.
52
52
  - A result is JSON as text, and `structuredContent` when an object; any other type read as its size. A route's object `response` is the tool's `outputSchema`, with no `detail.tool.output` ([action protection](action-protection.md#offering-an-action-to-agents)).
53
- - Until 2.0, an app that did not set `endpoints.mcp` is answered at `/mcp` as well, in place, under the same limits, key and checks, unless a page, endpoint or file serves `/mcp`, which keeps it. Only a POST is taken there, so a `[...rest]` or `[slug]` page still answers GET and DELETE; only an exact route at `/mcp` takes POST from kay.
53
+ - The endpoint was at `/mcp` before 1.105; that path stopped answering in 1.109.
54
54
  - `/_kay/mcp` (`endpoints.mcp`) is claimed like a route: a page, endpoint or file serving it stops the boot, and `kay check` reports it.
55
55
  - `unguarded-tool` warns, with `mcp`, of a tool action with a `honeypot`, `minTime` or `proofOfWork` that no guard covers: an agent calls it without the form those protections ask of a person. A `...spread` in the options counts as one of them, so it warns; options that are not an object literal, `action(schema, run, options)`, are not read, so the action is not taken for a tool.
56
56
  - `site.mcp.initialize()` resolves with `{ serverInfo, instructions }` of the `initialize` answer, `instructions` being `mcp: { instructions }` or undefined.
package/llms/metrics.md CHANGED
@@ -16,7 +16,7 @@ Prometheus or any compatible collector scrapes `/_kay/metrics` with `Authorizati
16
16
 
17
17
  ## Reference
18
18
 
19
- - `ops: { metrics: true }` in kay.config.ts serves `/_kay/metrics` in the Prometheus text format, for Prometheus or any compatible collector (Grafana Alloy, the OpenTelemetry collector's Prometheus receiver): `endpoints: { metrics: '/_internal/metrics' }` moves it. Before 1.105 it was `/metrics`, which answers as well until 1.108 while `endpoints.metrics` is not set (unless the app serves something there). It is off by default, and a server run by `kay dev` or a static export serves none.
19
+ - `ops: { metrics: true }` in kay.config.ts serves `/_kay/metrics` in the Prometheus text format, for Prometheus or any compatible collector (Grafana Alloy, the OpenTelemetry collector's Prometheus receiver): `endpoints: { metrics: '/_internal/metrics' }` moves it. Before 1.105 it was `/metrics`, which stopped answering in 1.109. It is off by default, and a server run by `kay dev` or a static export serves none.
20
20
  - It holds `kay_http_requests_total{method,route,status}` and the histogram `kay_http_request_duration_seconds{method,route}`, `kay_queue_runs_total{queue,result}` (`ok`, `retried`, `failed`; a workflow is `workflow:<name>`), `kay_job_runs_total{schedule,result}` (`ok`, `failed`, `skipped` when another process held the lock), `kay_session_events_total{event}` (`created`, `destroyed`), `kay_file_events_total{event}` (`written`, `deleted`), `kay_cache_reads_total{result}` (`hit` or `miss` of `cached` and `cache`), `kay_live_connections`, `kay_process_resident_memory_bytes` and `kay_process_uptime_seconds`.
21
21
  - A page counts under its pattern, `/shop/:item`, an API route under its route, and a path nothing serves under `unmatched`, so a scan adds no series; at most 500 routes are kept, the rest read `other`. The scrape itself and the health route are not counted, nor a request an earlier hook answers (a redirect, a refusal by `proxy.key`), and a method no server knows reads `OTHER`.
22
22
  - It is never public by default: only a request that reached the socket from this machine or a private network (a collector in the same compose network, a sidecar) and carries no `X-Forwarded-*`, `X-Real-IP`, `Forwarded`, `Via` or `CF-Connecting-IP` header, nor the headers `proxy.header` and `proxy.key.header` name, is answered; every other gets 403, a trailing slash, a query or the `base` in the path included. Do not forward the path from the reverse proxy: one that adds none of those headers cannot be told from a collector.
@@ -45,9 +45,9 @@ const dispose = mount(Panel, document.querySelector('#panel')!, { title: 'Ticket
45
45
  ### Navigating from code
46
46
 
47
47
  - `navigate('/todos/1')`, imported from `kay`, goes to a page as a link would (the mount point and the current locale's prefix put on as on any `href`, `/todos/1` on a French page going to `/fr/todos/1`, a path already prefixed or another site's URL left as written; a module that gets `navigate` through a dynamic `import('kay')` is not covered, so import it statically), `{ replace: true }` taking the current history entry's place, `{ scroll: 'keep' }` leaving the window scrolled where it is instead of going to the top, `{ transition: false }` swapping without a view transition; another site's page loads, so a `?next=` param goes through `localPath()` as a redirect's does, and a `javascript:` URL throws, as it would run in the page; `mailto:`, `tel:` and other schemes go to the browser as a link would. A link or `navigate()` that a redirect takes to another site loads that page fully rather than swapping it in.
48
- - `navigate.query({ sort: 'name', page: null })` goes to the current page with those params set (a list sets one param once per item, `{ tag: ['a', 'b'] }` giving `?tag=a&tag=b`) and a null, undefined or empty one dropped, the others and the path kept and the hash left out, keeping the scroll and the focus as `refresh()` does: a filter or a sort picked in place. It takes the options of `navigate()` and resolves as it does. `navigate({ query })`, which did this under the name that goes to a page, works until 1.108, `kay upgrade` rewriting it (`deprecated-navigate-query`). A query that is state of the page, not a one-off change, is a `queryParam` signal ([state](islands-state-to-ids.md#shared-and-persisted-state)).
48
+ - `navigate.query({ sort: 'name', page: null })` goes to the current page with those params set (a list sets one param once per item, `{ tag: ['a', 'b'] }` giving `?tag=a&tag=b`) and a null, undefined or empty one dropped, the others and the path kept and the hash left out, keeping the scroll and the focus as `refresh()` does: a filter or a sort picked in place. It takes the options of `navigate()` and resolves as it does. A query that is state of the page, not a one-off change, is a `queryParam` signal ([state](islands-state-to-ids.md#shared-and-persisted-state)).
49
49
  - `withQuery({ page: 2, sort: null })` from `kay`, in a server fence, a template or an island (where it follows the address, so the link is built again after each `navigate.query()`, swap, Back and `queryParam` write), returns the path of the current page with those params set by the rule of `navigate.query()`, the other params kept and the hash left out, to link to it with one filter changed: `a(href={withQuery({ page: 2 })}) Next`. The path is the site's own, so `base`, `trailingSlash` and the locale prefix are put on by the link as on any `href`; in a fence it reads the request, so it throws in a page rendered once at build time.
50
- - `refresh()` from `kay` runs the current page's loads again and shows what they return, keeping the scroll, the focus and every island whose props did not change, as a call to an action does by itself once it went through.
50
+ - `refresh()` from `kay` runs the current page's loads again and shows what they return, keeping the scroll, the focus, every island (kept with its state and given its new props, [navigation](navigation.md#islands-kept-across-pages)), a field the visitor typed in and a `details` the visitor toggled, as a call to an action does by itself once it went through.
51
51
  - `refresh('cart')` or `refresh(['cart', 'user'])` sends and swaps only the elements of the page reading the loads of its fence that bind those names, and leaves the rest of the page as it is: [rendering](rendering.md#refreshing-some-loads).
52
52
  - An island calls `refresh()` once something else changed what the page shows, or polls with it, `every('3s', refresh, { while: () => issuing })`.
53
53
  - A `refresh()`, including the one an action's call or a live value ends in, never cancels a link, `navigate()` or Back in flight: it waits for the swap, then runs again only when the swap left the URL it was asked for, since the new page is as recent as its answer. An island polling an action needs no `{ refresh: false }` to keep links working.
@@ -75,8 +75,8 @@ const dispose = mount(Panel, document.querySelector('#panel')!, { title: 'Ticket
75
75
  - `navigation.onBeforeNavigate(({ url, from }) => ...)`, called in an island's script, is asked with the URL going to and the page left before a link of the app, `navigate()` or going back or forward leaves the page, for as long as the island lives, and returns what removes it sooner. Returning `false`, or a promise of it, keeps the page (`navigate()` resolves `false`, a refused Back or Forward is undone as under `guardLeave`); anything else lets it go. A handler that throws, here and in `onNavigate`, is logged and the navigation goes on, as a browser hook is never a security boundary. It answers before the `guardLeave` guards, which are not asked when it refuses.
76
76
  - It is asked for a navigation kay swaps in place only: not for a post's redirect, a form's or an island action's (the `guardLeave` guards still ask), as the action already ran, nor for a refresh, a link or `navigate()` to another site, an API or `/_kay` path or a site with `navigation: false` (loaded fully), nor a reload.
77
77
  - While a handler is registered, every Back and Forward goes back to the page left first, as under a guard holding changes, and is made again once the handlers allow it: two history traversals, the scroll restored as for any traversal.
78
- - `navigation.onNavigate(({ url }) => ...)` runs with the URL of each page a swap shows, once it is in place, for as long as the island lives, returning what removes it sooner; it is `kay:navigate` for an island, and fires for a refresh as that does. The two hooks are the methods of `navigation`, as `resource` has `onData`, taking one object and returning what removes them; the functions `navigation.onBeforeNavigate` and `onNavigate` of `kay`, which did the same, work until 1.108 and `kay upgrade` rewrites them (`deprecated-navigation-hooks`).
79
- - `navigation.onStart(({ url }) => ...)` runs when a swap to another page begins, `navigation.onError(({ url, error }) => ...)` when it gives up (`error` an `ApiError` of status 0 with kay's message and the browser's as `cause`, as `error()` reads it) and `navigation.onStall(({ url }) => ...)` when a streamed page sent nothing for `pageTimeout`; with `onNavigate` they take one object, end with the island and return what removes them. They are the island's form of the `kay:navigate-start`, `kay:navigate-error`, `kay:navigate-stall` and `kay:navigate` events on `document` (`detail.url`, and `detail.error`, an `Error`), which a plain script listens to (see [Navigation](navigation.md#navigation)); `listen(() => document, 'kay:navigate', ...)` in an island is `deprecated-island-events`, which rewrites a handler with no parameter. A refresh fires `kay:navigate` alone.
78
+ - `navigation.onNavigate(({ url }) => ...)` runs with the URL of each page a swap shows, once it is in place, for as long as the island lives, returning what removes it sooner; it is `kay:navigate` for an island, and fires for a refresh as that does. The two hooks are the methods of `navigation`, as `resource` has `onData`, taking one object and returning what removes them.
79
+ - `navigation.onStart(({ url }) => ...)` runs when a swap to another page begins, `navigation.onError(({ url, error }) => ...)` when it gives up (`error` an `ApiError` of status 0 with kay's message and the browser's as `cause`, as `error()` reads it) and `navigation.onStall(({ url }) => ...)` when a streamed page sent nothing for `pageTimeout`; with `onNavigate` they take one object, end with the island and return what removes them. They are the island's form of the `kay:navigate-start`, `kay:navigate-error`, `kay:navigate-stall` and `kay:navigate` events on `document` (`detail.url`, and `detail.error`, an `Error`), which a plain script listens to (see [Navigation](navigation.md#navigation)). A refresh fires `kay:navigate` alone.
80
80
  - `guardLeave(dirty, { confirm })` is the preset of `navigation.onBeforeNavigate` for unsaved changes: it asks `confirm(url)`, `window.confirm` by default, while `dirty()` holds, where the hook is asked for every leave; it also covers what no hook is asked for (a reload, closing the tab, a form's or an action's redirect), and is the one to write for that case.
81
81
 
82
82
  ### Full loads and prefetching
@@ -90,13 +90,13 @@ const dispose = mount(Panel, document.querySelector('#panel')!, { title: 'Ticket
90
90
  - A page in another locale, or one built against another client build, loads fully too, as does a page setting `reload: true` in its `page` or its layout's, and one whose cross-origin isolation differs from the current page's, which a document cannot change in place.
91
91
  - Such a page still swaps itself in place: a link to it with another query, `navigate.query()` and `refresh()` on it.
92
92
  - The swap prefetches as the speculation rules would, on the timing the `prefetch` setting gives (see [Project setup](project.md#project-setup)), and a page loading it carries that setting alone, not the rules, so each page is fetched once: a hovered link's page is kept for 30 seconds and taken as the link is followed.
93
- - `data-prefetch="false"`, on the link or a container, opts a link out (`data-no-prefetch` does until 1.108, `deprecated-link-flags`); `data-prefetch="eager|moderate|conservative"` gives it its own level, read by the swap's code only (a page without kay's script keeps the page's level). `eager` fetches the links scrolled into view, three at a time, from the page's load on, those added later by an island, a stream or a scroll included. The nearest `data-prefetch` wins, and it does nothing under `prefetch: false`, which ships no prefetch code.
93
+ - `data-prefetch="false"`, on the link or a container, opts a link out; `data-prefetch="eager|moderate|conservative"` gives it its own level, read by the swap's code only (a page without kay's script keeps the page's level). `eager` fetches the links scrolled into view, three at a time, from the page's load on, those added later by an island, a stream or a scroll included. The nearest `data-prefetch` wins, and it does nothing under `prefetch: false`, which ships no prefetch code.
94
94
  - A visitor asking for less data (`Save-Data: on`) gets a lighter site with no setting: the image route answers the next width down of the ladder (see [Images](images.md#responsive-images)), font preloads, speculation rules and any other `rel="preload" as="font"` link leave the page, its fonts show only when cached (`font-display: optional`), and the swap prefetches nothing. In the browser, `prefers-reduced-data: reduce` and `navigator.connection.saveData` stop the swap's prefetch alone, as no media query can drop a preload.
95
95
  - Pages say `Vary: Save-Data`, so a cache or CDN keeps the two copies apart; a prerendered page is served to that visitor from its plain HTML, not the compressed copies the build wrote, its head changed on the way out. A static export has no header to read: the prefetch and the islands' wait still follow the browser, but the preloads stay.
96
96
  - Islands wait too: those with no `hydrate` hydrate once they scroll near, and the page preloads none of their chunks when the request says `Save-Data` (see [Islands](islands.md#hydration)).
97
97
  - A page streaming `await` blocks is swapped in once its first part is in, with the `pending` branches: `navigation.status()` is `'idle'` and `kay:navigate` fires then, once, while blocks may still be arriving, and each block replaces its branch in place later, firing nothing, its islands hydrating as it lands. A navigation to another page ends the stream. If the stream sends no byte for `pageTimeout` (the server writes a keep-alive every 5 s, so keep it above that) the blocks still pending stay as they are, the console gets a warning and `kay:navigate-stall` fires on `document` with `event.detail.url`, once, for an app to offer a retry; the page is not requested again, and `kay:navigate-error` is not fired.
98
98
  - `client: { saveData: false }` in `kay.config.ts` or `pages()` gives everyone the same page and image, with no `Vary`.
99
- - A link, or one inside an element, with `data-scroll="keep"` swaps without scrolling to the top, and with `data-transition="false"` without a view transition, named as `navigate()`'s `scroll: 'keep'` and `transition: false` are; going back still restores the position saved, and a hash in the URL is not scrolled to while the scroll is kept. The nearest `data-scroll` to the link decides, so `data-scroll="top"` on a link, or on an element between it and a keeping one, scrolls to the top as a plain link does, and the nearest `data-transition` likewise (`data-transition` alone turns it back on inside a `"false"`). `data-scroll`, `data-transition`, `data-prefetch` and `data-reload` are typed on every element, a value outside their words a `kay check` error, and a `data-` name one letter from one of them (`data-prefech`) is the `unknown-link-flag` error. `data-keep-scroll`, `data-no-transition` and `data-no-prefetch` work until 1.108, `kay check --fix` writing the new names (`deprecated-link-flags`).
99
+ - A link, or one inside an element, with `data-scroll="keep"` swaps without scrolling to the top, and with `data-transition="false"` without a view transition, named as `navigate()`'s `scroll: 'keep'` and `transition: false` are; going back still restores the position saved, and a hash in the URL is not scrolled to while the scroll is kept. The nearest `data-scroll` to the link decides, so `data-scroll="top"` on a link, or on an element between it and a keeping one, scrolls to the top as a plain link does, and the nearest `data-transition` likewise (`data-transition` alone turns it back on inside a `"false"`). `data-scroll`, `data-transition`, `data-prefetch` and `data-reload` are typed on every element, a value outside their words a `kay check` error, and a `data-` name one letter from one of them (`data-prefech`) is the `unknown-link-flag` error.
100
100
  - A stylesheet holding `@view-transition { navigation: auto; }` animates the swap where the browser has view transitions, as it animates full loads, the rule standing at the top level or inside an `@media` or `@supports` that holds.
101
101
  - A visitor asking for reduced motion (`prefers-reduced-motion: reduce`) gets no animation from the swap whatever the stylesheet says; a full load animates for them unless the rule sits in `@media (prefers-reduced-motion: no-preference)`, as the one `kay new` writes does.
102
102
  - `client: { navigation: false }` in `kay.config.ts` or `pages()` turns it off: pages load fully, and only pages with islands ship a script.
@@ -106,7 +106,7 @@ const dispose = mount(Panel, document.querySelector('#panel')!, { title: 'Ticket
106
106
 
107
107
  - A page another server or tool bundles, such as an HTML file `Bun.serve` imports, renders `.kay` components too.
108
108
  - The plugin `kay` from `kay/bun` compiles them, for the browser in a browser build: list `"kay/bun"` under `[serve.static] plugins` in `bunfig.toml`, which `Bun.serve` reads from the directory it starts in, or pass `kay({ root })` to `Bun.build`'s `plugins`, `root` being where `.kay/` goes, the working directory by default.
109
- - `mount(Component, element, props)` from `kay` (`kay/mount` still exports it until 1.108, `deprecated-import-path` moving the import) renders one into an element, as an island renders but with no server markup to hydrate, and returns a handle, which disposes it when called, ending its effects and removing only the nodes it rendered, so several components mounted into one element are disposed one at a time and the rest of the element stays as it was.
109
+ - `mount(Component, element, props)` from `kay` renders one into an element, as an island renders but with no server markup to hydrate, and returns a handle, which disposes it when called, ending its effects and removing only the nodes it rendered, so several components mounted into one element are disposed one at a time and the rest of the element stays as it was.
110
110
  - `props` may be left out for a component taking none.
111
111
  - The handle is `{ update(props), dispose }` as well as the disposer: `handle.update({ title: 'Done' })` gives the mounted component its next props, which it reads reactively as an island does (a prop left out reads `undefined`), and `handle.dispose()` is `handle()`. `update` after a dispose does nothing.
112
112
  - `props` may be a function, `mount(Panel, el, () => ({ title: title() }))`, read as an effect reads: the mount follows the signals it uses, so a widget keeps current with no `update` call; an `update` on such a mount holds until a signal the function reads changes. The component reads a copy of the props, one getter each, not the object passed, and a function that throws on the first read throws out of `mount` with nothing left in the element. A prop changes when it is another value (`Object.is`).
@@ -63,7 +63,8 @@ A handler of your own on Enter in a text field starts with `if (composing(event)
63
63
  - The body is morphed rather than replaced: an element the next page renders again, in the same place with the same tag, `id` and `class`, stays the same element and takes the next page's attributes and children, so a layout's sidebar keeps where it was scrolled to and its links' `aria-current` moves, with nothing to mark.
64
64
  - A form field shows the value the next page renders, as on a page loaded afresh, and a popover or a dialog left open closes.
65
65
  - The element holding the new page's `h1`, such as a main column scrolling on its own, goes back to the top as the window does.
66
- - Islands are never morphed: one is kept only when marked `persist` or, on a refresh, unchanged; every other one is ended and the next page's hydrates afresh.
66
+ - Islands are never morphed: one is kept when it has its match in the next page, and takes that page's props in place (below); every other one is ended and the next page's hydrates afresh.
67
+ - The rule of every swap is to apply what the server changed and keep what the visitor changed. On a refresh (an action's, `refresh()`, a live value's) a field whose value the server's render left as it was keeps what was typed in it, in production as in `kay dev`, and a `details` the visitor toggled keeps its state, whatever the server renders for it again; a value the server changed takes the new one. A visit or a redirect to another page, and a form refused, show the next page's own.
67
68
  - Outside the body's content, one rule holds for the head's elements, the attributes of `<html>` and those of `<body>`: what the server served changes as the next page serves it, and what a script changed or added since stays as the script left it. A theme toggle's `meta[name="theme-color"]`, a tag a loader added to the head and a class a script put on `<body>` live on through every swap, a meta a script changed or added standing in for the next page's meta of that name and media, while a head tag the page left served alone goes with it. The server writes `<body>` bare, so its attributes are always a script's. A change an inline head script makes before kay's script runs counts as served. A served head tag a script removed comes back with the next page serving it, and a `<style>` an island injects itself outlives the island.
68
69
  - An element a script put in `<body>` goes with the next swap, as the next page never renders it; marked `data-kay-keep`, a direct child of `<body>` lives on through every swap, the same element left where it is, never moved, such as a live region an announcer fills: kayjs-ui's `announce()` marks its own. A server-rendered element takes no `data-kay-keep`, as the next page renders it again.
69
70
  - A swap fires `kay:navigate` on `document` once the new page is in place and its islands are hydrating, with `event.detail.url` the page's address, so a plain script (an analytics tag, a lightbox) can set itself up again; a full load fires none. `kay:navigate-start` and `kay:navigate-error` come before it, and `navigation` and `onBeforeNavigate` follow it from an island: [navigation state and hooks](navigation-from-code.md#navigation-state-and-hooks).
@@ -81,12 +82,13 @@ A handler of your own on Enter in a text field starts with `if (composing(event)
81
82
  ### Islands kept across pages
82
83
 
83
84
  - An island marked `persist` lives on from page to page, its state and its element kept, when the next page renders it too: `Player(persist)` in a layout keeps a song playing.
85
+ - An island without `persist` is kept too when the next page renders the same component in the same place, its state staying and its props given in place: on a refresh any island is paired so, by component and its `key` or `id` prop when it has a string or number one, else by order among the islands of that component, so give a list of islands an `id` or a `persist` (an island marked `persist` by its key first); on a visit, a query change, Back or a redirect only the islands a layout renders are, by layout, component and order, so a sidebar's folded group or a menu stays as it was while a page's own islands are ended. An island whose static slots changed, or with no match, is ended, and a list whose items move is kept by `persist={id}`, which also changes the island by changing it. A call or a `refresh()` has `refresh: false` to leave the page alone.
84
86
  - A browser with `Element.moveBefore` (Chrome 133, Firefox 144) moves it in place, so an iframe in it stays loaded, a video keeps playing and the focus stays in it; elsewhere it is taken out and put back, and the swap gives the focus and the selection back; a popover open in it closes either way. The scroll of every element inside it, nested ones and horizontal scroll too, is kept either way.
85
87
  - `persist` takes a static or a dynamic value, a string computed from props or state (`Graph(persist={`${repo}:${scope}`})`): another value is another island, ended and hydrated afresh, while the same value keeps it.
86
88
  - A bare `persist` matches the same component on the next page; `persist="left"` names one use, for two uses of a component to be told apart.
87
89
  - Only an island takes `persist`, and only from a static parent.
88
90
  - The props the next page gives a kept island reach it as a component inside an island gets new props: what reads them in the template or an effect shows the new values, while a value the script computed from them once keeps the old one.
89
- - The element focused inside an island a swap keeps, marked `persist` or unchanged on a refresh, stays focused, a text field, `textarea` or `contenteditable` with its caret and selection, so a field whose every key shows a draft or refreshes the page keeps taking the keys.
91
+ - The element focused inside an island a swap keeps, stays focused, a text field, `textarea` or `contenteditable` with its caret and selection, so a field whose every key shows a draft or refreshes the page keeps taking the keys.
90
92
  - A text field or `textarea` the swap replaces on a query `navigate()`, a refresh or a redirect, such as a field of an island hydrated afresh for its new `value` prop, gets the focus back with the caret and selection of the old one (kept within the new text, at its end when the caret was at the end), so a search as you type keeps taking the keys; on a query `navigate()` or a refresh, keys typed in it while the page was fetched are kept, and its `input` event fires again so the island asks for them.
91
93
  - The focused element a swap keeps holds on to the `tabindex` a script gave it when the next page's markup has none, until the focus leaves it, as the browser would otherwise move the focus to the body: a heading the swap focused, or a kayjs-cms title whose inline edit just ended, stays focused through a refresh or a draft's render.
92
94
  - A swap to a new page still moves the focus to its heading.
@@ -158,3 +158,4 @@ export const pageWeight: KayExtension = {
158
158
  - With `i18n.mode: 'always'`, each unprefixed path sends the browser to the default locale's copy.
159
159
  - Locales by domain need a server.
160
160
  - The directory is cleared first, only when the last export wrote it: kay refuses one holding other files, and the project itself.
161
+ - A page is rendered once, at the default query, and served at every query (`/page?tab=b` is `page.html`). An island reading a `queryParam` is marked `data-query` by that render: the browser draws it again from the address when the page is opened with a query, rather than claiming markup made for the default one, so it shows `?tab=b` with no mismatch. The page's own markup outside islands stays the default's, as does the island's before its JavaScript runs, so read the query in an island, never in the page, and the build warns naming each page holding such an island. The same holds for any `prerender: true` page.
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### Log requests as JSON for a log collector
6
6
 
7
- `ops: { observe: { log: { format: 'json' } } }` in kay.config.ts writes one JSON object per line, requests included, on stdout for info and on stderr for warnings and errors; `log: { sink }` hands each entry to a function instead, and `requests: false` keeps kay's messages and logs no request line (`log: 'json'` and a bare function work until 1.108, `deprecated-app-hooks` rewrites them):
7
+ `ops: { observe: { log: { format: 'json' } } }` in kay.config.ts writes one JSON object per line, requests included, on stdout for info and on stderr for warnings and errors; `log: { sink }` hands each entry to a function instead, and `requests: false` keeps kay's messages and logs no request line (`log: 'json'` and a bare function are refused):
8
8
 
9
9
  ```ts
10
10
  import { defineConfig } from 'kay/server'
@@ -121,7 +121,7 @@ Then `await welcomeMails.enqueue({ to: email })` in an action, or `enqueue(paylo
121
121
  - A library logs through the same setting with `logFrom` from `kay`: `const log = logFrom('kayjs-mail')`, then `log.info(message)`, `log.warn(message)` or `log.error(message, error)`.
122
122
  - Its lines read `kayjs-mail: ` and the message, headed by the request being answered as kay's are, in a page, an action, an endpoint or a guard, though not in an API module's handler or a socket, which Elysia runs outside any call kay makes, and carry `from: 'kayjs-mail'` as JSON or in the entry a log function receives.
123
123
  - Outside a server, in the browser or a script, they go to the console as `[kayjs-mail] message`.
124
- - Every response carries its request's id as `X-Request-Id`, time-ordered, made by kay unless `proxy` is set and the proxy passed one on in that header; `observe: { requestIdHeader: 'x-correlation-id' }` in kay.config.ts names another header for both.
124
+ - Every response carries its request's id as `X-Request-Id`, time-ordered, made by kay unless `proxy` is set and the proxy passed one on in that header; `ops: { observe: { requestIdHeader: 'x-correlation-id' } }` in kay.config.ts names another header for both.
125
125
  - An error logged while answering a request is headed by the request, `kay: GET /blog/hello, request AZnLe0vUe9qD0uXq9vLwZw`, then its stack, so a line from a user or a log search finds both.
126
126
  - `requestId(request)` from `kay/server` gives it, in `onError` or a route, and a server span carries it as `kay.request.id` ([Tracing](tracing.md)).
127
127
 
@@ -57,7 +57,7 @@ kay generate resource post title:string body:text published:boolean
57
57
  - `kay generate <page|component|island|action|api|guard|resource> <name> [field:type...] [dir] [--dir <dir>] [--plural <name>] [--dry-run] [--format text|json] [--quiet]`:
58
58
  - Writes a starter file into the project in `dir` (the current directory by default), by `<name>`, and never over a file that exists: one that does stops it with `kay generate: nothing was written`.
59
59
  - `page pricing` writes `src/routes/pricing.kay` (`blog/[slug]` and `(group)/about` are routes too; its `h1` takes Tailwind's shorthand classes when the project has Tailwind), `component card` and `island likes` write `src/components/card.kay` (a `label` prop) and `src/components/likes.kay` (a signal and a button), `api notes` writes `src/api/notes.ts` (`api().get('/')`), `guard admin` writes `src/routes/admin/_guard.ts` (`/` for the root one; its function does nothing, for you to write the rule in) and `action team/removeTissue` writes the action `removeTissue` into `src/routes/team/_actions.kay` (a schema and a handler). An `_actions.kay` that holds a server fence alone gets the action appended (`import { s } from 'kay'` added when it lacks it); one already exporting that name stops the command, and one with a template or other fences is left alone and the command prints the action to add by hand.
60
- - A project with `tests` (`bunfig.toml`) also gets `tests/<name>.test.ts` for a page (it visits the URL, a project with `auth` expecting the redirect to sign in), `tests/action-<name>.test.ts` for an action (`site.call` and `site.refusal`) and `tests/api-<name>.test.ts` for an API module (`site.api`) and `tests/guard-<name>.test.ts` for a guard with a page below its folder (it visits the shallowest one, a project with `auth` expecting the redirect to sign in), a `/` in the name written `-`; none for a component or an island, nor for a guard with no page below, nor for a page with a param, and none for an action or API module in a project with `auth`, whose guard answers first.
60
+ - A project with `tests` (`bunfig.toml`) also gets `tests/<name>.test.ts` for a page (it visits the URL, a project with `auth` expecting the redirect to sign in), `tests/action-<name>.test.ts` for an action (`site.call` and `site.expectRefused`) and `tests/api-<name>.test.ts` for an API module (`site.api`) and `tests/guard-<name>.test.ts` for a guard with a page below its folder (it visits the shallowest one, a project with `auth` expecting the redirect to sign in), a `/` in the name written `-`; none for a component or an island, nor for a guard with no page below, nor for a page with a param, and none for an action or API module in a project with `auth`, whose guard answers first.
61
61
  - `resource post title:string body:text` (a project with `postgres`, else it stops naming `kay add postgres`; the fields are `name:type` and every argument after the name is one, the project folder being `--dir <dir>` (cwd by default), the type `string` (varchar 200), `text`, `int`, `float` or `boolean`, all required, and `name`, written `blog-post` or `blogPost`, gives the table `blog_post`, `BlogPost` and the folder `src/routes/blog-posts`; a last word ending in a single `s` (`news`, `ideas`, `menus`) is a plural already, except a known singular such as `status` or `bus`, and `person` gives `people`, so `--plural <name>` names the plural of the whole name, such as `blog-geese`, for any other word) writes the pg-orm table `src/db/<name>.ts`, added to `tables` in `src/db/tables.ts`, an `_actions.kay` with `create`, `update` and `remove` over `s` schemas built from the fields (each redirecting to the list), the list at `/blog-posts` and the edit page `[id=integer]/edit.kay` with a delete button. With kayjs-ui installed the list is a `Table` in `src/components/blog-posts-table.kay`, the create form a `FormDialog` in `src/components/new-blog-post.kay` and the edit page a `SaveForm`; else the list is a plain `table`, with a `new.kay` page of `form`s. A project with tests gets `tests/blog-posts.test.ts`, which creates a row and reads the list, edits and deletes it, and refuses a create with an empty text field (a word for a number when there is none). A `tables` list holding a comment or an index is left alone and the command stops, naming what to add. Run `bun run db:generate` and `bun run db:migrate` for the new table.
62
62
  - What it writes passes `kay check` and the lint. `--dry-run` lists the files and writes none, and `--format json` prints `{ kind, name, written, dryRun }`.
63
63
  - `kay add <features> [dir] [--no-install] [--dry-run] [--format text|json] [--quiet]`:
package/llms/project.md CHANGED
@@ -78,7 +78,7 @@ export const app = new Elysia()
78
78
  - A key kay does not know in `kay.config.ts`, at its top or in any option bag (`security`, `i18n`, `assets`, `markdown`, `ops`, `cors`, `client` and the rest), stops every command with the nearest known name (`` `trailingslash`, did you mean `trailingSlash`? ``), and `defineConfig` types it as an error, since a mistyped key would otherwise leave kay's default in place with nothing said.
79
79
  - A value that is not the kind its key takes (`trailingSlash: 'sometimes'`, `compress: 7`, `lang: 5`, a `default` locale outside the `locales`) stops them the same way, once, as the config loads: `` `trailingSlash` is "sometimes", expected one of "never", "always" or "ignore" ``, the path through bags and lists, with the nearest allowed value for a mistyped text. The options of `pages()` and `testSite()` are checked as they merge, and an extension's `config` as it loads.
80
80
  - `auth()`, `cms()`, `mail()` and `ai()` refuse an option they do not take with the nearest one, as `kay.config.ts` does; a library adds the same to its own factory with `checkOptionKeys` from `kay/library`, over a `Record<keyof ItsOptions, true>`.
81
- - Project settings live in an optional `kay.config.ts` at the root, read by `pages()` and every command; the `config` passed to `pages({ config })` or `testSite({ config })` wins over it key by key, an `undefined` key leaving the file's value (the config's keys written beside `root` work until 1.108, `deprecated-pages-options` rewrites them), and in an executable `kay build --compile` wrote, the root, routes and public directory it was built with win over both.
81
+ - Project settings live in an optional `kay.config.ts` at the root, read by `pages()` and every command; the `config` passed to `pages({ config })` or `testSite({ config })` wins over it key by key, an `undefined` key leaving the file's value (the config's keys written beside `root` are refused: write them in `config`), and in an executable `kay build --compile` wrote, the root, routes and public directory it was built with win over both.
82
82
  - It must `export default` its config, or the command fails with a message saying so.
83
83
 
84
84
  ```ts
@@ -97,8 +97,8 @@ export default defineConfig({
97
97
 
98
98
  - A feature key is `false` for off, `true` for its defaults or an object of options: `robots`, `sitemap`, `assets.favicon`, `security`, `ops.health`, `preview`, `client.offline`, `ops.metrics`, `openapi`, `mcp`, `proxy`, `assets.images.formats.avif` and the rate limits. `defineConfig` refuses a key it does not know in any option bag, as a type error.
99
99
  - A list that may come from a CMS or a database is the list, or a function returning it (or a promise of it): `cors.origins`, `security.hosts`, `assets.images.remote.hosts`, `proxy.trusted`, `redirects`, `robots.disallow`, `robots.allow` and `i18n.paths`. Kay calls it once as the config loads, `kay dev` again after a change to the file.
100
- - Keys are grouped by concern: `client` (what the browser is given: `links`, `offline`, `search`, ...), `assets` (`images`, `fonts`, `favicon`, `manifest`, `publicCache`), `ops` (`observe`, `health`, `metrics`, `jobs`), `endpoints` (where the app's API and each feature are served) and `i18n: { locales, default, mode }`, where `mode` is `'prefix'` (the default locale unprefixed), `'always'` or `{ domains }`. The old top-level keys work until 1.108 (`deprecated-client-keys`, `deprecated-config-groups`, `deprecated-i18n-keys` rewrite them).
101
- - `endpoints` holds every route the config moves, in one place: `{ api: '/api', openapi: '/api/openapi.json', mcp: '/_kay/mcp', health: '/_kay/health', metrics: '/_kay/metrics', jobs: '/_kay/jobs' }`, each an absolute path of plain segments with no trailing slash, and `api`, `openapi` and `mcp` none under `/_kay` when you set them. Every default is under `/_kay` but the app's API (and its OpenAPI document and reference page, which follow it). The reference page is `openapi: { reference: true }` or `{ reference: { path } }`. `serve.apiPrefix` and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs`, and `openapi.referencePath`, work until 1.108 (`deprecated-route-keys` rewrites them). An app that did not move `mcp` or `metrics` keeps `/metrics` answering as well until 1.108, and `/mcp` answers the MCP endpoint in place (not redirected) until 2.0.
100
+ - Keys are grouped by concern: `client` (what the browser is given: `links`, `offline`, `search`, ...), `assets` (`images`, `fonts`, `favicon`, `manifest`, `publicCache`), `ops` (`observe`, `health`, `metrics`, `jobs`), `endpoints` (where the app's API and each feature are served) and `i18n: { locales, default, mode }`, where `mode` is `'prefix'` (the default locale unprefixed), `'always'` or `{ domains }`. A top-level key of before 1.105 is refused, naming where it moved (the old `i18n` keys are refused, naming `default` and `mode`).
101
+ - `endpoints` holds every route the config moves, in one place: `{ api: '/api', openapi: '/api/openapi.json', mcp: '/_kay/mcp', health: '/_kay/health', metrics: '/_kay/metrics', jobs: '/_kay/jobs' }`, each an absolute path of plain segments with no trailing slash, and `api`, `openapi` and `mcp` none under `/_kay` when you set them. Every default is under `/_kay` but the app's API (and its OpenAPI document and reference page, which follow it). The reference page is `openapi: { reference: true }` or `{ reference: { path } }`. `serve.apiPrefix` and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs`, and `openapi.referencePath`, are refused, each naming where it moved (see `llms/upgrading-1-105-config.md`). An app that did not move `mcp` or `metrics` keeps `/metrics` answering as well until 1.108, and `/mcp` answers the MCP endpoint in place (not redirected) until 2.0.
102
102
  - `assets.images` is `{ remote: { hosts, maxSize, timeout }, formats: { quality, webp, avif }, limits: { variants, queue }, rateLimit, ttl, widths, ... }`; `remote: [...]` is hosts alone.
103
103
  - A duration key is `ttl` for how long data lives, `timeout` for how long to wait and `maxAge` only for the HTTP or cookie attribute of that name.
104
104
  - `proxy: false` is none, `proxy: true` is one proxy in front, `proxy: { hops: 2 }` two, `{ header }` a header the proxy sets, `{ key: { header: 'x-upstream-key' }, open }` refuses requests without the shared key ([Production](proxy-and-security.md#behind-a-proxy)).
@@ -130,7 +130,7 @@ export default defineConfig({
130
130
 
131
131
  - `kay/html`, `kay/dom`, `kay/dom-loop`, `kay/dom-await`, `kay/dom-lazy`, `kay/dom-try`, `kay/dom-spread`, `kay/dom-image`, `kay/pending`, `kay/i18n-links`, `kay/island`, `kay/await`, `kay/client`, `kay/arrival`, `kay/internal`, `kay/internal/title` and `kay/internal/server` are what compiled `.kay` files and kay's generated entries import, and `kay/jsx-runtime` is where TypeScript finds the JSX types of `jsxImportSource: "kay"`: the compiler's output contract rather than API, free to change in any release, never imported by an app. The root `kay` export also holds the compile-time types behind the generated shadow types, none of them for an app to name: `BindableMark`, `IslandBrand`, `HandedPart`, `HandsPart`, `HandedSignal`, `UnresolvedParameter`, `WidenedProps`, `CheckedHref`, `CheckedHtml`, `CheckedComputedHtml`, `BoundProp`, `BoundValue`, `PlainIslandProp`, `FunctionProp`, `Inferred`, `TemplateHelpers`, `TemplateValues` and `Truthy`, free to change in any release too.
132
132
  - A few entries also hold plumbing no page tells an app to call, free to change in any release: the paths, providers and tracker tags of `kay/analytics` (`ANALYTICS_PATH`, `ANALYTICS_SCRIPT_PATH`, `ANALYTICS_PROVIDERS`, `CUSTOM_COLLECT_PATH`, `CUSTOM_SCRIPT_PATH`, `NOTICE_SCRIPT_PATH`, `INTEGRITY`, `TRACKER_TAGS`, `isGated`, `LazyGuard`), the collection marker, publish times and cache key of `kay/content`, and the preview session reader of `kay/server`.
133
- - A name has one home: an entry beside a package's root exists for browser safety (`@kayjs/auth/rules`, `@kayjs/cms/form`, which an island imports without the server) and the root does not repeat its names. The copies in `kay/mount` and `kay/server` that 1.105 moved (`mount`, `s`, `RateLimit`, `sqliteCache`) stay as deprecated shims until 1.108.
133
+ - A name has one home: an entry beside a package's root exists for browser safety (`@kayjs/auth/rules`, `@kayjs/cms/form`, which an island imports without the server) and the root does not repeat its names.
134
134
  - `kay/library` is what kay's own libraries (kayjs-auth, kayjs-ui, kayjs-mail, kayjs-cms, kayjs-ai) share with kay for their server code, such as the sanitizer's lists, sealing, locale matching, escaping and the user a library names for a request (`nameUser(request, () => id)`, read back by `userOf(request)`: kayjs-auth names the signed-in user and kayjs-ai counts them) and `configError(option, value, takes)`, the `config-invalid` `KayError` a library throws for a setting it refuses at boot, so neither keeps a copy: not API either, free to change with any minor, never imported by an app. The libraries are released in lockstep with kay, each one's peer range on kay's minor, so the same holds for what a library imports from it.
135
135
 
136
136
  ### Reserved paths
@@ -71,7 +71,7 @@ export default defineConfig({
71
71
  })
72
72
  ```
73
73
 
74
- - `proxy: false` is none, as left out; `proxy: true` is one proxy in front, `{ hops: 2 }` two; a bare `proxy: 2` still works until 1.108, `deprecated-config-switch` rewriting it.
74
+ - `proxy: false` is none, as left out; `proxy: true` is one proxy in front, `{ hops: 2 }` two; a bare `proxy: 2` is refused, write `{ hops: 2 }`.
75
75
  - `hops` is the number of proxies in front, each appending the address it was reached from to `X-Forwarded-For`, so the visitor is the entry `hops` from its end: 1 for nginx or Caddy alone, 2 for Cloudflare then nginx.
76
76
  - A request with fewer entries skipped an outer proxy, and its first entry is who reached the inner one.
77
77
  - `header` names a header a proxy sets to the visitor's address, read instead: `{ header: 'cf-connecting-ip' }`, or `{ header: 'x-real-ip' }` for nginx's `proxy_set_header X-Real-IP $remote_addr`.
package/llms/queues.md CHANGED
@@ -103,6 +103,6 @@ await onboarding.send(userId, 'visited')
103
103
  - `remove(id)` removes a job, and `remove(match)` every waiting or failed job whose payload `match` returns true for, such as a person's mails once they asked to be erased, resolving with how many went; an app's own `JobStore` takes a function only when it has `jobs(queue)`.
104
104
  - An idle queue looks at the store from one worker, which is how a job another process enqueued is noticed: 1 second after a job, then twice as long after each empty look up to `idlePoll`, 10 seconds by default, so such a job waits 10 seconds at worst. On Postgres it is told within a second. A job enqueued in this process, or delayed to a time the store knows, still runs at once, and a retry is picked up when due. `idlePoll: '1s'` looks every second, `'30s'` asks the database less often; it takes at least `1s`. A custom `JobStore` may have `prune(queue, before)` to drop the expired failed jobs in one call.
105
105
  - A store that fails, a SQLite file locked past its timeout say, is logged once as the outage starts and once as it ends, its workers asking it again later and later meanwhile, up to a minute apart.
106
- - `ctx.signal` aborts at `timeout` (`lostAfter` until 1.108), so a handler passing it on stops instead of running beside the retry, and as the server stops, when a job it gives up on is released with `release(id, until)` of the `JobStore`, clearing the hold only while `until`, the one it was claimed with, is still the job's (optional): back without waiting out `timeout`, its attempt not counted, instead of held until `timeout` and retried after its backoff. Without `release` the job is retried as before.
106
+ - `ctx.signal` aborts at `timeout`, so a handler passing it on stops instead of running beside the retry, and as the server stops, when a job it gives up on is released with `release(id, until)` of the `JobStore`, clearing the hold only while `until`, the one it was claimed with, is still the job's (optional): back without waiting out `timeout`, its attempt not counted, instead of held until `timeout` and retried after its backoff. Without `release` the job is retried as before.
107
107
  - A process that dies running a job leaves it held: it runs again once `timeout` has passed since it started, 10 minutes by default. A run still going as `timeout` ends counts as a failed attempt, so its worker moves on, its handler's signal aborted, so a handler ignoring it runs on beside the retry, and a job longer than `timeout` needs a longer one, and a job whose process died during each of its `attempts` is kept as failed without running again, rather than crash every process that takes it.
108
108
  - `drain()` runs every job whose time has come, here and now, until none is left, and waits for a run a worker already took (up to its `timeout` for one that never ends), except inside a job, which includes work the job spawned (a timer, a promise left running) and then does not wait, and a run counts once however many drains waited for it; in tests `site.runJobs()` from `kay/test` does it for every queue.
@@ -67,7 +67,7 @@ The object `rateLimit()` returns is a limit: give it to `protect: { rateLimit: v
67
67
  ### On an action
68
68
 
69
69
  - `rateLimit` lets one client post `max` times every `window`, then answers 429 with `Retry-After` and `errors['']` saying when to retry.
70
- - It counts every attempt, valid or not, unless it says `count: 'succeeded'`: then only the posts whose handler returned without `ctx.fail`, an error or a refusal count, so typos and a mail server failing lock no one out, a redirect from the handler counting as gone through.
70
+ - It counts every attempt, valid or not, unless it says `count: 'succeeded'`: then only the posts whose handler returned without `ctx.deny`, an error or a refusal count, so typos and a mail server failing lock no one out, a redirect from the handler counting as gone through.
71
71
  - Posts arriving together all read the count before any adds to it, so a burst may pass `max` by a few.
72
72
  - Several limits all apply, each counting every attempt it is meant to count whichever refuses it, the longest wait the one told: `rateLimit: [{ max: 30, window: '10m' }, { max: 5, window: '10m', count: 'succeeded' }]` slows a script hammering the form and lets five messages through, each limit counting under its place in the list.
73
73
  - The client is the address the request came from, or the one the proxies in front passed on once `proxy` says how to read it (see [Behind a proxy](proxy-and-security.md#behind-a-proxy)).
@@ -78,7 +78,7 @@ The object `rateLimit()` returns is a limit: give it to `protect: { rateLimit: v
78
78
  - A limit whose store throws or rejects counts in this process's memory instead, logged once per limit and store until the store answers again, so no request fails for it; a store taking over 8 seconds is also passed over for ten seconds, so a hanging one holds one request, not every one. This holds for an action's limits, an API route's, `rateLimit()`, the proof-of-work solutions and kay's own routes, whether the store is the limit's or the app's `store.rates`, and for kayjs-auth's attempts; kayjs-ai refuses an ask instead, as a paid chat must not run on a count it cannot read.
79
79
  - `store: sqliteData(path)` in kay.config.ts (or `store: { rates }`) is where every limit naming no `store` counts, kay's own login-less routes aside, so one line shares the counts of all of them between replicas.
80
80
  - `rateLimit: { max: 5, window: '1m', store: sqliteRates('data/rates.sqlite') }`, `sqliteRates` from `kay/server`, counts every process of the machine opening that file together, which stores each key pseudonymised as an HMAC keyed by the session's, the app's (`secret`, `KAY_SECRET`) or the preview's secret once one is set, else by a random key in `<path>.key` beside the file.
81
- - `RateStore`, a `hit(key, window, weight)` method, `window` a `Duration` for a store with `durations: true` (milliseconds for one written before 1.105, until 1.108; `lengthMs(window)` from `kay` reads both), adding `weight` (one unless given) to the count and giving `{ count, resetAt }` and, for a limit counting what went through, a `peek(key)` giving the open window without counting or `undefined`, is the shape of an app's own. An optional `refund(key, resetAt)` takes one attempt back off the window closing at `resetAt`, never below zero and not once that window is gone: kay calls it for a call that started no work (kayjs-ai's resume of a reply it keeps), and a store without it keeps the attempt counted; kay's own stores, memory, SQLite and Postgres, have it. An optional `reset(key)` forgets the window under `key`: kayjs-auth clears a count with it once a sign-in succeeds; kay's own stores have it too.
81
+ - `RateStore`, a `hit(key, window, weight)` method, `window` a `Duration` (`lengthMs(window)` from `kay` reads its milliseconds), adding `weight` (one unless given) to the count and giving `{ count, resetAt }` and, for a limit counting what went through, a `peek(key)` giving the open window without counting or `undefined`, is the shape of an app's own. An optional `refund(key, resetAt)` takes one attempt back off the window closing at `resetAt`, never below zero and not once that window is gone: kay calls it for a call that started no work (kayjs-ai's resume of a reply it keeps), and a store without it keeps the attempt counted; kay's own stores, memory, SQLite and Postgres, have it. An optional `reset(key)` forgets the window under `key`: kayjs-auth clears a count with it once a sign-in succeeds; kay's own stores have it too.
82
82
  - A store needs only `hit`: `limiter` derives `peek` (a `hit` of weight 0, which on a store holding no window opens an empty one the next hit joins) and `reset` (a `hit` of minus the open count, which leaves an empty window open, and needs a store that adds a negative weight as it adds any), so no limit, action or library refuses or warns of a store for lacking them.
83
83
 
84
84
  ### `limiter`
@@ -91,7 +91,7 @@ The object `rateLimit()` returns is a limit: give it to `protect: { rateLimit: v
91
91
  ### Outside an action
92
92
 
93
93
  - A guard, an API route or a library limits attempts the same way with `rateLimit(name, { max, window, store })` from `kay/server`: `await limit.hit(request)` counts one from the request's client and gives the seconds to wait once over the limit, else `undefined`.
94
- - `limiter().enforce(key, weight?)` counts under a key and answers the seconds to wait, refusing nothing; `rateLimit().check(ctx, message?)` is the guard's call, which refuses (`rateLimit().enforce(ctx)` was its name until 1.105, `deprecated-rate-enforce`).
94
+ - `limiter().enforce(key, weight?)` counts under a key and answers the seconds to wait, refusing nothing; `rateLimit().check(ctx, message?)` is the guard's call, which refuses.
95
95
  - `await limit.check(ctx, message?)` takes a guard's `ctx`, counts under the limit's `key` or the client's address, and past the limit sets `Retry-After` and calls `ctx.deny(429, message)`, `message` a text or a function of the seconds to wait.
96
96
  - `onLimit(refusal)` on a limit (`RateLimitRefusal`: `name`, the key counted, `wait` in seconds, `request` when there is one) runs for each request an action, a page, an API route, `check` or `hit` refused, beside the answer, which never waits for it; one that throws or rejects is logged. A limit object from `rateLimit()` shared with an action reports the action's URL as `name`.
97
97
  - `await limit.count(request)` counts as `hit` does and gives the window, `{ count, resetAt, wait }`, `wait` the seconds to wait once over `max`, else `undefined`: for an app that shows the count or decides itself.
@@ -115,5 +115,5 @@ Each kind of route counts at one place, and a refusal there is the 429:
115
115
 
116
116
  - Every limit is one `RateLimit` (from `kay`, `kay/server` and `kay/library`): `{ max, window, store?, key?, onLimit? }`. Every `rateLimit` option takes one or a list of them, each counted apart, and `false` lifts a default one. kayjs-auth, kayjs-ai, `basicAuth` and kay's own routes (`images`, `mcp`, `live`) count under keys or the address of their own and take no `key`; a `key` there is refused at boot, a `store` and an `onLimit` are taken.
117
117
  - kayjs-ai takes `ai({ rateLimit, budget, key })` and `ask(messages, { key })`, see [Limits and the token budget](../../ai/llms/limits.md).
118
- - kayjs-auth takes `authCore({ rateLimit: { signIn: { ip, account, accountAll } } })`, one entry per feature, each part a limit or a list of them (`{ ip, account }` on `resend`, `forgot`, `magicLink`, `emailChange`, `twoFactor` and `emailCode`, `invite: { sender, address }`, `oauth: { register, registerAll, document, token }`, a bare limit for `register`, `reprove`, `link`, `export` and `organization`; the flat keys of before 1.105 work until 1.108, `deprecated-auth-rate-limits`), see [Limits](../../auth/llms/hardening-and-testing.md#limits).
118
+ - kayjs-auth takes `authCore({ rateLimit: { signIn: { ip, account, accountAll } } })`, one entry per feature, each part a limit or a list of them (`{ ip, account }` on `resend`, `forgot`, `magicLink`, `emailChange`, `twoFactor` and `emailCode`, `invite: { sender, address }`, `oauth: { register, registerAll, document, token }`, a bare limit for `register`, `reprove`, `link`, `export` and `organization`), see [Limits](../../auth/llms/hardening-and-testing.md#limits).
119
119
  - kayjs-mail's contact form takes the action's `protection: { rateLimit }` ([Contact form](../../mail/llms/contact-form-and-testing.md)); `smtp({ rateLimit: { max: 5, window: '1s' } })` caps the mails sent, a throttle on the transport with no client to count, so `{ max, window }` alone (no list, `store`, `key` or `onLimit`), and `MAIL_RATE_LIMIT=5/1s` is read into that same `{ max, window }`.
package/llms/rendering.md CHANGED
@@ -183,7 +183,7 @@ const reviews = await cached('reviews', '1d', fetchReviews, { store: disk })
183
183
  - A store that fails to write, locked or full, is logged and the value kept in memory.
184
184
  - Rows are never swept, since a stale one is still served: `invalidate` keys a site stops using, such as those of deleted posts.
185
185
  - The value goes through devalue, as session data does: dates, maps and sets survive, and a value holding a function or a class instance throws on its first load, keeping nothing; on a refresh, it is logged and the stale value kept.
186
- - `sqliteCache` comes from `kay/cache`, its one home; `kay/server` exports it too until 1.108, and `deprecated-import-path` moves the import.
186
+ - `sqliteCache` comes from `kay/cache`, its one home.
187
187
  - `sqliteCache` is server-only: in the browser, `kay/cache` has `cached`, `cache`, `cacheTag` and `invalidate` alone, and `kay check` reports `invalidatePage` or `sqliteCache` imported by an island's script, a browser-only component, or a component only islands render, or a `.ts` module any of them imports, directly or through others (`server-only-import`); a name read off a namespace import or destructured from one is reported too.
188
188
  - `CacheStore` is the shape of a store, synchronous for a file (`sqliteCache`) so that `invalidate` is done when it returns, any call answering with a promise for a network one (`pgData(db).cache`), whose `invalidate` drops the stored rows in the background, a `cached` read waiting for them: `get(key)` giving `{ text, freshUntil }`, `set(key, text, freshUntil)`, `delete(key)` and `keys()`, plus, optionally, `publish(message)` and `subscribe(listener)` carrying invalidations between processes, as a Redis channel would (a message may also carry the clock of the sender, so replicas on machines whose clocks differ still date a live page's invalidation after its read; relay every message as it is, never to its sender), and `dependencies()` giving a `Map` of the keys a stored value was built from, so `invalidate` reads those and calls `get` for no row it holds nowhere in memory (`sqliteCache` keeps them in a table of their own); `text` is opaque, to be given back as `set` received it (a value built from a collection or another key starts with a line naming them).
189
189
  - In the `server` and `app` templates' image the app runs as `nobody`, so the store's directory is a mounted volume it can write.
@@ -67,14 +67,14 @@ Section(title="Contact")
67
67
 
68
68
  - `server` renders it on every GET and splices it into the prerendered page: it arrives with the page and needs no JavaScript.
69
69
  - Only the island is rendered and compressed, the rest of the page being deflated once; the page then goes out as gzip, never brotli, with `Cache-Control: private, no-store` and no ETag.
70
- - `defer` is a bare word beside `server`: `defer` alone, or with a value, is a prop of the component, which may have one of its own. It was `server="defer"`, which `kay upgrade` rewrites (`deprecated-island-attributes`) and which works until 1.108.
70
+ - `defer` is a bare word beside `server`: `defer` alone, or with a value, is a prop of the component, which may have one of its own. `server="defer"` is an error.
71
71
  - `server defer` serves the page as any prerendered page, brotli and ETag included, and the browser fetches the island a screen before it scrolls into view, or once the page is idle, then hydrates what it brought.
72
72
  - Until then the page shows the component as the build rendered it, inert and with its forms' field names and actions taken out, so it keeps its place and size and a bot has nothing to post. Pick it for what sits low on the page.
73
73
  - A page deferring an island ships kay's browser entry; with `navigation: false` and no island the build fails.
74
74
  - The island's URL is the page's with `?kay_island=N`: fetched by kay, it answers the island alone; visited, as from a link, it answers the page with every island in place, with `X-Robots-Tag: noindex`.
75
75
  - A browser without JavaScript keeps the inert copy of a deferred island.
76
76
  - A fetch that times out (10 s), gets no answer or fails with a 5xx, 408 or 429 is retried at 1 s and 3 s; a lost one keeps the inert copy, sets `data-kay-failed` and dispatches `kay:server-island-error` (`detail.error`, `detail.retry()`), a success `kay:server-island`; a page swap aborts it.
77
- - `@failed` under the use (`ContactForm(server defer)` with an `@failed` block below it) is rendered hidden beside the inert copy and shown on `data-kay-failed`; a control inside it with `data-kay-retry` retries the island with no script, and the block hides again while it loads. A component declares its own with a root `@failed` block, as a `--- client` one declares its `@fallback`; a use's block wins. It is no prop of the component, is rendered without running the script (static markup and imports only, a script value or prop it reads is reported) and an inline `server` refuses it, as it does a server island, a handler or an action form inside it. It is never a prop, even for a component with a `failed` slot prop. Shown, it is a `role="alert"` and a failed retry gives the focus back to its retry control. A deferred island with a block has `<slot data-kay-server><slot inert>copy</slot><slot data-kay-failure hidden>block</slot></slot>`, the copy inert on its own so the block's control clicks.
77
+ - `@failed` under the use (`ContactForm(server defer)` with an `@failed` block below it) is rendered hidden beside the inert copy and shown on `data-kay-failed`; a control inside it with `data-kay-retry` retries the island with no script, and the block hides again while it loads. A component declares its own with a root `@failed` block, as a client-only one declares its `@fallback`; a use's block wins. It is no prop of the component, is rendered without running the script (static markup and imports only, a script value or prop it reads is reported) and an inline `server` refuses it, as it does a server island, a handler or an action form inside it. It is never a prop, even for a component with a `failed` slot prop. Shown, it is a `role="alert"` and a failed retry gives the focus back to its retry control. A deferred island with a block has `<slot data-kay-server><slot inert>copy</slot><slot data-kay-failure hidden>block</slot></slot>`, the copy inert on its own so the block's control clicks.
78
78
  - `noscript` beside the mark, such as `ContactForm(server defer noscript="Show the contact form")`, adds a link with that text leading to the page with every island in place.
79
79
  - It is off by default: leave it off when what the island does is reachable without it, as an email address beside a contact form.
80
80
  - A form post rendering the page, refused or coming back with how it went, renders it whole, islands included.
package/llms/server.md CHANGED
@@ -227,7 +227,7 @@ export default defineConfig({ guards: { default: 'closed' } }) // 'open' keeps e
227
227
  - With a store, the cookie carries only a sealed id, and `destroy()` deletes the session itself. A cookie sealed with its data before the app had a store opens no session, so adding one signs everyone out once: a copy of such a cookie, which a sign-out could not end, is worth nothing from then on.
228
228
  - `memorySessions()` from `kay/server` keeps sessions in the process, gone on restart, the oldest going past 100,000.
229
229
  - `sqliteSessions(path)`, for a `session({ store })` kept apart from the app's store, keeps them in a SQLite file shared by the processes on one machine, creating its directory, as `sqliteRates`, `sqliteCache` and `sqliteJobs` do; under `NODE_ENV=test`, which `bun test` sets, it keeps them in memory and writes no file; it opens its file on first use, so a process only loading the module naming it writes nothing; called again with the same file, it gives the store already open. A file deleted or replaced under a running server is noticed within seconds and opened afresh; a file put in its place takes its `-wal` and `-shm` along, or none, as SQLite would otherwise replay the old ones over it.
230
- - Any object with `get(id)`, `set(id, data, maxAge)` and `delete(id)`, each sync or async, `maxAge` a `Duration` (`durations: true`, [Stores](stores.md); milliseconds for a store written before 1.105), is a store too, such as one over Redis.
230
+ - Any object with `get(id)`, `set(id, data, maxAge)` and `delete(id)`, each sync or async, `maxAge` a `Duration` ([Stores](stores.md)), is a store too, such as one over Redis.
231
231
  - `deleteWhere(match)` on `memorySessions()` and `sqliteSessions(path)` (with `store: sqliteData(path)`, `sqliteSessions` of the same path is its store, or `sqliteData(path).sessions`) deletes every session whose data `match` accepts (`{ userId }`, fields held equal and narrowed in SQL best by a string or a long number, or a function over the data, read 500 at a time), a person's once they asked to be erased or changed their password say, resolving with how many went; `sqliteSessions` also drops expired sessions every hour.
232
232
  - Values cross as island props do, Dates, Maps, Sets and bigints included.
233
233
  - The cookie, `kay_session` unless `cookie` names another, is `HttpOnly`, `SameSite=Lax`, `Path=/`, and over https `Secure` and named `__Host-kay_session`, so no other host of the site can set it; code reading kay's session cookie by hand looks for that name over https.
package/llms/stores.md CHANGED
@@ -31,7 +31,7 @@
31
31
  - Every factory is imported from `kay/server`, such as `import { memoryKv, memoryNotifications, memoryPush, memoryRates, memoryRooms, sqliteKv, sqliteLive, sqliteNotifications, sqlitePush } from 'kay/server'`. A factory is `<backend><Thing>`: the backend is `memory`, `sqlite`, `pg`, `disk` or `s3`, the thing the store's key in the plural form the table shows. `sqliteData(path)` and `pgData(db)` make every kind over one file or database, neither with the files.
32
32
  - Every interface extends `StoreBase` from `kay/server`, as `store` does: `ping()` and `close()`, both optional, either may return a promise. `health` runs each store's `ping` beside the route's `check`, under `ops.health.timeout` and its 3 s cache, and answers 503 when one rejects. A stop calls each store's `close()` once, `store`'s own last, so a `pgData` closes its connection after the rooms let go of their members. A store with neither costs nothing.
33
33
  - A store method answers `MaybePromise<T>` (the value at once, or a promise of it; `MaybePromise` is exported from `kay/library`), so a store over memory or a file answers at once, one over a database later, and a caller `await`s every call. A room's `state` and `update` answer promises only, and `members`, `add`, `remove`, `publish` and `subscribe` of a room store are synchronous, as they are mirrored in memory.
34
- - A store receives a length as a `Duration`, as every option does: `SessionStore.set`'s `maxAge`, `RateStore.hit`'s `window`, `KvStore`'s `ttl` and `LiveStore.endAll`'s `ttl`. A store of your own says so with `durations: true` (a `StoreBase` member) and reads it with `lengthMs(value)` from `kay`, which gives the milliseconds of a `Duration` or a number. A store written before 1.105 has no `durations`, and kay keeps handing it milliseconds as a number until 1.108, so it works as it is; its parameter types still accept both, and `deprecated-store-ms` rewrites a `kv` call written with milliseconds. kay's own stores take both forms.
34
+ - A store receives a length as a `Duration`, as every option does: `SessionStore.set`'s `maxAge`, `RateStore.hit`'s `window`, `KvStore`'s `ttl` and `LiveStore.endAll`'s `ttl`. A store of your own reads it with `lengthMs(value)` from `kay`, which gives the milliseconds of a `Duration`; `kv(ns).set(key, value, 60_000)` written with milliseconds is a type error, `'60s'`.
35
35
  - `kv(namespace)` from `kay/server` is what a library or an app uses for a value under a key that is not a count: `get(key)`, `set(key, value, ttl?)` (a string, kept until `ttl` has passed, a `Duration` such as `'10m'`, or until deleted without it), `delete(key)` (whether there was one) and `once(key, ttl)`, which takes a key for `ttl` and resolves true for the one call that took it, however many processes ask at once: a ticket spent once, a sweep run by one replica. Keys are kept apart per namespace. It reads `store.kv`, which `sqliteData` and `pgData` fill, else this process's memory (`kv(namespace, store)` names a store). kayjs-ai's approval tickets, kayjs-cms's signed-out cookies (`passwordGuard({ kv })`) and kayjs-auth's cached OAuth client documents use it, where they counted or held a `Map` through `store.rates` before.
36
36
  - One verb per job: `delete` removes one record by its key and answers whether there was one (`FileStore`, `PushStore`, a user store), `erase(user)` removes everything a user owns and answers the count, `prune(before)` removes what is old and answers the count (`JobStore.prune`, the audit log), and `remove` is left to a member of a list (`RoomStore.remove`, `JobStore.remove`). `SessionStore`, `CacheStore` and `LiveStore` `delete` stay without an answer, as nothing reads it.
37
37
  - `pgData(db).ping()` is a round trip to the database, and `await pgData(url).close()` or `await using store = pgData(url)` closes a store opened in a script or a test; closing twice is the same as once.
@@ -51,7 +51,7 @@ section.rounded.border
51
51
 
52
52
  - A part renders `data-part="head"`, for selectors and `data-[part=head]:` utilities; one name may sit on several elements, every row of a `for`, and inside an `if` or a slot.
53
53
  - A part that is a component, `Button(part="action")`, hands its entry to it, a string or an object of its parts: `parts={{ action: { icon: 'size-5' } }}`. `data-part` reaches its root through the spread. Names after the first, `Busy(part="root spinner")`, hand those parts of this component on too, under the same names, for a part inside the called component. `kay check` reports a handed part the called component does not name, types its entry as that part takes it, and refuses one in a page or a layout, which has no class to hand from.
54
- - `parts` sits beside a shorthand, a spread and a `class` on the call, `Card.mt-4(parts={{ head: 'p-6' }})`. Until 1.108 a `class` literal of before 1.105 is handed on as `parts`: word keys, each value a string, template, conditional or array of those, or a nested literal (`deprecated-parts-class` writes `parts`). Any other `class` object is conditions; a held one is a type error naming `parts`.
54
+ - `parts` sits beside a shorthand, a spread and a `class` on the call, `Card.mt-4(parts={{ head: 'p-6' }})`. `class` is a string, an array or an object of conditions, so an object of strings in it is a type error: write `parts`.
55
55
  - `kay check` reports a part named by an expression, an unknown part at a call, a string `class` on a template with several top elements and no `part="root"`, and a component that also destructures `class` or `parts`, which the compiler owns. `...rest` leaves them out.
56
56
  - A page or a layout has no `class` prop: its parts render `data-part` only.
57
57
 
@@ -100,7 +100,7 @@ Card(title="Todos")
100
100
 
101
101
  A prop taking markup is typed `Snippet` from `kay`: `Snippet` for the children and a block with no parameters, `Snippet<[Item, number]>` for markup the component calls with values, once per row for instance. `@name(a, b)`, a local `snippet` passed as `name={feature}` and `slot name(a, b)` all use it, a fill with other parameters, or a `@name` written without the parameters the prop is called with, is a `kay check` error (the second names the parameters to write), and `slot name` on a prop that is no `Snippet` is reported at the name.
102
102
 
103
- No function reaches the browser, so a static component passing one to an island is the `island-prop` error, fixed with `island()`, and a layout or a page with a `--- server` fence cannot pass one.
103
+ No function reaches the browser, so a static component passing one to an island is the `island-prop` error (unless the island lists `interactive` props and the use writes none, which renders as markup), fixed with `island()`, and a layout or a page with a `--- server` fence cannot pass one.
104
104
 
105
105
  A static component that only islands render is part of them, so it can.
106
106
 
@@ -141,5 +141,5 @@ List(items={todos})
141
141
  - A name another snippet, an import, a script const, a prop or a loop variable already holds is reported at the snippet, and assigning one is refused.
142
142
  - It can hold components, a bare `slot` of the component declaring it, `if`, `for`, `await`, `match` and other snippets, and is a plain function, so `List(row={feature})` passes it where a prop takes a function, which the component renders with `slot row(item, i)`.
143
143
  - An `error` or `pending` line in a snippet follows the form the snippet is rendered in while it renders, as one in a component does, unless the form it is declared in is around it, which it keeps reading. In an island the snippet, like the children a component is given, takes the form it is called in once, as it is called, so a line inside an `await` block or an `if` shown later reads the same form, and a snippet declared outside the form works as one declared inside; call it in the form's own markup, `{note()}` or inside a larger expression. A component an `await` or an `if` of the snippet shows later reads no form: put the line in the snippet itself. `add.form.error('title')` and `add.pending()` take the action from anywhere.
144
- - A static component passing one to an island is the `island-prop` error, as it is for a `@row(item)` block.
144
+ - A static component passing one to an island is the `island-prop` error, as it is for a `@row(item)` block, unless the island lists `interactive` props and the use writes none.
145
145
  - Markup used by several files is a component; a snippet is for one file.