sonamu 0.8.27 → 0.9.1

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 (689) hide show
  1. package/bin/cli.js +60 -13
  2. package/dist/_virtual/rolldown_runtime.js +39 -0
  3. package/dist/ai/agents/agent.d.ts +3 -3
  4. package/dist/ai/agents/agent.d.ts.map +1 -1
  5. package/dist/ai/agents/agent.js +76 -73
  6. package/dist/ai/agents/index.js +3 -3
  7. package/dist/ai/agents/types.d.ts +3 -3
  8. package/dist/ai/agents/types.d.ts.map +1 -1
  9. package/dist/ai/agents/types.js +1 -3
  10. package/dist/ai/index.js +3 -2
  11. package/dist/ai/providers/rtzr/api.js +25 -25
  12. package/dist/ai/providers/rtzr/error.js +25 -26
  13. package/dist/ai/providers/rtzr/index.js +5 -5
  14. package/dist/ai/providers/rtzr/model.d.ts +1 -1
  15. package/dist/ai/providers/rtzr/model.d.ts.map +1 -1
  16. package/dist/ai/providers/rtzr/model.js +117 -133
  17. package/dist/ai/providers/rtzr/options.d.ts.map +1 -1
  18. package/dist/ai/providers/rtzr/options.js +35 -41
  19. package/dist/ai/providers/rtzr/provider.d.ts +1 -1
  20. package/dist/ai/providers/rtzr/provider.d.ts.map +1 -1
  21. package/dist/ai/providers/rtzr/provider.js +53 -51
  22. package/dist/ai/providers/rtzr/utils.d.ts.map +1 -1
  23. package/dist/ai/providers/rtzr/utils.js +84 -84
  24. package/dist/api/base-frame.d.ts +2 -2
  25. package/dist/api/base-frame.d.ts.map +1 -1
  26. package/dist/api/base-frame.js +29 -19
  27. package/dist/api/caster.d.ts +1 -1
  28. package/dist/api/caster.d.ts.map +1 -1
  29. package/dist/api/caster.js +51 -61
  30. package/dist/api/code-converters.d.ts +4 -3
  31. package/dist/api/code-converters.d.ts.map +1 -1
  32. package/dist/api/code-converters.js +226 -249
  33. package/dist/api/config.d.ts +17 -17
  34. package/dist/api/config.d.ts.map +1 -1
  35. package/dist/api/config.js +34 -30
  36. package/dist/api/context.d.ts +10 -10
  37. package/dist/api/context.d.ts.map +1 -1
  38. package/dist/api/context.js +8 -2
  39. package/dist/api/decorators.d.ts +8 -8
  40. package/dist/api/decorators.d.ts.map +1 -1
  41. package/dist/api/decorators.js +245 -268
  42. package/dist/api/index.js +39 -7
  43. package/dist/api/secret.js +22 -15
  44. package/dist/api/sonamu.d.ts +19 -16
  45. package/dist/api/sonamu.d.ts.map +1 -1
  46. package/dist/api/sonamu.js +1051 -1131
  47. package/dist/api/validator.js +88 -79
  48. package/dist/auth/auth-generator.d.ts.map +1 -1
  49. package/dist/auth/auth-generator.js +203 -200
  50. package/dist/auth/better-auth-entities.d.ts +2 -2
  51. package/dist/auth/better-auth-entities.d.ts.map +1 -1
  52. package/dist/auth/better-auth-entities.js +369 -429
  53. package/dist/auth/index.js +21 -6
  54. package/dist/auth/knex-adapter.d.ts +2 -2
  55. package/dist/auth/knex-adapter.d.ts.map +1 -1
  56. package/dist/auth/knex-adapter.js +153 -157
  57. package/dist/auth/plugins/entity-definitions/admin.d.ts +1 -1
  58. package/dist/auth/plugins/entity-definitions/admin.d.ts.map +1 -1
  59. package/dist/auth/plugins/entity-definitions/admin.js +58 -56
  60. package/dist/auth/plugins/entity-definitions/anonymous.d.ts +1 -1
  61. package/dist/auth/plugins/entity-definitions/anonymous.d.ts.map +1 -1
  62. package/dist/auth/plugins/entity-definitions/anonymous.js +20 -20
  63. package/dist/auth/plugins/entity-definitions/api-key.d.ts +1 -1
  64. package/dist/auth/plugins/entity-definitions/api-key.d.ts.map +1 -1
  65. package/dist/auth/plugins/entity-definitions/api-key.js +189 -196
  66. package/dist/auth/plugins/entity-definitions/index.d.ts +1 -1
  67. package/dist/auth/plugins/entity-definitions/index.d.ts.map +1 -1
  68. package/dist/auth/plugins/entity-definitions/index.js +26 -29
  69. package/dist/auth/plugins/entity-definitions/jwt.d.ts +1 -1
  70. package/dist/auth/plugins/entity-definitions/jwt.d.ts.map +1 -1
  71. package/dist/auth/plugins/entity-definitions/jwt.js +62 -64
  72. package/dist/auth/plugins/entity-definitions/organization.d.ts +1 -1
  73. package/dist/auth/plugins/entity-definitions/organization.d.ts.map +1 -1
  74. package/dist/auth/plugins/entity-definitions/organization.js +362 -421
  75. package/dist/auth/plugins/entity-definitions/passkey.d.ts +1 -1
  76. package/dist/auth/plugins/entity-definitions/passkey.d.ts.map +1 -1
  77. package/dist/auth/plugins/entity-definitions/passkey.js +115 -126
  78. package/dist/auth/plugins/entity-definitions/phone-number.d.ts +1 -1
  79. package/dist/auth/plugins/entity-definitions/phone-number.d.ts.map +1 -1
  80. package/dist/auth/plugins/entity-definitions/phone-number.js +31 -40
  81. package/dist/auth/plugins/entity-definitions/sso.d.ts +1 -1
  82. package/dist/auth/plugins/entity-definitions/sso.d.ts.map +1 -1
  83. package/dist/auth/plugins/entity-definitions/sso.js +94 -107
  84. package/dist/auth/plugins/entity-definitions/two-factor.d.ts +1 -1
  85. package/dist/auth/plugins/entity-definitions/two-factor.d.ts.map +1 -1
  86. package/dist/auth/plugins/entity-definitions/two-factor.js +78 -92
  87. package/dist/auth/plugins/entity-definitions/types.d.ts +1 -1
  88. package/dist/auth/plugins/entity-definitions/types.d.ts.map +1 -1
  89. package/dist/auth/plugins/entity-definitions/types.js +1 -10
  90. package/dist/auth/plugins/entity-definitions/username.d.ts +1 -1
  91. package/dist/auth/plugins/entity-definitions/username.d.ts.map +1 -1
  92. package/dist/auth/plugins/entity-definitions/username.js +31 -40
  93. package/dist/auth/plugins/index.js +12 -3
  94. package/dist/auth/plugins/wrappers/admin.d.ts +169 -73
  95. package/dist/auth/plugins/wrappers/admin.d.ts.map +1 -1
  96. package/dist/auth/plugins/wrappers/admin.js +28 -29
  97. package/dist/auth/plugins/wrappers/anonymous.d.ts +2 -1
  98. package/dist/auth/plugins/wrappers/anonymous.d.ts.map +1 -1
  99. package/dist/auth/plugins/wrappers/anonymous.js +23 -22
  100. package/dist/auth/plugins/wrappers/api-key.d.ts +2 -2
  101. package/dist/auth/plugins/wrappers/api-key.d.ts.map +1 -1
  102. package/dist/auth/plugins/wrappers/api-key.js +40 -34
  103. package/dist/auth/plugins/wrappers/index.js +11 -11
  104. package/dist/auth/plugins/wrappers/jwt.d.ts +2 -1
  105. package/dist/auth/plugins/wrappers/jwt.d.ts.map +1 -1
  106. package/dist/auth/plugins/wrappers/jwt.js +31 -26
  107. package/dist/auth/plugins/wrappers/organization.d.ts +2 -1
  108. package/dist/auth/plugins/wrappers/organization.d.ts.map +1 -1
  109. package/dist/auth/plugins/wrappers/organization.js +65 -62
  110. package/dist/auth/plugins/wrappers/passkey.d.ts +2 -1
  111. package/dist/auth/plugins/wrappers/passkey.d.ts.map +1 -1
  112. package/dist/auth/plugins/wrappers/passkey.js +33 -28
  113. package/dist/auth/plugins/wrappers/phone-number.d.ts +19 -18
  114. package/dist/auth/plugins/wrappers/phone-number.d.ts.map +1 -1
  115. package/dist/auth/plugins/wrappers/phone-number.js +26 -23
  116. package/dist/auth/plugins/wrappers/sso.d.ts +119 -38
  117. package/dist/auth/plugins/wrappers/sso.d.ts.map +1 -1
  118. package/dist/auth/plugins/wrappers/sso.js +37 -31
  119. package/dist/auth/plugins/wrappers/two-factor.d.ts +29 -19
  120. package/dist/auth/plugins/wrappers/two-factor.d.ts.map +1 -1
  121. package/dist/auth/plugins/wrappers/two-factor.js +31 -28
  122. package/dist/auth/plugins/wrappers/username.d.ts +14 -13
  123. package/dist/auth/plugins/wrappers/username.d.ts.map +1 -1
  124. package/dist/auth/plugins/wrappers/username.js +23 -23
  125. package/dist/bin/build-config.js +31 -31
  126. package/dist/bin/cli.js +1068 -1204
  127. package/dist/bin/fixture.d.ts.map +1 -1
  128. package/dist/bin/fixture.js +266 -259
  129. package/dist/bin/hmr-hook-register.d.ts.map +1 -1
  130. package/dist/bin/hmr-hook-register.js +19 -18
  131. package/dist/bin/test-command.d.ts.map +1 -1
  132. package/dist/bin/test-command.js +180 -177
  133. package/dist/bin/ts-loader-register.js +13 -6
  134. package/dist/bin/ts-loader-registration.d.ts.map +1 -1
  135. package/dist/bin/ts-loader-registration.js +28 -38
  136. package/dist/cache/cache-manager.d.ts +1 -1
  137. package/dist/cache/cache-manager.d.ts.map +1 -1
  138. package/dist/cache/cache-manager.js +20 -15
  139. package/dist/cache/decorator.d.ts +1 -1
  140. package/dist/cache/decorator.d.ts.map +1 -1
  141. package/dist/cache/decorator.js +84 -76
  142. package/dist/cache/drivers.js +21 -34
  143. package/dist/cache/index.js +10 -7
  144. package/dist/cache/types.d.ts +2 -2
  145. package/dist/cache/types.d.ts.map +1 -1
  146. package/dist/cache/types.js +1 -6
  147. package/dist/cache-control/cache-control.d.ts +2 -2
  148. package/dist/cache-control/cache-control.d.ts.map +1 -1
  149. package/dist/cache-control/cache-control.js +106 -122
  150. package/dist/cache-control/types.d.ts +2 -2
  151. package/dist/cache-control/types.d.ts.map +1 -1
  152. package/dist/cache-control/types.js +1 -19
  153. package/dist/compress/compress.d.ts +1 -1
  154. package/dist/compress/compress.d.ts.map +1 -1
  155. package/dist/compress/compress.js +58 -56
  156. package/dist/compress/index.js +7 -2
  157. package/dist/compress/types.js +1 -11
  158. package/dist/cone/cone-generator.d.ts +1 -1
  159. package/dist/cone/cone-generator.d.ts.map +1 -1
  160. package/dist/cone/cone-generator.js +216 -219
  161. package/dist/database/_batch_update.d.ts +1 -1
  162. package/dist/database/_batch_update.d.ts.map +1 -1
  163. package/dist/database/_batch_update.js +107 -102
  164. package/dist/database/base-model.d.ts +8 -9
  165. package/dist/database/base-model.d.ts.map +1 -1
  166. package/dist/database/base-model.js +370 -390
  167. package/dist/database/base-model.types.d.ts +5 -5
  168. package/dist/database/base-model.types.d.ts.map +1 -1
  169. package/dist/database/base-model.types.js +1 -20
  170. package/dist/database/db.d.ts +5 -2
  171. package/dist/database/db.d.ts.map +1 -1
  172. package/dist/database/db.js +185 -171
  173. package/dist/database/knex.d.ts +1 -1
  174. package/dist/database/knex.d.ts.map +1 -1
  175. package/dist/database/knex.js +48 -42
  176. package/dist/database/puri-subset.types.d.ts +6 -7
  177. package/dist/database/puri-subset.types.d.ts.map +1 -1
  178. package/dist/database/puri-subset.types.js +1 -16
  179. package/dist/database/puri-wrapper.d.ts +6 -6
  180. package/dist/database/puri-wrapper.d.ts.map +1 -1
  181. package/dist/database/puri-wrapper.js +99 -101
  182. package/dist/database/puri.d.ts +4 -5
  183. package/dist/database/puri.d.ts.map +1 -1
  184. package/dist/database/puri.js +1021 -1227
  185. package/dist/database/puri.types.d.ts +7 -7
  186. package/dist/database/puri.types.d.ts.map +1 -1
  187. package/dist/database/puri.types.js +15 -6
  188. package/dist/database/transaction-context.d.ts +2 -2
  189. package/dist/database/transaction-context.d.ts.map +1 -1
  190. package/dist/database/transaction-context.js +22 -13
  191. package/dist/database/upsert-builder.d.ts +3 -3
  192. package/dist/database/upsert-builder.d.ts.map +1 -1
  193. package/dist/database/upsert-builder.js +405 -465
  194. package/dist/dict/en.js +72 -74
  195. package/dist/dict/index.js +13 -13
  196. package/dist/dict/ko.js +72 -74
  197. package/dist/dict/rc-keys.js +150 -168
  198. package/dist/dict/sd.d.ts +3 -1
  199. package/dist/dict/sd.d.ts.map +1 -1
  200. package/dist/dict/sd.js +54 -40
  201. package/dist/dict/sonamu-dictionary.d.ts +1 -1
  202. package/dist/dict/sonamu-dictionary.d.ts.map +1 -1
  203. package/dist/dict/sonamu-dictionary.js +887 -955
  204. package/dist/dict/types.js +1 -7
  205. package/dist/dict/utils.js +26 -24
  206. package/dist/entity/entity-manager.d.ts +9 -9
  207. package/dist/entity/entity-manager.d.ts.map +1 -1
  208. package/dist/entity/entity-manager.js +226 -223
  209. package/dist/entity/entity-template-cone.d.ts +1 -1
  210. package/dist/entity/entity-template-cone.d.ts.map +1 -1
  211. package/dist/entity/entity-template-cone.js +152 -151
  212. package/dist/entity/entity.d.ts.map +1 -1
  213. package/dist/entity/entity.js +952 -1089
  214. package/dist/exceptions/error-handler.d.ts +1 -1
  215. package/dist/exceptions/error-handler.d.ts.map +1 -1
  216. package/dist/exceptions/error-handler.js +32 -27
  217. package/dist/exceptions/so-exceptions.d.ts +1 -1
  218. package/dist/exceptions/so-exceptions.d.ts.map +1 -1
  219. package/dist/exceptions/so-exceptions.js +61 -68
  220. package/dist/filter/index.js +9 -3
  221. package/dist/filter/types.js +92 -88
  222. package/dist/filter/utils.d.ts +1 -1
  223. package/dist/filter/utils.d.ts.map +1 -1
  224. package/dist/filter/utils.js +147 -161
  225. package/dist/index.js +87 -40
  226. package/dist/logger/category.d.ts.map +1 -1
  227. package/dist/logger/category.js +30 -29
  228. package/dist/logger/configure.d.ts.map +1 -1
  229. package/dist/logger/configure.js +83 -107
  230. package/dist/migration/code-generation.d.ts +2 -2
  231. package/dist/migration/code-generation.d.ts.map +1 -1
  232. package/dist/migration/code-generation.js +1385 -1578
  233. package/dist/migration/migration-set.d.ts +1 -1
  234. package/dist/migration/migration-set.d.ts.map +1 -1
  235. package/dist/migration/migration-set.js +177 -227
  236. package/dist/migration/migrator.d.ts +4 -3
  237. package/dist/migration/migrator.d.ts.map +1 -1
  238. package/dist/migration/migrator.js +340 -345
  239. package/dist/migration/postgresql-schema-reader.d.ts +2 -2
  240. package/dist/migration/postgresql-schema-reader.d.ts.map +1 -1
  241. package/dist/migration/postgresql-schema-reader.js +506 -564
  242. package/dist/migration/slack-confirm.d.ts +2 -2
  243. package/dist/migration/slack-confirm.d.ts.map +1 -1
  244. package/dist/migration/slack-confirm.js +205 -193
  245. package/dist/migration/types.d.ts +2 -2
  246. package/dist/migration/types.d.ts.map +1 -1
  247. package/dist/migration/types.js +1 -3
  248. package/dist/naite/messaging-types.d.ts +1 -0
  249. package/dist/naite/messaging-types.d.ts.map +1 -1
  250. package/dist/naite/messaging-types.js +1 -7
  251. package/dist/naite/naite-reporter.d.ts +2 -2
  252. package/dist/naite/naite-reporter.d.ts.map +1 -1
  253. package/dist/naite/naite-reporter.js +127 -120
  254. package/dist/naite/naite.d.ts +3 -2
  255. package/dist/naite/naite.d.ts.map +1 -1
  256. package/dist/naite/naite.js +266 -300
  257. package/dist/ssr/index.d.ts +2 -2
  258. package/dist/ssr/index.d.ts.map +1 -1
  259. package/dist/ssr/index.js +13 -3
  260. package/dist/ssr/registry.d.ts +1 -1
  261. package/dist/ssr/registry.d.ts.map +1 -1
  262. package/dist/ssr/registry.js +45 -37
  263. package/dist/ssr/renderer.d.ts +4 -4
  264. package/dist/ssr/renderer.d.ts.map +1 -1
  265. package/dist/ssr/renderer.js +84 -91
  266. package/dist/ssr/types.d.ts +2 -2
  267. package/dist/ssr/types.d.ts.map +1 -1
  268. package/dist/ssr/types.js +1 -3
  269. package/dist/storage/base-file.js +54 -41
  270. package/dist/storage/buffered-file.d.ts +2 -2
  271. package/dist/storage/buffered-file.d.ts.map +1 -1
  272. package/dist/storage/buffered-file.js +51 -44
  273. package/dist/storage/drivers.d.ts +2 -2
  274. package/dist/storage/drivers.d.ts.map +1 -1
  275. package/dist/storage/drivers.js +12 -7
  276. package/dist/storage/index.js +14 -7
  277. package/dist/storage/s3-driver.d.ts +2 -2
  278. package/dist/storage/s3-driver.d.ts.map +1 -1
  279. package/dist/storage/s3-driver.js +52 -48
  280. package/dist/storage/storage-manager.d.ts +2 -2
  281. package/dist/storage/storage-manager.d.ts.map +1 -1
  282. package/dist/storage/storage-manager.js +33 -25
  283. package/dist/storage/types.d.ts +2 -2
  284. package/dist/storage/types.d.ts.map +1 -1
  285. package/dist/storage/types.js +1 -5
  286. package/dist/storage/uploaded-file.d.ts +1 -1
  287. package/dist/storage/uploaded-file.d.ts.map +1 -1
  288. package/dist/storage/uploaded-file.js +45 -35
  289. package/dist/stream/index.js +7 -2
  290. package/dist/stream/sse.d.ts +2 -2
  291. package/dist/stream/sse.d.ts.map +1 -1
  292. package/dist/stream/sse.js +72 -67
  293. package/dist/syncer/api-parser.d.ts +1 -1
  294. package/dist/syncer/api-parser.d.ts.map +1 -1
  295. package/dist/syncer/api-parser.js +224 -245
  296. package/dist/syncer/checksum.d.ts +1 -1
  297. package/dist/syncer/checksum.d.ts.map +1 -1
  298. package/dist/syncer/checksum.js +86 -72
  299. package/dist/syncer/code-generator.d.ts +2 -2
  300. package/dist/syncer/code-generator.d.ts.map +1 -1
  301. package/dist/syncer/code-generator.js +154 -160
  302. package/dist/syncer/entity-operations.d.ts +1 -1
  303. package/dist/syncer/entity-operations.d.ts.map +1 -1
  304. package/dist/syncer/entity-operations.js +63 -54
  305. package/dist/syncer/file-patterns.d.ts +1 -1
  306. package/dist/syncer/file-patterns.d.ts.map +1 -1
  307. package/dist/syncer/file-patterns.js +38 -38
  308. package/dist/syncer/index.js +19 -8
  309. package/dist/syncer/module-loader.d.ts +5 -5
  310. package/dist/syncer/module-loader.d.ts.map +1 -1
  311. package/dist/syncer/module-loader.js +83 -78
  312. package/dist/syncer/syncer-actions.d.ts +2 -2
  313. package/dist/syncer/syncer-actions.d.ts.map +1 -1
  314. package/dist/syncer/syncer-actions.js +76 -91
  315. package/dist/syncer/syncer.d.ts +7 -6
  316. package/dist/syncer/syncer.d.ts.map +1 -1
  317. package/dist/syncer/syncer.js +426 -492
  318. package/dist/tasks/decorator.d.ts +3 -3
  319. package/dist/tasks/decorator.d.ts.map +1 -1
  320. package/dist/tasks/decorator.js +32 -28
  321. package/dist/tasks/step-wrapper.d.ts +1 -1
  322. package/dist/tasks/step-wrapper.d.ts.map +1 -1
  323. package/dist/tasks/step-wrapper.js +42 -41
  324. package/dist/tasks/workflow-manager.d.ts +2 -2
  325. package/dist/tasks/workflow-manager.d.ts.map +1 -1
  326. package/dist/tasks/workflow-manager.js +192 -219
  327. package/dist/template/entity-converter.d.ts +1 -1
  328. package/dist/template/entity-converter.d.ts.map +1 -1
  329. package/dist/template/entity-converter.js +103 -103
  330. package/dist/template/helpers.d.ts.map +1 -1
  331. package/dist/template/helpers.js +163 -163
  332. package/dist/template/implementations/entity.template.d.ts +1 -1
  333. package/dist/template/implementations/entity.template.d.ts.map +1 -1
  334. package/dist/template/implementations/entity.template.js +76 -85
  335. package/dist/template/implementations/entry-server.template.d.ts +1 -1
  336. package/dist/template/implementations/entry-server.template.d.ts.map +1 -1
  337. package/dist/template/implementations/entry-server.template.js +32 -27
  338. package/dist/template/implementations/generated.template.d.ts +1 -1
  339. package/dist/template/implementations/generated.template.d.ts.map +1 -1
  340. package/dist/template/implementations/generated.template.js +254 -275
  341. package/dist/template/implementations/generated_http.template.d.ts +2 -2
  342. package/dist/template/implementations/generated_http.template.d.ts.map +1 -1
  343. package/dist/template/implementations/generated_http.template.js +114 -133
  344. package/dist/template/implementations/generated_sso.template.d.ts.map +1 -1
  345. package/dist/template/implementations/generated_sso.template.js +249 -275
  346. package/dist/template/implementations/init_types.template.d.ts +1 -1
  347. package/dist/template/implementations/init_types.template.d.ts.map +1 -1
  348. package/dist/template/implementations/init_types.template.js +40 -34
  349. package/dist/template/implementations/model.template.d.ts +1 -1
  350. package/dist/template/implementations/model.template.d.ts.map +1 -1
  351. package/dist/template/implementations/model.template.js +56 -53
  352. package/dist/template/implementations/model_test.template.d.ts +1 -1
  353. package/dist/template/implementations/model_test.template.d.ts.map +1 -1
  354. package/dist/template/implementations/model_test.template.js +32 -24
  355. package/dist/template/implementations/queries.template.d.ts +1 -1
  356. package/dist/template/implementations/queries.template.d.ts.map +1 -1
  357. package/dist/template/implementations/queries.template.js +84 -89
  358. package/dist/template/implementations/sd.template.d.ts +1 -1
  359. package/dist/template/implementations/sd.template.d.ts.map +1 -1
  360. package/dist/template/implementations/sd.template.js +137 -144
  361. package/dist/template/implementations/services.template.d.ts +1 -1
  362. package/dist/template/implementations/services.template.d.ts.map +1 -1
  363. package/dist/template/implementations/services.template.js +164 -189
  364. package/dist/template/implementations/view_form.template.d.ts +1 -1
  365. package/dist/template/implementations/view_form.template.d.ts.map +1 -1
  366. package/dist/template/implementations/view_form.template.js +258 -285
  367. package/dist/template/implementations/view_id_all_select.template.d.ts +1 -1
  368. package/dist/template/implementations/view_id_all_select.template.d.ts.map +1 -1
  369. package/dist/template/implementations/view_id_all_select.template.js +31 -25
  370. package/dist/template/implementations/view_list.template.d.ts +1 -1
  371. package/dist/template/implementations/view_list.template.d.ts.map +1 -1
  372. package/dist/template/implementations/view_list.template.js +304 -355
  373. package/dist/template/implementations/view_search_input.template.d.ts +1 -1
  374. package/dist/template/implementations/view_search_input.template.d.ts.map +1 -1
  375. package/dist/template/implementations/view_search_input.template.js +31 -27
  376. package/dist/template/index.js +21 -7
  377. package/dist/template/template-manager.d.ts +1 -1
  378. package/dist/template/template-manager.d.ts.map +1 -1
  379. package/dist/template/template-manager.js +132 -123
  380. package/dist/template/template-types.js +8 -6
  381. package/dist/template/template.d.ts +2 -2
  382. package/dist/template/template.d.ts.map +1 -1
  383. package/dist/template/template.js +73 -68
  384. package/dist/template/zod-converter.d.ts.map +1 -1
  385. package/dist/template/zod-converter.js +603 -657
  386. package/dist/testing/_relation-graph.d.ts +1 -1
  387. package/dist/testing/_relation-graph.d.ts.map +1 -1
  388. package/dist/testing/_relation-graph.js +93 -88
  389. package/dist/testing/bootstrap.d.ts +22 -13
  390. package/dist/testing/bootstrap.d.ts.map +1 -1
  391. package/dist/testing/bootstrap.js +114 -110
  392. package/dist/testing/data-explorer.d.ts +3 -3
  393. package/dist/testing/data-explorer.d.ts.map +1 -1
  394. package/dist/testing/data-explorer.js +237 -265
  395. package/dist/testing/dev-test-routes.d.ts +2 -2
  396. package/dist/testing/dev-test-routes.d.ts.map +1 -1
  397. package/dist/testing/dev-test-routes.js +258 -249
  398. package/dist/testing/dev-vitest-manager.d.ts +1 -1
  399. package/dist/testing/dev-vitest-manager.d.ts.map +1 -1
  400. package/dist/testing/dev-vitest-manager.js +514 -539
  401. package/dist/testing/faker-mappings.js +422 -420
  402. package/dist/testing/fixture-generator.d.ts +3 -3
  403. package/dist/testing/fixture-generator.d.ts.map +1 -1
  404. package/dist/testing/fixture-generator.js +1216 -1346
  405. package/dist/testing/fixture-loader.js +26 -25
  406. package/dist/testing/fixture-manager.d.ts +3 -3
  407. package/dist/testing/fixture-manager.d.ts.map +1 -1
  408. package/dist/testing/fixture-manager.js +706 -776
  409. package/dist/testing/global-setup.js +53 -49
  410. package/dist/testing/index.js +19 -11
  411. package/dist/testing/naite-vitest-reporter.js +18 -13
  412. package/dist/testing/parallel-db-manager.d.ts +1 -1
  413. package/dist/testing/parallel-db-manager.d.ts.map +1 -1
  414. package/dist/testing/parallel-db-manager.js +63 -78
  415. package/dist/testing/vitest-helpers.d.ts +1 -1
  416. package/dist/testing/vitest-helpers.d.ts.map +1 -1
  417. package/dist/testing/vitest-helpers.js +37 -33
  418. package/dist/types/types.d.ts +28 -28
  419. package/dist/types/types.d.ts.map +1 -1
  420. package/dist/types/types.js +764 -890
  421. package/dist/ui/ai-api.d.ts +1 -1
  422. package/dist/ui/ai-api.d.ts.map +1 -1
  423. package/dist/ui/ai-api.js +52 -42
  424. package/dist/ui/ai-client.d.ts +1 -2
  425. package/dist/ui/ai-client.d.ts.map +1 -1
  426. package/dist/ui/ai-client.js +353 -388
  427. package/dist/ui/api.d.ts +1 -1
  428. package/dist/ui/api.d.ts.map +1 -1
  429. package/dist/ui/api.js +903 -1145
  430. package/dist/ui/cdd-service.d.ts +1 -1
  431. package/dist/ui/cdd-service.d.ts.map +1 -1
  432. package/dist/ui/cdd-service.js +406 -407
  433. package/dist/ui/cdd-types.js +1 -3
  434. package/dist/ui-web/assets/index-C8qhvZbs.js +199 -0
  435. package/dist/ui-web/assets/index-DqgrO7Za.css +1 -0
  436. package/dist/ui-web/index.html +3 -3
  437. package/dist/utils/async-utils.js +57 -45
  438. package/dist/utils/console-util.d.ts.map +1 -1
  439. package/dist/utils/console-util.js +104 -87
  440. package/dist/utils/controller.js +26 -19
  441. package/dist/utils/esm-utils.js +49 -38
  442. package/dist/utils/formatter.d.ts +1 -2
  443. package/dist/utils/formatter.d.ts.map +1 -1
  444. package/dist/utils/formatter.js +89 -115
  445. package/dist/utils/fs-utils.d.ts.map +1 -1
  446. package/dist/utils/fs-utils.js +68 -65
  447. package/dist/utils/lodash-able.js +11 -4
  448. package/dist/utils/model.d.ts +1 -1
  449. package/dist/utils/model.d.ts.map +1 -1
  450. package/dist/utils/model.js +21 -19
  451. package/dist/utils/object-utils.js +148 -186
  452. package/dist/utils/path-utils.js +67 -57
  453. package/dist/utils/process-utils.d.ts.map +1 -1
  454. package/dist/utils/process-utils.js +37 -31
  455. package/dist/utils/sql-parser.d.ts +1 -1
  456. package/dist/utils/sql-parser.d.ts.map +1 -1
  457. package/dist/utils/sql-parser.js +40 -40
  458. package/dist/utils/type-utils.js +44 -43
  459. package/dist/utils/utils.d.ts +2 -2
  460. package/dist/utils/utils.d.ts.map +1 -1
  461. package/dist/utils/utils.js +81 -88
  462. package/dist/utils/zod-error.d.ts +1 -1
  463. package/dist/utils/zod-error.d.ts.map +1 -1
  464. package/dist/utils/zod-error.js +24 -17
  465. package/dist/vector/chunking.d.ts +1 -1
  466. package/dist/vector/chunking.d.ts.map +1 -1
  467. package/dist/vector/chunking.js +100 -94
  468. package/dist/vector/config.d.ts +1 -1
  469. package/dist/vector/config.d.ts.map +1 -1
  470. package/dist/vector/config.js +76 -78
  471. package/dist/vector/embedding.d.ts +1 -1
  472. package/dist/vector/embedding.d.ts.map +1 -1
  473. package/dist/vector/embedding.js +128 -125
  474. package/dist/vector/index.js +5 -5
  475. package/dist/vector/types.js +1 -5
  476. package/package.json +39 -42
  477. package/src/ai/agents/agent.ts +12 -5
  478. package/src/ai/agents/types.ts +5 -5
  479. package/src/ai/providers/rtzr/model.ts +8 -10
  480. package/src/ai/providers/rtzr/options.ts +2 -1
  481. package/src/ai/providers/rtzr/provider.ts +5 -3
  482. package/src/ai/providers/rtzr/utils.ts +2 -7
  483. package/src/api/__tests__/config.test.ts +15 -8
  484. package/src/api/base-frame.ts +5 -3
  485. package/src/api/caster.ts +7 -6
  486. package/src/api/code-converters.ts +23 -26
  487. package/src/api/config.ts +23 -21
  488. package/src/api/context.ts +18 -11
  489. package/src/api/decorators.ts +17 -18
  490. package/src/api/sonamu.ts +113 -71
  491. package/src/auth/auth-generator.ts +4 -6
  492. package/src/auth/better-auth-entities.ts +3 -2
  493. package/src/auth/knex-adapter.ts +6 -5
  494. package/src/auth/plugins/entity-definitions/admin.ts +1 -1
  495. package/src/auth/plugins/entity-definitions/anonymous.ts +1 -1
  496. package/src/auth/plugins/entity-definitions/api-key.ts +6 -11
  497. package/src/auth/plugins/entity-definitions/index.ts +1 -1
  498. package/src/auth/plugins/entity-definitions/jwt.ts +1 -1
  499. package/src/auth/plugins/entity-definitions/organization.ts +1 -1
  500. package/src/auth/plugins/entity-definitions/passkey.ts +1 -1
  501. package/src/auth/plugins/entity-definitions/phone-number.ts +1 -1
  502. package/src/auth/plugins/entity-definitions/sso.ts +1 -1
  503. package/src/auth/plugins/entity-definitions/two-factor.ts +1 -1
  504. package/src/auth/plugins/entity-definitions/types.ts +1 -1
  505. package/src/auth/plugins/entity-definitions/username.ts +1 -1
  506. package/src/auth/plugins/wrappers/admin.ts +3 -1
  507. package/src/auth/plugins/wrappers/anonymous.ts +3 -1
  508. package/src/auth/plugins/wrappers/api-key.ts +5 -3
  509. package/src/auth/plugins/wrappers/jwt.ts +3 -1
  510. package/src/auth/plugins/wrappers/organization.ts +3 -1
  511. package/src/auth/plugins/wrappers/passkey.ts +3 -1
  512. package/src/auth/plugins/wrappers/phone-number.ts +3 -1
  513. package/src/auth/plugins/wrappers/sso.ts +2 -1
  514. package/src/auth/plugins/wrappers/two-factor.ts +3 -1
  515. package/src/auth/plugins/wrappers/username.ts +3 -1
  516. package/src/bin/__tests__/ts-loader-register.test.ts +7 -12
  517. package/src/bin/build-config.ts +3 -3
  518. package/src/bin/cli.ts +34 -26
  519. package/src/bin/fixture.ts +4 -2
  520. package/src/bin/hmr-hook-register.ts +1 -0
  521. package/src/bin/test-command.ts +4 -2
  522. package/src/bin/ts-loader-registration.ts +6 -22
  523. package/src/cache/cache-manager.ts +2 -1
  524. package/src/cache/decorator.ts +2 -2
  525. package/src/cache/types.ts +3 -3
  526. package/src/cache-control/cache-control.ts +3 -2
  527. package/src/cache-control/types.ts +2 -2
  528. package/src/compress/compress.ts +1 -1
  529. package/src/cone/cone-generator.ts +5 -3
  530. package/src/database/_batch_update.ts +1 -1
  531. package/src/database/base-model.ts +18 -11
  532. package/src/database/base-model.types.ts +12 -11
  533. package/src/database/db.ts +56 -21
  534. package/src/database/knex.ts +2 -2
  535. package/src/database/puri-subset.test-d.ts +33 -32
  536. package/src/database/puri-subset.types.ts +6 -7
  537. package/src/database/puri-wrapper.ts +29 -26
  538. package/src/database/puri.ts +36 -34
  539. package/src/database/puri.types.test-d.ts +6 -5
  540. package/src/database/puri.types.ts +10 -13
  541. package/src/database/transaction-context.ts +2 -2
  542. package/src/database/upsert-builder.ts +14 -7
  543. package/src/dict/sd.ts +17 -4
  544. package/src/dict/sonamu-dictionary.ts +23 -17
  545. package/src/entity/entity-manager.ts +9 -7
  546. package/src/entity/entity-template-cone.ts +10 -3
  547. package/src/entity/entity.ts +20 -16
  548. package/src/exceptions/error-handler.ts +2 -1
  549. package/src/exceptions/so-exceptions.ts +1 -1
  550. package/src/filter/utils.ts +3 -2
  551. package/src/logger/category.ts +1 -0
  552. package/src/logger/configure.ts +5 -5
  553. package/src/migration/__tests__/code-generation.search-text.test.ts +2 -3
  554. package/src/migration/code-generation.ts +26 -25
  555. package/src/migration/migration-set.ts +16 -18
  556. package/src/migration/migrator.ts +38 -33
  557. package/src/migration/postgresql-schema-reader.ts +12 -12
  558. package/src/migration/slack-confirm.ts +5 -4
  559. package/src/migration/types.ts +2 -2
  560. package/src/naite/messaging-types.ts +1 -1
  561. package/src/naite/naite-reporter.ts +5 -3
  562. package/src/naite/naite.ts +12 -7
  563. package/src/shared/app.shared.ts.txt +2 -2
  564. package/src/shared/web.shared.ts.txt +2 -2
  565. package/src/skills/AGENTS.md +22 -21
  566. package/src/skills/commands/sonamu-skills.md +9 -9
  567. package/src/skills/project/README.md +1 -3
  568. package/src/skills/sonamu/SKILL.md +111 -104
  569. package/src/skills/sonamu/ai-agents.md +27 -26
  570. package/src/skills/sonamu/api.md +81 -69
  571. package/src/skills/sonamu/auth-migration.md +13 -27
  572. package/src/skills/sonamu/auth-plugins.md +50 -32
  573. package/src/skills/sonamu/auth.md +30 -24
  574. package/src/skills/sonamu/cdd.md +2 -1
  575. package/src/skills/sonamu/cone.md +50 -50
  576. package/src/skills/sonamu/config.md +74 -51
  577. package/src/skills/sonamu/create-sonamu.md +31 -19
  578. package/src/skills/sonamu/database.md +43 -26
  579. package/src/skills/sonamu/entity-basic.md +62 -62
  580. package/src/skills/sonamu/entity-relations.md +84 -80
  581. package/src/skills/sonamu/entity-validation-checklist.md +19 -15
  582. package/src/skills/sonamu/fixture-cli.md +52 -30
  583. package/src/skills/sonamu/framework-change.md +9 -7
  584. package/src/skills/sonamu/frontend.md +64 -82
  585. package/src/skills/sonamu/i18n.md +45 -37
  586. package/src/skills/sonamu/migration.md +54 -31
  587. package/src/skills/sonamu/model.md +98 -66
  588. package/src/skills/sonamu/naite.md +34 -32
  589. package/src/skills/sonamu/project-init.md +28 -8
  590. package/src/skills/sonamu/puri.md +82 -91
  591. package/src/skills/sonamu/scaffolding.md +44 -32
  592. package/src/skills/sonamu/skill-contribution.md +50 -45
  593. package/src/skills/sonamu/subset.md +13 -13
  594. package/src/skills/sonamu/tasks.md +73 -58
  595. package/src/skills/sonamu/testing-devrunner.md +56 -36
  596. package/src/skills/sonamu/testing.md +23 -58
  597. package/src/skills/sonamu/upsert.md +32 -31
  598. package/src/skills/sonamu/vector.md +37 -36
  599. package/src/ssr/index.ts +2 -12
  600. package/src/ssr/registry.ts +1 -1
  601. package/src/ssr/renderer.ts +7 -5
  602. package/src/ssr/types.ts +2 -2
  603. package/src/storage/buffered-file.ts +4 -2
  604. package/src/storage/drivers.ts +3 -2
  605. package/src/storage/s3-driver.ts +7 -4
  606. package/src/storage/storage-manager.ts +3 -2
  607. package/src/storage/types.ts +3 -2
  608. package/src/storage/uploaded-file.ts +1 -1
  609. package/src/stream/sse.ts +2 -2
  610. package/src/syncer/api-parser.ts +8 -5
  611. package/src/syncer/checksum.ts +9 -5
  612. package/src/syncer/code-generator.ts +16 -8
  613. package/src/syncer/entity-operations.ts +5 -3
  614. package/src/syncer/file-patterns.ts +2 -1
  615. package/src/syncer/module-loader.ts +9 -6
  616. package/src/syncer/syncer-actions.ts +5 -3
  617. package/src/syncer/syncer.ts +18 -24
  618. package/src/tasks/decorator.ts +10 -8
  619. package/src/tasks/step-wrapper.ts +1 -1
  620. package/src/tasks/workflow-manager.ts +15 -10
  621. package/src/template/__tests__/generated.template.search-text.test.ts +1 -0
  622. package/src/template/entity-converter.ts +4 -2
  623. package/src/template/generated.template.test-d.ts +2 -1
  624. package/src/template/helpers.ts +5 -2
  625. package/src/template/implementations/entity.template.ts +9 -8
  626. package/src/template/implementations/entry-server.template.ts +1 -1
  627. package/src/template/implementations/generated.template.ts +21 -29
  628. package/src/template/implementations/generated_http.template.ts +9 -6
  629. package/src/template/implementations/generated_sso.template.ts +6 -4
  630. package/src/template/implementations/init_types.template.ts +3 -2
  631. package/src/template/implementations/model.template.ts +4 -2
  632. package/src/template/implementations/model_test.template.ts +3 -2
  633. package/src/template/implementations/queries.template.ts +6 -14
  634. package/src/template/implementations/sd.template.ts +4 -2
  635. package/src/template/implementations/services.template.ts +7 -11
  636. package/src/template/implementations/view_form.template.ts +5 -3
  637. package/src/template/implementations/view_id_all_select.template.ts +3 -2
  638. package/src/template/implementations/view_list.template.ts +7 -5
  639. package/src/template/implementations/view_search_input.template.ts +3 -2
  640. package/src/template/template-manager.ts +4 -3
  641. package/src/template/template.ts +4 -3
  642. package/src/template/zod-converter.ts +10 -7
  643. package/src/testing/__tests__/dev-test-routes.test.ts +3 -2
  644. package/src/testing/__tests__/dev-vitest-manager.test.ts +1 -0
  645. package/src/testing/_relation-graph.ts +2 -2
  646. package/src/testing/bootstrap.ts +53 -21
  647. package/src/testing/data-explorer.ts +5 -4
  648. package/src/testing/dev-test-routes.ts +8 -5
  649. package/src/testing/dev-vitest-manager.ts +13 -12
  650. package/src/testing/fixture-generator.ts +11 -17
  651. package/src/testing/fixture-manager.ts +23 -19
  652. package/src/testing/parallel-db-manager.ts +2 -1
  653. package/src/testing/vitest-helpers.ts +2 -1
  654. package/src/types/__tests__/entity-json-schema-search-text.test.ts +1 -0
  655. package/src/types/types.ts +8 -8
  656. package/src/typings/knex.d.ts +4 -4
  657. package/src/ui/ai-api.ts +5 -3
  658. package/src/ui/ai-client.ts +6 -5
  659. package/src/ui/api.ts +25 -23
  660. package/src/ui/cdd-service.ts +12 -11
  661. package/src/utils/console-util.ts +3 -1
  662. package/src/utils/formatter.ts +94 -102
  663. package/src/utils/fs-utils.ts +2 -1
  664. package/src/utils/model.ts +2 -2
  665. package/src/utils/object-utils.ts +3 -3
  666. package/src/utils/process-utils.ts +2 -1
  667. package/src/utils/sql-parser.ts +10 -1
  668. package/src/utils/type-utils.ts +3 -3
  669. package/src/utils/utils.ts +9 -2
  670. package/src/utils/zod-error.ts +1 -1
  671. package/src/vector/chunking.ts +1 -1
  672. package/src/vector/config.ts +1 -1
  673. package/src/vector/embedding.ts +11 -9
  674. package/tsdown.api.config.ts +50 -0
  675. package/.swcrc.project-default +0 -18
  676. package/dist/api/__tests__/config.test.js +0 -189
  677. package/dist/bin/__tests__/test-command.test.js +0 -112
  678. package/dist/bin/__tests__/ts-loader-register.test.js +0 -45
  679. package/dist/database/puri-subset.test-d.js +0 -89
  680. package/dist/database/puri.types.test-d.js +0 -129
  681. package/dist/migration/__tests__/code-generation.search-text.test.js +0 -435
  682. package/dist/template/__tests__/generated.template.search-text.test.js +0 -99
  683. package/dist/template/generated.template.test-d.js +0 -24
  684. package/dist/testing/__tests__/dev-test-routes.test.js +0 -144
  685. package/dist/testing/__tests__/dev-vitest-manager.test.js +0 -152
  686. package/dist/types/__tests__/entity-json-schema-search-text.test.js +0 -256
  687. package/dist/typings/knex.d.js +0 -3
  688. package/dist/ui-web/assets/index-CKo0Z2Iu.css +0 -1
  689. package/dist/ui-web/assets/index-DK-2aacv.js +0 -257
@@ -10,6 +10,7 @@ description: Sonamu better-auth authentication system. Automatic entity generati
10
10
  ## Automatic Entity Generation
11
11
 
12
12
  **Source code:**
13
+
13
14
  - CLI: `modules/sonamu/src/bin/cli.ts` (auth_generate function)
14
15
  - Generation logic: `modules/sonamu/src/auth/auth-generator.ts`
15
16
  - Entity definitions: `modules/sonamu/src/auth/better-auth-entities.ts`
@@ -56,14 +57,15 @@ pnpm sonamu auth generate --plugins admin,2fa,username
56
57
 
57
58
  The 4 entities generated (`betterAuthV1` array):
58
59
 
59
- | Entity | Table | Key fields |
60
- |--------|--------|-----------|
61
- | User | users | id, name, email, email_verified, image |
62
- | Session | sessions | id, token, expires_at, user_id |
63
- | Account | accounts | id, provider_id, access_token, user_id |
64
- | Verification | verifications | id, identifier, value, expires_at |
60
+ | Entity | Table | Key fields |
61
+ | ------------ | ------------- | -------------------------------------- |
62
+ | User | users | id, name, email, email_verified, image |
63
+ | Session | sessions | id, token, expires_at, user_id |
64
+ | Account | accounts | id, provider_id, access_token, user_id |
65
+ | Verification | verifications | id, identifier, value, expires_at |
65
66
 
66
67
  **How it works:**
68
+
67
69
  - If the entity does not exist, it is created fresh
68
70
  - If the entity already exists, only missing fields are added
69
71
  - Fields with changed types are updated automatically
@@ -73,12 +75,12 @@ The 4 entities generated (`betterAuthV1` array):
73
75
 
74
76
  **Source code:** `modules/sonamu/src/auth/better-auth-entities.ts` (BASE_FIELD_MAPPINGS)
75
77
 
76
- | better-auth | Sonamu |
77
- |-------------|--------|
78
+ | better-auth | Sonamu |
79
+ | --------------- | ---------------- |
78
80
  | `emailVerified` | `email_verified` |
79
- | `createdAt` | `created_at` |
80
- | `userId` | `user_id` |
81
- | `expiresAt` | `expires_at` |
81
+ | `createdAt` | `created_at` |
82
+ | `userId` | `user_id` |
83
+ | `expiresAt` | `expires_at` |
82
84
 
83
85
  ## Config Setup
84
86
 
@@ -102,12 +104,12 @@ server: {
102
104
 
103
105
  ## API Endpoints (Auto-registered)
104
106
 
105
- | Path | Method | Description |
106
- |------|--------|------|
107
- | `/api/auth/sign-up/email` | POST | Sign up |
108
- | `/api/auth/sign-in/email` | POST | Sign in |
109
- | `/api/auth/sign-out` | POST | Sign out |
110
- | `/api/auth/get-session` | GET | Get session |
107
+ | Path | Method | Description |
108
+ | ------------------------- | ------ | ----------- |
109
+ | `/api/auth/sign-up/email` | POST | Sign up |
110
+ | `/api/auth/sign-in/email` | POST | Sign in |
111
+ | `/api/auth/sign-out` | POST | Sign out |
112
+ | `/api/auth/get-session` | GET | Get session |
111
113
 
112
114
  ## Accessing user/session from Context
113
115
 
@@ -119,9 +121,9 @@ import { Sonamu } from "sonamu";
119
121
  @api({ httpMethod: "GET", guards: ["user"] })
120
122
  async me(): Promise<UserSubsetA | null> {
121
123
  const { user, session } = Sonamu.getContext();
122
-
124
+
123
125
  if (!user) return null;
124
-
126
+
125
127
  // user.id, user.email, user.name, etc. are accessible
126
128
  return this.findById("A", user.id);
127
129
  }
@@ -134,6 +136,7 @@ async me(): Promise<UserSubsetA | null> {
134
136
  ### Built-in Guards
135
137
 
136
138
  Sonamu provides 3 default guards:
139
+
137
140
  - `query`: allows all users (including unauthenticated)
138
141
  - `user`: allows only authenticated users
139
142
  - `admin`: allows only users with admin privileges
@@ -202,35 +205,35 @@ import { Sonamu } from "sonamu";
202
205
  apiConfig: {
203
206
  guardHandler: (guard, request, api) => {
204
207
  const { user } = Sonamu.getContext();
205
-
208
+
206
209
  switch (guard) {
207
210
  case "user":
208
211
  if (!user) {
209
212
  throw new Error("Login is required");
210
213
  }
211
214
  break;
212
-
215
+
213
216
  case "admin":
214
217
  // Requires adding a role field to the User entity
215
218
  if (!user || (user as any).role !== "admin") {
216
219
  throw new Error("Only admins can access this");
217
220
  }
218
221
  break;
219
-
222
+
220
223
  case "manager":
221
224
  // Custom guard: manager permission
222
225
  if (!user || !["admin", "manager"].includes((user as any).role)) {
223
226
  throw new Error("Manager permission is required");
224
227
  }
225
228
  break;
226
-
229
+
227
230
  case "evaluator":
228
231
  // Custom guard: evaluator permission
229
232
  if (!user || !["admin", "evaluator"].includes((user as any).role)) {
230
233
  throw new Error("Evaluator permission is required");
231
234
  }
232
235
  break;
233
-
236
+
234
237
  case "query":
235
238
  // Allow all users
236
239
  break;
@@ -278,6 +281,7 @@ Adding an enum:
278
281
  ## Checklist
279
282
 
280
283
  After setup, verify:
284
+
281
285
  - [ ] **[Before generate] Confirm with user whether plugins are needed**
282
286
  - If "later" → remember `plugins_deferred: true`, guide on optimal timing
283
287
  - [ ] Run `pnpm sonamu auth generate [--plugins ...]`
@@ -291,9 +295,11 @@ After setup, verify:
291
295
  ## Reference
292
296
 
293
297
  **Skills documentation:**
298
+
294
299
  - Detailed configuration: "server.auth details" section in `config.md`
295
300
  - Context API: "Context access" section in `api.md`
296
301
 
297
302
  **Official documentation:**
303
+
298
304
  - Korean: `modules/docs/ko/api-development/authentication/setup.mdx`
299
305
  - English: `modules/docs/en/api-development/authentication/setup.mdx`
@@ -118,8 +118,9 @@ pnpm cdd <command>
118
118
  | `cdd ac add <file> <test-name>` | Add an empty test skeleton to a test file. Use `--describe <group>` to specify a describe block |
119
119
  | `cdd ac list [file]` | Print the describe/test tree of a test file. Parses `test()`, `it()`, and `testAs()` patterns |
120
120
  | `cdd rules validate` | Validate the format of `contract/rules/*.rules.json` |
121
- | `cdd agents init [--force]` | Initialize CDD agent setup in the project (creates `.agents/`, `AGENTS.md`, and symlinks) |
121
+ | `cdd agents init [--force]` | Initialize CDD agent setup + contract scaffold (creates `.agents/`, `AGENTS.md`, `contract/planning.md`, `contract/rules/web.rules.json`, `contract/rules/api.rules.json`) |
122
122
  | `cdd agents sync [--dry-run]` | Update CDD agent prompts to the latest version |
123
+ | `cdd contract init [--force]` | Scaffold contract directory only (`planning.md`, `rules/web.rules.json`, `rules/api.rules.json`). Alias: `cdd agents contract init` |
123
124
 
124
125
  ### Common options
125
126
 
@@ -12,11 +12,11 @@ During fixture generation, the LLM references `cone.note` to produce realistic,
12
12
 
13
13
  ## Role of Cone
14
14
 
15
- | Purpose | Description |
16
- |---------|-------------|
15
+ | Purpose | Description |
16
+ | ---------------------- | --------------------------------------------------------------------- |
17
17
  | **Fixture generation** | LLM generates contextually appropriate test data based on `cone.note` |
18
- | **Scaffolding** | Uses cone information to generate model and view templates |
19
- | **Documentation** | Metadata describing Entity structure and the meaning of each field |
18
+ | **Scaffolding** | Uses cone information to generate model and view templates |
19
+ | **Documentation** | Metadata describing Entity structure and the meaning of each field |
20
20
 
21
21
  ---
22
22
 
@@ -24,32 +24,32 @@ During fixture generation, the LLM references `cone.note` to produce realistic,
24
24
 
25
25
  ### Entity cone
26
26
 
27
- | Field | Type | Description |
28
- |-------|------|-------------|
29
- | `note` | string | Entity purpose, business context, and fixture generation guide |
30
- | `tags` | string[] | Classification tags |
27
+ | Field | Type | Description |
28
+ | ------ | -------- | -------------------------------------------------------------- |
29
+ | `note` | string | Entity purpose, business context, and fixture generation guide |
30
+ | `tags` | string[] | Classification tags |
31
31
 
32
32
  ### Prop cone
33
33
 
34
- | Field | Type | Description |
35
- |-------|------|-------------|
36
- | `note` | string | **Highest priority.** Business meaning of the field, concrete examples, value ranges, format constraints. Input the LLM reads to generate data |
37
- | `fixtureGenerator` | string | **Fallback.** faker.js expression. Fallback when no API key is available |
38
- | `fixtureDefault` | any | Fixed default value |
39
- | `fixtureStrategy` | string | `"sequence"` — used when id is auto-assigned by a DB sequence |
40
- | `dataSource` | object | Strategy for fetching reference data for relation props |
34
+ | Field | Type | Description |
35
+ | ------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
36
+ | `note` | string | **Highest priority.** Business meaning of the field, concrete examples, value ranges, format constraints. Input the LLM reads to generate data |
37
+ | `fixtureGenerator` | string | **Fallback.** faker.js expression. Fallback when no API key is available |
38
+ | `fixtureDefault` | any | Fixed default value |
39
+ | `fixtureStrategy` | string | `"sequence"` — used when id is auto-assigned by a DB sequence |
40
+ | `dataSource` | object | Strategy for fetching reference data for relation props |
41
41
 
42
42
  ### Subset cone
43
43
 
44
- | Field | Type | Description |
45
- |-------|------|-------------|
44
+ | Field | Type | Description |
45
+ | ------ | ------ | ---------------------------------------------------- |
46
46
  | `note` | string | Subset purpose, included fields, and when it is used |
47
47
 
48
48
  ### Enum cone
49
49
 
50
- | Field | Type | Description |
51
- |-------|------|-------------|
52
- | `note` | string | Meaning and usage context of the enum |
50
+ | Field | Type | Description |
51
+ | -------- | ------ | -------------------------------------- |
52
+ | `note` | string | Meaning and usage context of the enum |
53
53
  | `values` | object | `{ note: string }` for each enum value |
54
54
 
55
55
  ---
@@ -97,10 +97,10 @@ pnpm sonamu cone gen Post --locale en
97
97
 
98
98
  #### Options
99
99
 
100
- | Option | Description |
101
- |--------|-------------|
102
- | `--all` | Generate cone for all Entities |
103
- | `--regenerate` | Overwrite existing cone (default: only generate for fields with no note) |
100
+ | Option | Description |
101
+ | ----------------------- | ------------------------------------------------------------------------------------ |
102
+ | `--all` | Generate cone for all Entities |
103
+ | `--regenerate` | Overwrite existing cone (default: only generate for fields with no note) |
104
104
  | `--locale <ko\|en\|ja>` | Generation language (default: `i18n.defaultLocale` from `sonamu.config.ts`, or `ko`) |
105
105
 
106
106
  #### How it works
@@ -129,12 +129,12 @@ pnpm sonamu stub entity Post --no-cones
129
129
 
130
130
  #### Template cone vs LLM cone
131
131
 
132
- | Item | Template cone | LLM cone |
133
- |------|--------------|----------|
134
- | API key | Not required | Required |
132
+ | Item | Template cone | LLM cone |
133
+ | ------- | -------------------------------- | ------------------------ |
134
+ | API key | Not required | Required |
135
135
  | Quality | Defaults based on faker-mappings | Reflects project context |
136
- | Speed | Immediate | Takes a few seconds |
137
- | Upgrade | Can be upgraded with `cone gen` | — |
136
+ | Speed | Immediate | Takes a few seconds |
137
+ | Upgrade | Can be upgraded with `cone gen` | — |
138
138
 
139
139
  ---
140
140
 
@@ -233,14 +233,14 @@ Using `fixtureStrategy: "sequence"` causes a `MAX(id::bigint)` error during fixt
233
233
 
234
234
  Specifies how reference data is fetched for relation props.
235
235
 
236
- | Strategy | Description |
237
- |----------|-------------|
236
+ | Strategy | Description |
237
+ | -------- | -------------------------------- |
238
238
  | `recent` | Most recent data (by created_at) |
239
- | `sample` | Uniform sampling |
240
- | `random` | Random sampling |
241
- | `ids` | Specific IDs |
242
- | `query` | Custom query |
243
- | `file` | Load from file |
239
+ | `sample` | Uniform sampling |
240
+ | `random` | Random sampling |
241
+ | `ids` | Specific IDs |
242
+ | `query` | Custom query |
243
+ | `file` | Load from file |
244
244
 
245
245
  ```json
246
246
  "dataSource": {
@@ -253,16 +253,16 @@ Specifies how reference data is fetched for relation props.
253
253
 
254
254
  **Source:** `modules/sonamu/src/testing/data-explorer.ts`
255
255
 
256
- | Option | Type | Default | Description |
257
- |--------|------|---------|-------------|
258
- | `strategy` | string | — | Fetch strategy (see table above) |
259
- | `limit` | number | — | Maximum number of records to fetch |
260
- | `where` | object \| function | — | WHERE condition (object or Knex QueryBuilder function) |
261
- | `orderBy` | string | — | Sort criteria |
262
- | `ids` | number[] | — | Specific ID list for `ids` strategy |
263
- | `filePath` | string | — | File path for `file` strategy |
264
- | `useCache` | boolean | `false` | Whether to use caching |
265
- | `cacheTtl` | number | `300` | Cache TTL (in seconds) |
256
+ | Option | Type | Default | Description |
257
+ | ---------- | ------------------ | ------- | ------------------------------------------------------ |
258
+ | `strategy` | string | — | Fetch strategy (see table above) |
259
+ | `limit` | number | — | Maximum number of records to fetch |
260
+ | `where` | object \| function | — | WHERE condition (object or Knex QueryBuilder function) |
261
+ | `orderBy` | string | — | Sort criteria |
262
+ | `ids` | number[] | — | Specific ID list for `ids` strategy |
263
+ | `filePath` | string | — | File path for `file` strategy |
264
+ | `useCache` | boolean | `false` | Whether to use caching |
265
+ | `cacheTtl` | number | `300` | Cache TTL (in seconds) |
266
266
 
267
267
  **Example using a where condition:**
268
268
 
@@ -280,10 +280,10 @@ Specifies how reference data is fetched for relation props.
280
280
 
281
281
  Used in `fixture gen` to fetch related data alongside the target data.
282
282
 
283
- | Option | Type | Default | Description |
284
- |--------|------|---------|-------------|
285
- | `includeRelations` | boolean | `true` | Whether to include related data |
286
- | `maxDepth` | number | `2` | Maximum depth for recursive traversal |
283
+ | Option | Type | Default | Description |
284
+ | ------------------ | ------- | ------- | ------------------------------------- |
285
+ | `includeRelations` | boolean | `true` | Whether to include related data |
286
+ | `maxDepth` | number | `2` | Maximum depth for recursive traversal |
287
287
 
288
288
  ---
289
289
 
@@ -44,21 +44,21 @@ SLACK_CHANNEL_ID=C0123456789
44
44
 
45
45
  ### Environment Variable Reference
46
46
 
47
- | Variable | Required | Description |
48
- |-----|-----|------|
49
- | `DB_HOST` | ✓ | DB host (Docker: `0.0.0.0`, external DB: the relevant IP) |
50
- | `DB_PORT` | ✓ | DB port (default: `5432`) |
51
- | `DB_USER` | ✓ | DB username (default: `postgres`) |
52
- | `DB_PASSWORD` | ✓ | DB password |
53
- | `DATABASE_NAME` | ✓ | Database name |
54
- | `PROJECT_NAME` | ✓ | Project name (used in Docker, config) |
55
- | `CONTAINER_NAME` | | Docker container name |
56
- | `SESSION_SECRET` | | Session encryption key (required in production) |
57
- | `SESSION_SALT` | | Session salt (16 characters) |
58
- | `AWS_ACCESS_KEY_ID` | | Required when using S3 |
59
- | `AWS_SECRET_ACCESS_KEY` | | Required when using S3 |
60
- | `S3_REGION` | | S3 region (default: `ap-northeast-2`) |
61
- | `S3_BUCKET` | | S3 bucket name |
47
+ | Variable | Required | Description |
48
+ | ----------------------- | -------- | --------------------------------------------------------- |
49
+ | `DB_HOST` | ✓ | DB host (Docker: `0.0.0.0`, external DB: the relevant IP) |
50
+ | `DB_PORT` | ✓ | DB port (default: `5432`) |
51
+ | `DB_USER` | ✓ | DB username (default: `postgres`) |
52
+ | `DB_PASSWORD` | ✓ | DB password |
53
+ | `DATABASE_NAME` | ✓ | Database name |
54
+ | `PROJECT_NAME` | ✓ | Project name (used in Docker, config) |
55
+ | `CONTAINER_NAME` | | Docker container name |
56
+ | `SESSION_SECRET` | | Session encryption key (required in production) |
57
+ | `SESSION_SALT` | | Session salt (16 characters) |
58
+ | `AWS_ACCESS_KEY_ID` | | Required when using S3 |
59
+ | `AWS_SECRET_ACCESS_KEY` | | Required when using S3 |
60
+ | `S3_REGION` | | S3 region (default: `ap-northeast-2`) |
61
+ | `S3_BUCKET` | | S3 bucket name |
62
62
 
63
63
  ---
64
64
 
@@ -79,14 +79,30 @@ const port = 34900;
79
79
 
80
80
  export default defineConfig({
81
81
  projectName: process.env.PROJECT_NAME ?? "MyProject",
82
- api: { /* API settings */ },
83
- i18n: { /* i18n settings */ },
84
- sync: { /* sync settings */ },
85
- database: { /* DB settings */ },
86
- logging: { /* logging settings (disable with false) */ },
87
- test: { /* test settings */ },
88
- server: { /* server settings */ },
89
- slackConfirm: { /* Production migration Slack approval */ },
82
+ api: {
83
+ /* API settings */
84
+ },
85
+ i18n: {
86
+ /* i18n settings */
87
+ },
88
+ sync: {
89
+ /* sync settings */
90
+ },
91
+ database: {
92
+ /* DB settings */
93
+ },
94
+ logging: {
95
+ /* logging settings (disable with false) */
96
+ },
97
+ test: {
98
+ /* test settings */
99
+ },
100
+ server: {
101
+ /* server settings */
102
+ },
103
+ slackConfirm: {
104
+ /* Production migration Slack approval */
105
+ },
90
106
  });
91
107
  ```
92
108
 
@@ -190,6 +206,7 @@ pnpm sonamu auth generate
190
206
  ```
191
207
 
192
208
  Generated entities:
209
+
193
210
  - **User** - user (id, name, email, email_verified, image)
194
211
  - **Session** - session (token, expires_at, user_id)
195
212
  - **Account** - account (provider_id, access_token, etc.)
@@ -221,12 +238,12 @@ server: {
221
238
 
222
239
  Automatically registered under the `/api/auth/*` path:
223
240
 
224
- | Endpoint | Method | Description |
225
- |------------|--------|------|
226
- | `/api/auth/sign-up/email` | POST | Sign up |
227
- | `/api/auth/sign-in/email` | POST | Sign in |
228
- | `/api/auth/sign-out` | POST | Sign out |
229
- | `/api/auth/get-session` | GET | Get session |
241
+ | Endpoint | Method | Description |
242
+ | ------------------------- | ------ | ----------- |
243
+ | `/api/auth/sign-up/email` | POST | Sign up |
244
+ | `/api/auth/sign-in/email` | POST | Sign in |
245
+ | `/api/auth/sign-out` | POST | Sign out |
246
+ | `/api/auth/get-session` | GET | Get session |
230
247
 
231
248
  ### 4. Accessing user/session from Context
232
249
 
@@ -243,12 +260,12 @@ async me(): Promise<UserSubsetA | null> {
243
260
 
244
261
  better-auth uses camelCase, Sonamu uses snake_case. Automatic mapping is applied:
245
262
 
246
- | better-auth | Sonamu |
247
- |-------------|--------|
263
+ | better-auth | Sonamu |
264
+ | --------------- | ---------------- |
248
265
  | `emailVerified` | `email_verified` |
249
- | `createdAt` | `created_at` |
250
- | `userId` | `user_id` |
251
- | `expiresAt` | `expires_at` |
266
+ | `createdAt` | `created_at` |
267
+ | `userId` | `user_id` |
268
+ | `expiresAt` | `expires_at` |
252
269
 
253
270
  ---
254
271
 
@@ -277,8 +294,8 @@ declare module "sonamu" {
277
294
  query: true;
278
295
  admin: true;
279
296
  user: true;
280
- manager: true; // added
281
- superadmin: true; // added
297
+ manager: true; // added
298
+ superadmin: true; // added
282
299
  }
283
300
  }
284
301
  ```
@@ -370,9 +387,11 @@ export function canAccess(userRole: string, menu: keyof typeof menuPermissions)
370
387
 
371
388
  ```tsx
372
389
  // web/src/components/Sidebar.tsx
373
- {canAccess(user.role, "userManagement") && (
374
- <MenuItem href="/admin/users">User Management</MenuItem>
375
- )}
390
+ {
391
+ canAccess(user.role, "userManagement") && (
392
+ <MenuItem href="/admin/users">User Management</MenuItem>
393
+ );
394
+ }
376
395
  ```
377
396
 
378
397
  ---
@@ -394,6 +413,7 @@ session: {
394
413
  ```
395
414
 
396
415
  **Production checklist:**
416
+
397
417
  - `SESSION_SECRET`: must be changed to a strong random string
398
418
  - `SESSION_SALT`: change to a 16-character random string
399
419
  - `cookie.domain`: change to the actual domain
@@ -480,6 +500,7 @@ cache: {
480
500
  ```
481
501
 
482
502
  **Available drivers:**
503
+
483
504
  - `memory` - in-memory cache (default)
484
505
  - `file` - file-based cache
485
506
  - `redis` - Redis cache
@@ -576,6 +597,7 @@ lifecycle: {
576
597
  ## Sonamu Local Development Environment Setup
577
598
 
578
599
  **When is this needed:**
600
+
579
601
  - When modifying the Sonamu framework source code during development
580
602
  - When linking a local Sonamu repository to a project for development
581
603
 
@@ -610,7 +632,7 @@ overrides:
610
632
  ```json
611
633
  {
612
634
  "dependencies": {
613
- "sonamu": "^0.7.45" // specify the latest published version
635
+ "sonamu": "^0.7.45" // specify the latest published version
614
636
  }
615
637
  }
616
638
  ```
@@ -694,17 +716,17 @@ Pass Fastify server options directly (excluding `logger`).
694
716
 
695
717
  ### Full Plugin List
696
718
 
697
- | Plugin | Type | Description |
698
- |----------|------|------|
699
- | `compress` | `boolean \| FastifyCompressOptions` | Response compression (@fastify/compress) |
700
- | `cors` | `boolean \| FastifyCorsOptions` | CORS configuration |
701
- | `formbody` | `boolean \| FastifyFormbodyOptions` | x-www-form-urlencoded parsing |
702
- | `multipart` | `boolean \| FastifyMultipartOptions` | File upload |
703
- | `qs` | `boolean \| QsPluginOptions` | Query string parsing |
704
- | `session` | session config | Session management |
705
- | `sse` | `boolean \| SsePluginOptions` | Server-Sent Events |
706
- | `static` | `boolean \| FastifyStaticOptions` | Static file serving |
707
- | `custom` | `(server: FastifyInstance) => void` | Custom plugin registration function |
719
+ | Plugin | Type | Description |
720
+ | ----------- | ------------------------------------ | ---------------------------------------- |
721
+ | `compress` | `boolean \| FastifyCompressOptions` | Response compression (@fastify/compress) |
722
+ | `cors` | `boolean \| FastifyCorsOptions` | CORS configuration |
723
+ | `formbody` | `boolean \| FastifyFormbodyOptions` | x-www-form-urlencoded parsing |
724
+ | `multipart` | `boolean \| FastifyMultipartOptions` | File upload |
725
+ | `qs` | `boolean \| QsPluginOptions` | Query string parsing |
726
+ | `session` | session config | Session management |
727
+ | `sse` | `boolean \| SsePluginOptions` | Server-Sent Events |
728
+ | `static` | `boolean \| FastifyStaticOptions` | Static file serving |
729
+ | `custom` | `(server: FastifyInstance) => void` | Custom plugin registration function |
708
730
 
709
731
  ## logging
710
732
 
@@ -742,6 +764,7 @@ slackConfirm: {
742
764
  5. Access Sonamu UI: http://localhost:34900/sonamu-ui
743
765
 
744
766
  Before production deployment:
767
+
745
768
  - [ ] Change `SESSION_SECRET`
746
769
  - [ ] Change `SESSION_SALT`
747
770
  - [ ] Change `cookie.domain` to the actual domain
@@ -23,23 +23,23 @@ pnpm create sonamu [project-name] --yes
23
23
 
24
24
  ### General Options
25
25
 
26
- | Option | Description | Default |
27
- |------|------|--------|
28
- | `--yes`, `-y` | Use all options with default values | - |
29
- | `--skip-pnpm` | Skip pnpm install | false |
30
- | `--skip-docker` | Skip Docker setup | false |
31
- | `--pnpm y/n` | Whether to install pnpm | y |
32
- | `--docker y/n` | Whether to configure Docker | y |
26
+ | Option | Description | Default |
27
+ | --------------- | ----------------------------------- | ------- |
28
+ | `--yes`, `-y` | Use all options with default values | - |
29
+ | `--skip-pnpm` | Skip pnpm install | false |
30
+ | `--skip-docker` | Skip Docker setup | false |
31
+ | `--pnpm y/n` | Whether to install pnpm | y |
32
+ | `--docker y/n` | Whether to configure Docker | y |
33
33
 
34
34
  ### Docker/DB Options
35
35
 
36
- | Option | Description | Default |
37
- |------|------|--------|
38
- | `--docker-project` | Docker project name | `[project-name]-docker` |
39
- | `--container-name` | Container name | `[project-name]-container` |
40
- | `--db-name` | Database name | `[project-name]` |
41
- | `--db-user` | DB user | `postgres` |
42
- | `--db-password` | DB password | `1234` |
36
+ | Option | Description | Default |
37
+ | ------------------ | ------------------- | -------------------------- |
38
+ | `--docker-project` | Docker project name | `[project-name]-docker` |
39
+ | `--container-name` | Container name | `[project-name]-container` |
40
+ | `--db-name` | Database name | `[project-name]` |
41
+ | `--db-user` | DB user | `postgres` |
42
+ | `--db-password` | DB password | `1234` |
43
43
 
44
44
  ## Usage Examples
45
45
 
@@ -97,20 +97,25 @@ pnpm create sonamu my_project \
97
97
  ## Next Steps After Creation
98
98
 
99
99
  1. Start the DB container (if Docker was configured)
100
+
100
101
  ```bash
101
102
  cd [project-name]/packages/api/
102
103
  pnpm docker:up
103
104
  ```
105
+
104
106
  > If a port conflict error occurs → see `database.md`
105
107
 
106
108
  2. Sync Skills
109
+
107
110
  ```bash
108
111
  cd [project-name]/packages/api
109
112
  pnpm sonamu skills sync
110
113
  ```
114
+
111
115
  > Will fail if sonamu is an npm version. See "Sonamu Link Setup" below.
112
116
 
113
117
  3. Start the dev server
118
+
114
119
  ```bash
115
120
  cd [project-name]/packages/api
116
121
  pnpm dev
@@ -137,6 +142,7 @@ Check the sonamu dependency in `packages/api/package.json`:
137
142
  ### How to change to a link
138
143
 
139
144
  1. Change the sonamu version to a link in `packages/api/package.json`:
145
+
140
146
  ```json
141
147
  "dependencies": {
142
148
  "sonamu": "link:/path/to/sonamu/modules/sonamu"
@@ -149,10 +155,10 @@ Check the sonamu dependency in `packages/api/package.json`:
149
155
 
150
156
  ### Link path examples
151
157
 
152
- | sonamu location | Link path |
153
- |------------|----------|
154
- | `~/Development/sonamu` | `link:~/Development/sonamu/modules/sonamu` |
155
- | Same directory as project | `link:../../sonamu/modules/sonamu` |
158
+ | sonamu location | Link path |
159
+ | ------------------------- | ------------------------------------------ |
160
+ | `~/Development/sonamu` | `link:~/Development/sonamu/modules/sonamu` |
161
+ | Same directory as project | `link:../../sonamu/modules/sonamu` |
156
162
 
157
163
  ## Renaming the Project (when creating a new project)
158
164
 
@@ -161,28 +167,34 @@ After generating the project, you need to replace the "Sonamu" text in the front
161
167
  **4 files to update:**
162
168
 
163
169
  1. **`packages/web/index.html`** - Browser tab title
170
+
164
171
  ```html
165
172
  <title>{project-name}</title>
166
173
  ```
167
174
 
168
175
  2. **`packages/web/src/routes/__root.tsx`** - TanStack Router head configuration (most important!)
176
+
169
177
  ```typescript
170
178
  head: () => ({
171
179
  meta: [{ title: "{project-name}" }],
172
180
  }),
173
181
  ```
182
+
174
183
  **Important:** If you don't update `__root.tsx`, the title will revert to "Sonamu" on HMR!
175
184
 
176
185
  3. **`packages/web/src/routes/index.tsx`** - Main page title
186
+
177
187
  ```tsx
178
- <h1 className="text-2xl font-bold mb-4">Welcome to {project-name}</h1>
188
+ <h1 className="text-2xl font-bold mb-4">Welcome to {project - name}</h1>
179
189
  ```
180
190
 
181
191
  4. **`packages/web/src/components/Sidebar.tsx`** - Sidebar app name
192
+
182
193
  ```typescript
183
194
  const title = isAdmin ? "Admin" : "{project-name}";
184
195
  ```
185
196
 
186
197
  **How to verify:**
198
+
187
199
  - Check that the project name is shown in the browser tab
188
200
  - Confirm that the tab title does not change on file save via HMR (if it does, `__root.tsx` is missing)