akanjs 3.1.0-rc.2 → 3.1.0-rc.21

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 (392) hide show
  1. package/base/baseEnv.ts +5 -2
  2. package/client/device.ts +1 -1
  3. package/client/frameConfig.ts +2 -2
  4. package/client/href.ts +35 -0
  5. package/client/index.ts +1 -0
  6. package/client/makePageProto.tsx +3 -2
  7. package/client/router.ts +6 -4
  8. package/client/rscNavigation.ts +1 -1
  9. package/client/transitionTypes.ts +0 -4
  10. package/client/translator.ts +16 -0
  11. package/client/types.ts +3 -2
  12. package/client/viewportMeta.ts +23 -8
  13. package/client/webManifest.ts +5 -3
  14. package/common/TrustedProxy.ts +14 -0
  15. package/common/codeAgentWire.ts +8 -1
  16. package/common/index.ts +1 -0
  17. package/common/interpolateTranslation.ts +17 -3
  18. package/common/isEmail.ts +1 -1
  19. package/common/localeConfig.ts +10 -4
  20. package/common/markdownSpans.ts +1 -1
  21. package/common/restClient.ts +3 -1
  22. package/common/routeConvention.ts +4 -4
  23. package/common/trimSlashes.ts +11 -0
  24. package/common/types.ts +1 -1
  25. package/constant/fieldInfo.ts +2 -2
  26. package/constant/fieldPlan.ts +80 -0
  27. package/constant/index.ts +3 -0
  28. package/constant/inputParser.ts +148 -0
  29. package/constant/invalidInputError.ts +13 -0
  30. package/constant/serialize.ts +36 -20
  31. package/constant/types.ts +1 -1
  32. package/constant/via.ts +2 -0
  33. package/dictionary/base.dictionary.ts +4 -0
  34. package/dictionary/trans.ts +8 -0
  35. package/document/database.ts +3 -6
  36. package/document/documentSchema.ts +1 -1
  37. package/document/noDocumentError.ts +6 -1
  38. package/fetch/client/fetchClient.ts +2 -1
  39. package/fetch/client/sliceInitHandle.ts +2 -3
  40. package/fetch/fetchType/appliedReturn.type.ts +3 -1
  41. package/fetch/types.ts +4 -2
  42. package/index.ts +2 -0
  43. package/package.json +31 -21
  44. package/server/akanApp.ts +15 -3
  45. package/server/akanServer.ts +34 -14
  46. package/server/artifact/routeClientCache.ts +4 -5
  47. package/server/artifact/routeSeedIndexStore.ts +3 -20
  48. package/server/artifact/routeSeedMatcher.ts +70 -0
  49. package/server/console.ts +1 -1
  50. package/server/di/diLifecycle.ts +16 -7
  51. package/server/imageOptimizer.ts +1 -1
  52. package/server/index.ts +1 -0
  53. package/server/machine/machineAccount.ts +28 -3
  54. package/server/machine/machineToken.ts +27 -3
  55. package/server/mcp/McpDispatcher.ts +2 -3
  56. package/server/mcp/McpExecutionContext.ts +9 -3
  57. package/server/migration/docPath.ts +121 -0
  58. package/server/migration/index.ts +15 -0
  59. package/server/migration/migrationChangeLog.ts +86 -0
  60. package/server/migration/migrationChanges.ts +70 -0
  61. package/server/migration/migrationCommand.ts +179 -0
  62. package/server/migration/migrationContext.ts +53 -0
  63. package/server/migration/migrationDefinition.ts +87 -0
  64. package/server/migration/migrationError.ts +45 -0
  65. package/server/migration/migrationLedger.ts +172 -0
  66. package/server/migration/migrationLock.ts +103 -0
  67. package/server/migration/migrationParams.ts +122 -0
  68. package/server/migration/migrationPulse.ts +39 -0
  69. package/server/migration/migrationRunner.ts +525 -0
  70. package/server/migration/migrationScope.ts +93 -0
  71. package/server/migration/migrationTable.ts +258 -0
  72. package/server/migration/migrations.ts +57 -0
  73. package/server/ops/opsCommand.ts +30 -1
  74. package/server/resolver/CascadeRunner.ts +15 -2
  75. package/server/resolver/signal.resolver.ts +35 -55
  76. package/server/routeState.ts +0 -6
  77. package/server/rscClient.tsx +22 -37
  78. package/server/rscNavigationState.ts +3 -5
  79. package/server/rscScrollRestoration.ts +116 -0
  80. package/server/rscWorker.tsx +12 -19
  81. package/server/sitemap.ts +4 -4
  82. package/server/tunnel/TunnelAgent.ts +9 -1
  83. package/server/webRouter.ts +17 -2
  84. package/service/agent.service.ts +21 -1
  85. package/service/endpointCacheKeys.ts +35 -0
  86. package/service/index.ts +1 -0
  87. package/service/injectInfo.ts +2 -2
  88. package/service/predefinedAdaptor/anthropicLlm.ts +37 -17
  89. package/service/predefinedAdaptor/database.adaptor.ts +15 -0
  90. package/service/predefinedAdaptor/documentTransfer.ts +50 -0
  91. package/service/predefinedAdaptor/endpointCacheControl.adaptor.ts +19 -0
  92. package/service/predefinedAdaptor/index.ts +1 -0
  93. package/service/predefinedAdaptor/llm.adaptor.ts +7 -0
  94. package/service/predefinedAdaptor/openaiDialect.ts +53 -17
  95. package/service/predefinedAdaptor/openaiLlm.ts +1 -1
  96. package/service/predefinedAdaptor/sql/MigrationTables.ts +90 -0
  97. package/service/predefinedAdaptor/sql/RawDocumentTable.ts +200 -0
  98. package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +6 -2
  99. package/service/predefinedAdaptor/sql/SqliteInsightSession.ts +4 -1
  100. package/service/predefinedAdaptor/sql/dialect/postgres.ts +0 -1
  101. package/service/predefinedAdaptor/sql/dialect/sqlite.ts +0 -1
  102. package/service/predefinedAdaptor/sql/types.ts +3 -1
  103. package/service/predefinedAdaptor/storage.adaptor.ts +19 -0
  104. package/signal/endpointCache.ts +23 -7
  105. package/signal/endpointErrorContract.ts +37 -0
  106. package/signal/endpointIdempotency.ts +5 -3
  107. package/signal/endpointInfo.ts +4 -1
  108. package/signal/endpointRateLimit.ts +6 -2
  109. package/signal/exception.ts +4 -1
  110. package/signal/index.ts +1 -0
  111. package/signal/mcp/McpDocument.ts +16 -1
  112. package/signal/mcp/McpUriTemplate.ts +1 -1
  113. package/signal/middlewareChain.ts +105 -0
  114. package/signal/openapi/openapi.ts +46 -2
  115. package/signal/serializer/fetch.serializer.ts +1 -0
  116. package/signal/signalContext.ts +110 -82
  117. package/signal/slice.ts +2 -2
  118. package/signal/trace.ts +8 -2
  119. package/signal/types.ts +13 -0
  120. package/store/action.ts +102 -42
  121. package/store/agent/ScreenImage.ts +166 -0
  122. package/store/agent/ScreenReader.ts +2 -1
  123. package/store/agent/StoreSurfaceSource.ts +41 -2
  124. package/store/agent/index.ts +2 -1
  125. package/store/databaseStateNames.ts +1 -0
  126. package/store/formUploadOf.ts +41 -0
  127. package/store/index.ts +1 -0
  128. package/store/liveInsert.ts +2 -2
  129. package/store/state.ts +9 -1
  130. package/store/stateBuilder.ts +8 -2
  131. package/store/storeInstance.ts +12 -3
  132. package/store/withSelector.ts +2 -2
  133. package/types/client/href.d.ts +11 -0
  134. package/types/client/index.d.ts +1 -0
  135. package/types/client/rscNavigation.d.ts +1 -1
  136. package/types/client/transitionTypes.d.ts +0 -2
  137. package/types/client/translator.d.ts +2 -0
  138. package/types/common/codeAgentWire.d.ts +7 -0
  139. package/types/common/index.d.ts +1 -0
  140. package/types/common/trimSlashes.d.ts +2 -0
  141. package/types/common/types.d.ts +1 -1
  142. package/types/constant/fieldInfo.d.ts +2 -2
  143. package/types/constant/fieldPlan.d.ts +33 -0
  144. package/types/constant/index.d.ts +3 -0
  145. package/types/constant/inputParser.d.ts +11 -0
  146. package/types/constant/invalidInputError.d.ts +8 -0
  147. package/types/constant/types.d.ts +1 -1
  148. package/types/dictionary/base.dictionary.d.ts +1 -1
  149. package/types/dictionary/dictionary.d.ts +3 -3
  150. package/types/dictionary/trans.d.ts +3 -0
  151. package/types/document/database.d.ts +2 -3
  152. package/types/document/documentSchema.d.ts +1 -1
  153. package/types/document/noDocumentError.d.ts +6 -1
  154. package/types/fetch/fetchType/appliedReturn.type.d.ts +3 -1
  155. package/types/fetch/types.d.ts +2 -2
  156. package/types/index.d.ts +5 -0
  157. package/types/server/akanServer.d.ts +1 -1
  158. package/types/server/artifact/routeSeedMatcher.d.ts +8 -0
  159. package/types/server/di/diLifecycle.d.ts +1 -0
  160. package/types/server/index.d.ts +1 -0
  161. package/types/server/machine/machineAccount.d.ts +1 -0
  162. package/types/server/machine/machineToken.d.ts +9 -0
  163. package/types/server/migration/docPath.d.ts +20 -0
  164. package/types/server/migration/index.d.ts +15 -0
  165. package/types/server/migration/migrationChangeLog.d.ts +27 -0
  166. package/types/server/migration/migrationChanges.d.ts +27 -0
  167. package/types/server/migration/migrationCommand.d.ts +33 -0
  168. package/types/server/migration/migrationContext.d.ts +28 -0
  169. package/types/server/migration/migrationDefinition.d.ts +42 -0
  170. package/types/server/migration/migrationError.d.ts +15 -0
  171. package/types/server/migration/migrationLedger.d.ts +51 -0
  172. package/types/server/migration/migrationLock.d.ts +34 -0
  173. package/types/server/migration/migrationParams.d.ts +41 -0
  174. package/types/server/migration/migrationPulse.d.ts +15 -0
  175. package/types/server/migration/migrationRunner.d.ts +93 -0
  176. package/types/server/migration/migrationScope.d.ts +42 -0
  177. package/types/server/migration/migrationTable.d.ts +52 -0
  178. package/types/server/migration/migrations.d.ts +12 -0
  179. package/types/server/migration.d.ts +1 -0
  180. package/types/server/ops/opsCommand.d.ts +10 -1
  181. package/types/server/routeState.d.ts +1 -4
  182. package/types/server/rscNavigationState.d.ts +2 -3
  183. package/types/server/rscScrollRestoration.d.ts +14 -0
  184. package/types/server/sitemap.d.ts +1 -1
  185. package/types/service/agent.service.d.ts +2 -0
  186. package/types/service/endpointCacheKeys.d.ts +8 -0
  187. package/types/service/index.d.ts +1 -0
  188. package/types/service/injectInfo.d.ts +2 -2
  189. package/types/service/predefinedAdaptor/anthropicLlm.d.ts +9 -4
  190. package/types/service/predefinedAdaptor/database.adaptor.d.ts +8 -1
  191. package/types/service/predefinedAdaptor/documentTransfer.d.ts +1 -0
  192. package/types/service/predefinedAdaptor/endpointCacheControl.adaptor.d.ts +9 -0
  193. package/types/service/predefinedAdaptor/index.d.ts +1 -0
  194. package/types/service/predefinedAdaptor/llm.adaptor.d.ts +7 -0
  195. package/types/service/predefinedAdaptor/openaiDialect.d.ts +20 -5
  196. package/types/service/predefinedAdaptor/sql/MigrationTables.d.ts +17 -0
  197. package/types/service/predefinedAdaptor/sql/RawDocumentTable.d.ts +38 -0
  198. package/types/service/predefinedAdaptor/sql/types.d.ts +1 -0
  199. package/types/service/predefinedAdaptor/storage.adaptor.d.ts +8 -0
  200. package/types/signal/endpointCache.d.ts +2 -0
  201. package/types/signal/endpointErrorContract.d.ts +10 -0
  202. package/types/signal/endpointIdempotency.d.ts +1 -0
  203. package/types/signal/endpointRateLimit.d.ts +1 -1
  204. package/types/signal/exception.d.ts +4 -1
  205. package/types/signal/index.d.ts +1 -0
  206. package/types/signal/middlewareChain.d.ts +11 -0
  207. package/types/signal/signalContext.d.ts +2 -6
  208. package/types/signal/slice.d.ts +1 -1
  209. package/types/signal/trace.d.ts +1 -1
  210. package/types/signal/types.d.ts +12 -0
  211. package/types/store/action.d.ts +2 -0
  212. package/types/store/agent/ScreenImage.d.ts +27 -0
  213. package/types/store/agent/StoreSurfaceSource.d.ts +1 -1
  214. package/types/store/agent/index.d.ts +2 -1
  215. package/types/store/databaseStateNames.d.ts +1 -0
  216. package/types/store/formUploadOf.d.ts +9 -0
  217. package/types/store/index.d.ts +1 -0
  218. package/types/store/state.d.ts +7 -1
  219. package/types/store/stateBuilder.d.ts +2 -1
  220. package/types/store/storeInstance.d.ts +2 -2
  221. package/types/store/withSelector.d.ts +1 -1
  222. package/types/ui/Agent/Composer.d.ts +2 -0
  223. package/types/ui/Agent/Menu.d.ts +2 -0
  224. package/types/ui/CsrImage.d.ts +2 -0
  225. package/types/ui/Data/CardList.d.ts +1 -1
  226. package/types/ui/Data/Dashboard.d.ts +1 -1
  227. package/types/ui/Data/Insight.d.ts +1 -1
  228. package/types/ui/Data/Item.d.ts +2 -2
  229. package/types/ui/Data/ListContainer.d.ts +1 -1
  230. package/types/ui/Data/Pagination.d.ts +1 -1
  231. package/types/ui/Data/TableList.d.ts +1 -1
  232. package/types/ui/Field/Relation.d.ts +13 -10
  233. package/types/ui/Field/index.d.ts +4 -4
  234. package/types/ui/Field/useRelationOptions.d.ts +3 -1
  235. package/types/ui/Field/useRelationWindow.d.ts +14 -0
  236. package/types/ui/Image.d.ts +3 -1
  237. package/types/ui/Load/View.d.ts +1 -1
  238. package/types/ui/Pagination.d.ts +1 -1
  239. package/types/ui/Signal/Arg.d.ts +1 -1
  240. package/types/ui/System/CSR.d.ts +1 -1
  241. package/types/ui/System/Client.d.ts +1 -1
  242. package/types/ui/System/SSR.d.ts +1 -1
  243. package/types/vendor/@akanjs/native/packages/core/src/plugin.d.ts +3 -3
  244. package/types/vendor/@akanjs/native/packages/desktop/src/page-veto.d.ts +1 -1
  245. package/types/vendor/@akanjs/native/packages/desktop/src/plugin.d.ts +1 -1
  246. package/types/vendor/@akanjs/native/plugins/auth-session/src/desktop.d.ts +2 -2
  247. package/types/vendor/@akanjs/native/plugins/auth-session/src/index.d.ts +1 -1
  248. package/types/vendor/@akanjs/native/plugins/autostart/src/desktop.d.ts +2 -2
  249. package/types/vendor/@akanjs/native/plugins/autostart/src/index.d.ts +1 -1
  250. package/types/vendor/@akanjs/native/plugins/badge/src/desktop.d.ts +1 -1
  251. package/types/vendor/@akanjs/native/plugins/badge/src/index.d.ts +1 -1
  252. package/types/vendor/@akanjs/native/plugins/badge/src/web.d.ts +1 -1
  253. package/types/vendor/@akanjs/native/plugins/biometric/src/index.d.ts +1 -1
  254. package/types/vendor/@akanjs/native/plugins/camera/src/desktop.d.ts +1 -1
  255. package/types/vendor/@akanjs/native/plugins/camera/src/index.d.ts +1 -1
  256. package/types/vendor/@akanjs/native/plugins/camera/src/web.d.ts +1 -1
  257. package/types/vendor/@akanjs/native/plugins/clipboard/src/desktop.d.ts +2 -2
  258. package/types/vendor/@akanjs/native/plugins/clipboard/src/index.d.ts +1 -1
  259. package/types/vendor/@akanjs/native/plugins/clipboard/src/web.d.ts +1 -1
  260. package/types/vendor/@akanjs/native/plugins/contacts/src/index.d.ts +1 -1
  261. package/types/vendor/@akanjs/native/plugins/device/src/desktop.d.ts +2 -2
  262. package/types/vendor/@akanjs/native/plugins/device/src/index.d.ts +1 -1
  263. package/types/vendor/@akanjs/native/plugins/device/src/web.d.ts +1 -1
  264. package/types/vendor/@akanjs/native/plugins/dialog/src/desktop.d.ts +1 -1
  265. package/types/vendor/@akanjs/native/plugins/dialog/src/index.d.ts +1 -1
  266. package/types/vendor/@akanjs/native/plugins/dialog/src/web.d.ts +1 -1
  267. package/types/vendor/@akanjs/native/plugins/dock/src/desktop.d.ts +1 -1
  268. package/types/vendor/@akanjs/native/plugins/dock/src/index.d.ts +1 -1
  269. package/types/vendor/@akanjs/native/plugins/file-picker/src/desktop.d.ts +2 -2
  270. package/types/vendor/@akanjs/native/plugins/file-picker/src/web.d.ts +1 -1
  271. package/types/vendor/@akanjs/native/plugins/filesystem/src/desktop.d.ts +2 -2
  272. package/types/vendor/@akanjs/native/plugins/filesystem/src/web.d.ts +1 -1
  273. package/types/vendor/@akanjs/native/plugins/haptics/src/index.d.ts +1 -1
  274. package/types/vendor/@akanjs/native/plugins/haptics/src/web.d.ts +1 -1
  275. package/types/vendor/@akanjs/native/plugins/http/src/desktop.d.ts +2 -2
  276. package/types/vendor/@akanjs/native/plugins/http/src/web.d.ts +1 -1
  277. package/types/vendor/@akanjs/native/plugins/keep-awake/src/desktop.d.ts +2 -2
  278. package/types/vendor/@akanjs/native/plugins/keep-awake/src/index.d.ts +1 -1
  279. package/types/vendor/@akanjs/native/plugins/keep-awake/src/web.d.ts +1 -1
  280. package/types/vendor/@akanjs/native/plugins/opener/src/desktop.d.ts +2 -2
  281. package/types/vendor/@akanjs/native/plugins/opener/src/index.d.ts +1 -1
  282. package/types/vendor/@akanjs/native/plugins/opener/src/web.d.ts +1 -1
  283. package/types/vendor/@akanjs/native/plugins/preferences/src/desktop.d.ts +1 -1
  284. package/types/vendor/@akanjs/native/plugins/preferences/src/index.d.ts +1 -1
  285. package/types/vendor/@akanjs/native/plugins/preferences/src/web.d.ts +1 -1
  286. package/types/vendor/@akanjs/native/plugins/secure-storage/src/desktop.d.ts +2 -2
  287. package/types/vendor/@akanjs/native/plugins/secure-storage/src/index.d.ts +1 -1
  288. package/types/vendor/@akanjs/native/plugins/share/src/index.d.ts +1 -1
  289. package/types/vendor/@akanjs/native/plugins/share/src/web.d.ts +1 -1
  290. package/types/vendor/@akanjs/native/plugins/single-instance/src/desktop.d.ts +2 -2
  291. package/types/vendor/@akanjs/native/plugins/splash-screen/src/index.d.ts +1 -1
  292. package/types/vendor/@akanjs/native/plugins/splash-screen/src/web.d.ts +1 -1
  293. package/types/vendor/@akanjs/native/plugins/sqlite/src/desktop.d.ts +2 -2
  294. package/types/vendor/@akanjs/native/plugins/toast/src/index.d.ts +1 -1
  295. package/types/vendor/@akanjs/native/plugins/toast/src/web.d.ts +1 -1
  296. package/types/vendor/@akanjs/native/plugins/window/src/index.d.ts +2 -2
  297. package/types/vendor/@akanjs/native/plugins/window-state/src/desktop.d.ts +2 -2
  298. package/types/vendor/@akanjs/native/plugins/window-state/src/index.d.ts +1 -1
  299. package/types/vendor/use-agentic/Compaction.d.ts +3 -1
  300. package/types/vendor/use-agentic/Reference.d.ts +9 -1
  301. package/types/vendor/use-agentic/ToolOutput.d.ts +6 -1
  302. package/types/vendor/use-agentic/ToolReturn.d.ts +18 -0
  303. package/types/vendor/use-agentic/Transcript.d.ts +7 -0
  304. package/types/vendor/use-agentic/index.d.ts +1 -0
  305. package/types/vendor/use-agentic/types.d.ts +6 -0
  306. package/types/webkit/useDebounce.d.ts +1 -1
  307. package/ui/Agent/Chat.tsx +1 -0
  308. package/ui/Agent/Composer.tsx +2 -0
  309. package/ui/Agent/Menu.tsx +5 -1
  310. package/ui/Agent/agentSessionOf.ts +15 -8
  311. package/ui/Agent/mentionDraft.ts +2 -3
  312. package/ui/Agent/useReferenceMenu.ts +1 -0
  313. package/ui/Agent/useSlashMenu.ts +1 -0
  314. package/ui/Clipboard.tsx +1 -0
  315. package/ui/CsrImage.tsx +3 -1
  316. package/ui/Data/CardList.tsx +1 -1
  317. package/ui/Data/Dashboard.tsx +1 -1
  318. package/ui/Data/Insight.tsx +1 -1
  319. package/ui/Data/Item.tsx +5 -2
  320. package/ui/Data/ListContainer.tsx +2 -2
  321. package/ui/Data/Pagination.tsx +1 -1
  322. package/ui/Data/TableList.tsx +1 -1
  323. package/ui/DraggableList.tsx +1 -0
  324. package/ui/Field/Collection.tsx +4 -0
  325. package/ui/Field/Relation.tsx +33 -14
  326. package/ui/Field/useRelationOptions.ts +33 -5
  327. package/ui/Field/useRelationWindow.ts +50 -0
  328. package/ui/Image.tsx +4 -4
  329. package/ui/Input.tsx +1 -0
  330. package/ui/Layout/Sider.tsx +1 -1
  331. package/ui/Link/Anchor.tsx +7 -5
  332. package/ui/Load/Units.tsx +17 -7
  333. package/ui/Load/View.tsx +2 -2
  334. package/ui/Model/Edit.tsx +1 -1
  335. package/ui/Model/EditModal.tsx +11 -5
  336. package/ui/Model/New.tsx +1 -1
  337. package/ui/Model/SureToRemove.tsx +1 -0
  338. package/ui/Model/ViewEditModal.tsx +17 -5
  339. package/ui/Model/ViewModal.tsx +2 -2
  340. package/ui/ObjectId.tsx +5 -1
  341. package/ui/Pagination.tsx +1 -1
  342. package/ui/Signal/Arg.tsx +1 -3
  343. package/ui/Signal/Doc.tsx +5 -1
  344. package/ui/System/CSR.tsx +1 -1
  345. package/ui/System/Client.tsx +1 -1
  346. package/ui/System/Reconnect.tsx +1 -1
  347. package/ui/System/SSR.tsx +3 -36
  348. package/ui/ToggleSelect.tsx +2 -0
  349. package/ui/styles.css +10 -103
  350. package/vendor/@akanjs/native/native/ios/Sources/AkanNativeBridge.swift +3 -2
  351. package/vendor/@akanjs/native/packages/cli/src/lib/addons.ts +4 -1
  352. package/vendor/@akanjs/native/packages/cli/src/lib/apk.ts +2 -2
  353. package/vendor/@akanjs/native/packages/cli/src/lib/codegen.ts +1 -1
  354. package/vendor/@akanjs/native/packages/cli/src/lib/csp.ts +4 -3
  355. package/vendor/@akanjs/native/packages/cli/src/lib/googleservices.ts +7 -1
  356. package/vendor/@akanjs/native/packages/cli/src/lib/hmr.ts +8 -5
  357. package/vendor/@akanjs/native/packages/cli/src/lib/html.ts +18 -3
  358. package/vendor/@akanjs/native/packages/cli/src/lib/manifestmerge.ts +1 -1
  359. package/vendor/@akanjs/native/packages/cli/src/lib/plist.ts +2 -4
  360. package/vendor/@akanjs/native/packages/cli/src/lib/toolchains.ts +1 -1
  361. package/vendor/@akanjs/native/packages/cli/src/lib/updates.ts +10 -4
  362. package/vendor/@akanjs/native/packages/cli/src/lib/xml.ts +4 -3
  363. package/vendor/@akanjs/native/packages/cli/src/platforms/android.ts +3 -3
  364. package/vendor/@akanjs/native/packages/core/src/kernel.ts +3 -3
  365. package/vendor/@akanjs/native/packages/core/src/live.ts +1 -0
  366. package/vendor/@akanjs/native/packages/core/src/plugin.ts +5 -3
  367. package/vendor/@akanjs/native/packages/desktop/src/host.ts +13 -5
  368. package/vendor/@akanjs/native/packages/desktop/src/lifecycle.ts +1 -0
  369. package/vendor/@akanjs/native/packages/desktop/src/page-veto.ts +1 -1
  370. package/vendor/@akanjs/native/packages/desktop/src/plugin.ts +4 -1
  371. package/vendor/@akanjs/native/plugins/camera/src/web.ts +3 -3
  372. package/vendor/@akanjs/native/plugins/file-picker/src/index.ts +4 -1
  373. package/vendor/@akanjs/native/plugins/local-notifications/src/web.ts +1 -1
  374. package/vendor/@akanjs/native/plugins/secure-storage/src/desktop.ts +1 -1
  375. package/vendor/@akanjs/native/plugins/share/src/options.ts +1 -1
  376. package/vendor/@akanjs/native/plugins/single-instance/src/desktop.ts +3 -2
  377. package/vendor/@akanjs/native/plugins/updates/src/desktop.ts +4 -1
  378. package/vendor/@akanjs/native/plugins/window/src/index.ts +2 -2
  379. package/vendor/use-agentic/Compaction.ts +38 -7
  380. package/vendor/use-agentic/Reference.ts +16 -9
  381. package/vendor/use-agentic/ToolOutput.ts +25 -3
  382. package/vendor/use-agentic/ToolReturn.ts +32 -0
  383. package/vendor/use-agentic/ToolRunner.ts +15 -13
  384. package/vendor/use-agentic/Transcript.ts +38 -2
  385. package/vendor/use-agentic/WIRE.md +20 -0
  386. package/vendor/use-agentic/index.ts +1 -0
  387. package/vendor/use-agentic/types.ts +6 -0
  388. package/webkit/McpAppAgent.ts +12 -2
  389. package/webkit/RenderLayer.tsx +23 -4
  390. package/webkit/useDebounce.ts +23 -14
  391. package/client/viewTransition.ts +0 -10
  392. package/types/client/viewTransition.d.ts +0 -3
@@ -50,6 +50,7 @@ export const List = <Item,>({
50
50
  {renderItem(item, idx)}
51
51
  <div className="flex gap-2 border-border border-l pl-2">
52
52
  <button
53
+ type="button"
53
54
  className={recipe(
54
55
  { variant: "outline", size: "icon" },
55
56
  "size-6 border-destructive p-0 text-destructive hover:bg-destructive hover:text-destructive-foreground",
@@ -66,6 +67,7 @@ export const List = <Item,>({
66
67
  </Fragment>
67
68
  ))}
68
69
  <button
70
+ type="button"
69
71
  className={recipe({ variant: "outline" })}
70
72
  onClick={() => {
71
73
  onAdd();
@@ -151,6 +153,7 @@ export const TextList = ({
151
153
  disabled={disabled}
152
154
  />
153
155
  <button
156
+ type="button"
154
157
  className={recipe(
155
158
  { variant: "outline", size: "icon" },
156
159
  "size-6 border-destructive p-0 text-destructive hover:bg-destructive hover:text-destructive-foreground",
@@ -169,6 +172,7 @@ export const TextList = ({
169
172
  <div className="my-5 h-[0.5px] bg-foreground/20" />
170
173
  {texts.length < maxlength ? (
171
174
  <button
175
+ type="button"
172
176
  className={recipe({ variant: "outline" }, "w-full")}
173
177
  onClick={() => {
174
178
  onChange([...texts, ""]);
@@ -24,7 +24,7 @@ const renderRow = <Light extends { id: string }>(
24
24
  return model ? render(model) : <Unresolved id={id} />;
25
25
  };
26
26
 
27
- interface RelationProps<Light> {
27
+ interface RelationProps<Light, Sort> {
28
28
  label?: string;
29
29
  desc?: string;
30
30
  labelClassName?: string;
@@ -32,18 +32,21 @@ interface RelationProps<Light> {
32
32
  disabled?: boolean;
33
33
  nullable?: boolean;
34
34
  initArgs?: any[];
35
- slice: SliceMeta;
35
+ slice: SliceMeta<Sort>;
36
+ /** Either one gives the field its own option window, leaving the slice's list on the page as it is. */
37
+ limit?: number;
38
+ sort?: NoInfer<Sort> & string;
36
39
  onSearch?: (text: string) => void;
37
40
  sortOption?: (a: Light, b: Light) => number;
38
41
  }
39
- export interface ParentProps<Light> extends RelationProps<Light> {
42
+ export interface ParentProps<Light, Sort = unknown> extends RelationProps<Light, Sort> {
40
43
  selectClassName?: string;
41
44
  value: Light | null;
42
45
  onChange: (value: Light | null) => void;
43
46
  renderOption: (model: Light) => ReactNode;
44
47
  renderSelected?: (value: Light) => ReactNode;
45
48
  }
46
- export const Parent = <Light extends { id: string }>({
49
+ export const Parent = <Light extends { id: string }, Sort = unknown>({
47
50
  label,
48
51
  desc,
49
52
  labelClassName,
@@ -52,6 +55,8 @@ export const Parent = <Light extends { id: string }>({
52
55
  nullable,
53
56
  disabled,
54
57
  initArgs,
58
+ limit,
59
+ sort,
55
60
  slice,
56
61
  value,
57
62
  onChange,
@@ -59,12 +64,14 @@ export const Parent = <Light extends { id: string }>({
59
64
  sortOption,
60
65
  renderOption,
61
66
  renderSelected = renderOption,
62
- }: ParentProps<Light>) => {
67
+ }: ParentProps<Light, Sort>) => {
63
68
  const { models, options, optionLabel, listLoading, load, read } = useRelationOptions<Light>({
64
69
  slice,
65
70
  ids: value ? [value.id] : [],
66
71
  pinned: [value],
67
72
  initArgs,
73
+ limit,
74
+ sort,
68
75
  sortOption,
69
76
  renderOption,
70
77
  });
@@ -92,14 +99,14 @@ export const Parent = <Light extends { id: string }>({
92
99
  );
93
100
  };
94
101
 
95
- export interface ParentIdProps<Light> extends RelationProps<Light> {
102
+ export interface ParentIdProps<Light, Sort = unknown> extends RelationProps<Light, Sort> {
96
103
  selectClassName?: string;
97
104
  value: string | null;
98
105
  onChange: (id: string | null, model: Light | null) => void;
99
106
  renderOption?: (model: Light) => ReactNode;
100
107
  renderSelected?: (value: Light) => ReactNode;
101
108
  }
102
- export const ParentId = <Light extends { id: string }>({
109
+ export const ParentId = <Light extends { id: string }, Sort = unknown>({
103
110
  label,
104
111
  desc,
105
112
  className,
@@ -108,6 +115,8 @@ export const ParentId = <Light extends { id: string }>({
108
115
  nullable,
109
116
  disabled,
110
117
  initArgs,
118
+ limit,
119
+ sort,
111
120
  slice,
112
121
  value,
113
122
  onChange,
@@ -115,11 +124,13 @@ export const ParentId = <Light extends { id: string }>({
115
124
  sortOption,
116
125
  renderOption,
117
126
  renderSelected = renderOption,
118
- }: ParentIdProps<Light>) => {
127
+ }: ParentIdProps<Light, Sort>) => {
119
128
  const { models, options, optionLabel, listLoading, load } = useRelationOptions<Light>({
120
129
  slice,
121
130
  ids: value ? [value] : [],
122
131
  initArgs,
132
+ limit,
133
+ sort,
123
134
  sortOption,
124
135
  renderOption,
125
136
  });
@@ -149,14 +160,14 @@ export const ParentId = <Light extends { id: string }>({
149
160
  );
150
161
  };
151
162
 
152
- export interface ChildrenProps<Light> extends RelationProps<Light> {
163
+ export interface ChildrenProps<Light, Sort = unknown> extends RelationProps<Light, Sort> {
153
164
  selectClassName?: string;
154
165
  value: Light[] | null;
155
166
  onChange: (value: Light[]) => void;
156
167
  renderOption: (model: Light) => ReactNode;
157
168
  renderSelected?: (value: Light) => ReactNode;
158
169
  }
159
- export const Children = <Light extends { id: string }>({
170
+ export const Children = <Light extends { id: string }, Sort = unknown>({
160
171
  label,
161
172
  desc,
162
173
  labelClassName,
@@ -165,6 +176,8 @@ export const Children = <Light extends { id: string }>({
165
176
  nullable,
166
177
  disabled,
167
178
  initArgs,
179
+ limit,
180
+ sort,
168
181
  slice,
169
182
  value,
170
183
  onChange,
@@ -172,12 +185,14 @@ export const Children = <Light extends { id: string }>({
172
185
  sortOption,
173
186
  renderOption,
174
187
  renderSelected = renderOption,
175
- }: ChildrenProps<Light>) => {
188
+ }: ChildrenProps<Light, Sort>) => {
176
189
  const { models, options, optionLabel, listLoading, load, read } = useRelationOptions<Light>({
177
190
  slice,
178
191
  ids: (value ?? []).map((model) => model.id),
179
192
  pinned: value ?? [],
180
193
  initArgs,
194
+ limit,
195
+ sort,
181
196
  sortOption,
182
197
  renderOption,
183
198
  });
@@ -206,12 +221,12 @@ export const Children = <Light extends { id: string }>({
206
221
  );
207
222
  };
208
223
 
209
- export interface ChildrenIdProps<Light> extends RelationProps<Light> {
224
+ export interface ChildrenIdProps<Light, Sort = unknown> extends RelationProps<Light, Sort> {
210
225
  value: string[] | null;
211
226
  onChange: (value: string[]) => void;
212
227
  renderOption: (model: Light) => ReactNode;
213
228
  }
214
- export const ChildrenId = <Light extends { id: string }>({
229
+ export const ChildrenId = <Light extends { id: string }, Sort = unknown>({
215
230
  label,
216
231
  desc,
217
232
  labelClassName,
@@ -219,17 +234,21 @@ export const ChildrenId = <Light extends { id: string }>({
219
234
  nullable,
220
235
  disabled,
221
236
  initArgs,
237
+ limit,
238
+ sort,
222
239
  slice,
223
240
  value,
224
241
  onChange,
225
242
  onSearch,
226
243
  sortOption,
227
244
  renderOption,
228
- }: ChildrenIdProps<Light>) => {
245
+ }: ChildrenIdProps<Light, Sort>) => {
229
246
  const { models, options, listLoading, load } = useRelationOptions<Light>({
230
247
  slice,
231
248
  ids: value ?? [],
232
249
  initArgs,
250
+ limit,
251
+ sort,
233
252
  sortOption,
234
253
  renderOption,
235
254
  });
@@ -6,6 +6,7 @@ import type { SliceMeta } from "akanjs/fetch";
6
6
  import { st } from "akanjs/store";
7
7
  import { type ReactNode, useEffect, useMemo, useState } from "react";
8
8
  import { LightRefCache } from "./lightRefCache";
9
+ import { useRelationWindow } from "./useRelationWindow";
9
10
 
10
11
  export interface RelationOptionsSource<Light extends { id: string }> {
11
12
  slice: SliceMeta;
@@ -14,6 +15,8 @@ export interface RelationOptionsSource<Light extends { id: string }> {
14
15
  /** Rows the control was handed outright, which a `Light`-valued field's own value already is. */
15
16
  pinned?: (Light | null)[];
16
17
  initArgs?: any[];
18
+ limit?: number;
19
+ sort?: string;
17
20
  sortOption?: (a: Light, b: Light) => number;
18
21
  renderOption?: (model: Light) => ReactNode;
19
22
  }
@@ -34,21 +37,30 @@ export const useRelationOptions = <Light extends { id: string }>({
34
37
  ids,
35
38
  pinned,
36
39
  initArgs,
40
+ limit,
41
+ sort,
37
42
  sortOption,
38
43
  renderOption,
39
44
  }: RelationOptionsSource<Light>) => {
40
- const { refName, sliceName } = slice;
45
+ const { refName, sliceName, argLength } = slice;
41
46
  const [modelName, ModelName] = [lowerlize(refName), capitalize(refName)];
42
47
  const names = {
43
48
  modelList: sliceName.replace(modelName, `${modelName}List`),
44
49
  modelListLoading: sliceName.replace(modelName, `${modelName}ListLoading`),
45
50
  refreshModel: sliceName.replace(modelName, `refresh${ModelName}`),
51
+ queryArgsOfModel: sliceName.replace(modelName, `queryArgsOf${ModelName}`),
52
+ limitOfModel: sliceName.replace(modelName, `limitOf${ModelName}`),
53
+ sortOfModel: sliceName.replace(modelName, `sortOf${ModelName}`),
46
54
  };
47
55
  const storeUse = st.use as { [key: string]: () => unknown };
48
56
  const storeDo = st.do as unknown as { [key: string]: (...args: any[]) => Promise<void> };
49
57
  const storeGet = st.get as unknown as <V>() => { [key: string]: V };
50
- const sliceList = storeUse[names.modelList]() as DataList<Light>;
51
- const listLoading = storeUse[names.modelListLoading]() as boolean;
58
+ const storeList = storeUse[names.modelList]() as DataList<Light>;
59
+ const storeListLoading = storeUse[names.modelListLoading]() as boolean;
60
+ const ownWindow = useRelationWindow<Light>(names.modelList, argLength);
61
+ const isWindowed = limit !== undefined || sort !== undefined;
62
+ const sliceList = isWindowed ? ownWindow.list : storeList;
63
+ const listLoading = isWindowed ? ownWindow.loading : storeListLoading;
52
64
  const [resolvedCount, setResolvedCount] = useState(0);
53
65
 
54
66
  const held = (pinned ?? []).filter((row): row is Light => !!row);
@@ -78,6 +90,19 @@ export const useRelationOptions = <Light extends { id: string }>({
78
90
  return labelOf(cnst?.full, model) ?? model.id;
79
91
  };
80
92
  const options = useMemo(() => models.map((model) => ({ label: optionLabel(model), value: model.id })), [models]);
93
+
94
+ const windowQuery = () => {
95
+ const state = storeGet<unknown>();
96
+ const args = initArgs ?? [];
97
+ return {
98
+ queryArgs: [
99
+ ...args.slice(0, argLength),
100
+ ...(state[names.queryArgsOfModel] as unknown[]).slice(args.length, argLength),
101
+ ],
102
+ limit: limit ?? (state[names.limitOfModel] as number),
103
+ sort: sort ?? (state[names.sortOfModel] as string),
104
+ };
105
+ };
81
106
 
82
107
  return {
83
108
  models,
@@ -85,11 +110,14 @@ export const useRelationOptions = <Light extends { id: string }>({
85
110
  optionLabel,
86
111
  listLoading,
87
112
 
88
- load: () => storeDo[names.refreshModel]({ invalidate: false, queryArgs: initArgs }),
113
+ load: () =>
114
+ isWindowed
115
+ ? ownWindow.load(windowQuery())
116
+ : storeDo[names.refreshModel]({ invalidate: false, queryArgs: initArgs }),
89
117
 
90
118
  read: () =>
91
119
  merge(
92
- storeGet<DataList<Light>>()[names.modelList],
120
+ isWindowed ? ownWindow.read() : storeGet<DataList<Light>>()[names.modelList],
93
121
  [...held, ...ids.map((id) => LightRefCache.get<Light>(refName, id))],
94
122
  sortOption,
95
123
  ),
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { DataList } from "akanjs/base";
3
+ import { fetch } from "akanjs/client";
4
+ import { isQueryEqual } from "akanjs/common";
5
+ import { useRef, useState } from "react";
6
+
7
+ export interface RelationWindowQuery {
8
+ queryArgs: unknown[];
9
+ limit: number;
10
+ sort: string;
11
+ }
12
+
13
+ interface WindowHold<Light extends { id: string }> {
14
+ list: DataList<Light>;
15
+ query: RelationWindowQuery | null;
16
+ request: Promise<void> | null;
17
+ }
18
+
19
+ export const useRelationWindow = <Light extends { id: string }>(listName: string, argLength: number) => {
20
+ const [list, setList] = useState(() => new DataList<Light>());
21
+ const [loading, setLoading] = useState(false);
22
+ const hold = useRef<WindowHold<Light>>({ list, query: null, request: null });
23
+
24
+ const load = (query: RelationWindowQuery) => {
25
+ const current = hold.current;
26
+ if (current.query && current.request && isQueryEqual(current.query, query)) return current.request;
27
+ const listFn = (fetch as unknown as { [key: string]: (...args: unknown[]) => Promise<Light[]> })[listName];
28
+ const args = Array.from({ length: argLength }, (_, idx) => query.queryArgs[idx]);
29
+ setLoading(true);
30
+ const request: Promise<void> = listFn(...args, 0, query.limit, query.sort)
31
+ .then((rows) => {
32
+ if (hold.current.request !== request) return;
33
+ hold.current.list = new DataList(rows);
34
+ setList(hold.current.list);
35
+ })
36
+ .catch((error: unknown) => {
37
+
38
+ if (hold.current.request === request) hold.current.query = null;
39
+ throw error;
40
+ })
41
+ .finally(() => {
42
+ if (hold.current.request === request) setLoading(false);
43
+ });
44
+ hold.current.query = query;
45
+ hold.current.request = request;
46
+ return request;
47
+ };
48
+
49
+ return { list, loading, load, read: () => hold.current.list };
50
+ };
package/ui/Image.tsx CHANGED
@@ -19,7 +19,9 @@ const EMPTY_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAAL
19
19
 
20
20
  type NativeImageProps = Omit<ImgHTMLAttributes<HTMLImageElement>, "alt" | "src" | "srcSet"> & {
21
21
  fill?: boolean;
22
+ /** Accepted for next/image compatibility; an `<img>` has no such attribute, so it draws nothing. */
22
23
  placeholder?: string;
24
+ /** Accepted for next/image compatibility; an `<img>` has no such attribute, so it draws nothing. */
23
25
  blurDataURL?: string;
24
26
  };
25
27
 
@@ -27,7 +29,7 @@ type AkanImageProps = NativeImageProps & {
27
29
  /** Takes precedence over `file.url`. */
28
30
  src?: string;
29
31
  file?: ImageLikeFile;
30
- /** Overrides `file.abstractData`. */
32
+ /** Overrides `file.abstractData`, which no render path draws as a placeholder. */
31
33
  abstractData?: string | null;
32
34
  /** Defaults to "image". */
33
35
  alt?: string;
@@ -63,7 +65,6 @@ export const Image = (
63
65
  const url = src || file?.url || null;
64
66
  const [width, height] = [props.width ?? file?.imageSize[0], props.height ?? file?.imageSize[1]];
65
67
 
66
- const blurDataURL = abstractData ?? file?.abstractData;
67
68
  const isPriority = Boolean(priority || preload);
68
69
 
69
70
  const optimized = url
@@ -79,7 +80,7 @@ export const Image = (
79
80
  });
80
81
  }
81
82
 
82
- const { fill, ...imgProps } = props;
83
+ const { fill, placeholder, blurDataURL, ...imgProps } = props;
83
84
 
84
85
  return (
85
86
  <img
@@ -93,7 +94,6 @@ export const Image = (
93
94
  loading={props.loading ?? (isPriority ? "eager" : "lazy")}
94
95
  decoding={props.decoding ?? "async"}
95
96
  fetchPriority={props.fetchPriority ?? (isPriority ? "high" : undefined)}
96
- {...(blurDataURL ? { placeholder: "blur", blurDataURL } : {})}
97
97
  {...imgProps}
98
98
  />
99
99
  );
package/ui/Input.tsx CHANGED
@@ -272,6 +272,7 @@ const DefaultPassword = ({
272
272
  />
273
273
  <div className="absolute top-1/2 right-2 flex -translate-y-1/2 items-center justify-center">
274
274
  <button
275
+ type="button"
275
276
  onClick={() => {
276
277
  setShowPassword(!showPassword);
277
278
  }}
@@ -127,7 +127,7 @@ export const LeftSider = ({ className, children, open, width, close, onCancel }:
127
127
  }}
128
128
  >
129
129
  {close ?? (
130
- <button className={buttonRecipe({ variant: "ghost", size: "icon" })}>
130
+ <button type="button" className={buttonRecipe({ variant: "ghost", size: "icon" })}>
131
131
  <BiX />
132
132
  </button>
133
133
  )}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { getEnv } from "akanjs/base";
3
- import { cn, csrLocation, getPathInfo, router, usePage, usePathCtx } from "akanjs/client";
3
+ import { cn, csrLocation, getPathInfo, Href, router, usePage, usePathCtx } from "akanjs/client";
4
4
  import { openExternalUrl } from "akanjs/client/native";
5
5
  import { Logger } from "akanjs/common";
6
6
  import { st } from "akanjs/store";
@@ -50,10 +50,12 @@ export const CsrLink = ({
50
50
  onClick={(event) => {
51
51
  props.onClick?.(event);
52
52
  if (event.defaultPrevented) return;
53
- const isExternal = href.startsWith("http") || href.startsWith("mailto:") || href.startsWith("tel:");
53
+ const isExternal = Href.isExternal(href);
54
54
  const url = href.startsWith("#") ? `${csrLocation.pathname}#${hash}` : href;
55
- if (isExternal) void openExternalUrl(href).catch(() => window.open(href, "_blank", "noopener,noreferrer"));
56
- else if (replace) router.replace(url, { scrollToTop });
55
+ if (isExternal) {
56
+ const target = Href.toExternalUrl(href, document.baseURI);
57
+ void openExternalUrl(target).catch(() => window.open(target, "_blank", "noopener,noreferrer"));
58
+ } else if (replace) router.replace(url, { scrollToTop });
57
59
  else router.push(url, { scrollToTop });
58
60
  }}
59
61
  >
@@ -78,7 +80,7 @@ export const SsrLink = ({
78
80
  const { lang } = usePage();
79
81
  const pathname = useCurrentPathname();
80
82
  const currentPath = getPathInfo(pathname, lang, prefix).path;
81
- const isExternal = href.startsWith("http") || href.startsWith("mailto:") || href.startsWith("tel:");
83
+ const isExternal = Href.isExternal(href);
82
84
  const internalPathInfo = getPathInfo(href, lang, prefix);
83
85
  const requestHref = getEnv().operationMode === "local" ? internalPathInfo.href : getPathInfo(href, lang, "").href;
84
86
  const path = internalPathInfo.path;
package/ui/Load/Units.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { DataList } from "akanjs/base";
3
- import { cn, router } from "akanjs/client";
3
+ import { cn, isRscNavigationFromCache, router } from "akanjs/client";
4
4
  import { type DynamicRecord, isQueryEqual, lowerlize } from "akanjs/common";
5
5
  import type { BaseInsight } from "akanjs/constant";
6
6
  import { ConstantRegistry, labelOf, withSharedInstances } from "akanjs/constant";
@@ -52,7 +52,7 @@ function Render<RefName extends string, Light extends { id: string }>({
52
52
  noDiv,
53
53
  from,
54
54
  to,
55
- loading,
55
+ loading = <Loading.Area />,
56
56
  empty,
57
57
  renderItem,
58
58
  renderList,
@@ -142,9 +142,11 @@ function Render<RefName extends string, Light extends { id: string }>({
142
142
  }, [initSignature, queryArgsSignature]);
143
143
 
144
144
  useEffect(() => {
145
+
146
+ const seededFromReplay = !loaded && isRscNavigationFromCache();
145
147
  const modelStaleAt = storeGet<Date>()[namesOfSlice.modelStaleAt];
146
148
  const staleThreshold = Math.max(modelStaleAt.getTime(), staleTime === undefined ? 0 : Date.now() - staleTime);
147
- if (storeGet<Date>()[namesOfSlice.modelInitAt].getTime() >= staleThreshold) return;
149
+ if (!seededFromReplay && storeGet<Date>()[namesOfSlice.modelInitAt].getTime() >= staleThreshold) return;
148
150
  if (storeGet<boolean>()[namesOfSlice.modelListLoading]) return;
149
151
  void storeDo[namesOfSlice.refreshModel]({ invalidate: true });
150
152
  }, [initSignature]);
@@ -213,12 +215,11 @@ function Render<RefName extends string, Light extends { id: string }>({
213
215
  ) : typeof renderEmpty === "function" ? (
214
216
  renderEmpty()
215
217
  ) : null}
216
- {showLoading ? (loading ?? <Loading.Area />) : null}
218
+ {showLoading ? loading : null}
217
219
  </>
218
220
  );
219
221
  else if (!renderItem) throw new Error("renderItem is required");
220
222
 
221
- const RenderItem = ({ model, idx }: { model: Light; idx: number }) => renderItem(model, idx);
222
223
  return (
223
224
  <>
224
225
  <ContainerWrapper
@@ -232,14 +233,16 @@ function Render<RefName extends string, Light extends { id: string }>({
232
233
  {modelDataList.length
233
234
  ? (reverse ? [...modelDataList].reverse() : modelDataList)
234
235
  .slice(from ?? 0, to ?? modelDataList.length + 1)
235
- .map((model: Light, idx: number) => <RenderItem key={model.id} model={model} idx={idx} />)
236
+ .map((model: Light, idx: number) => (
237
+ <RenderItem key={model.id} renderItem={renderItem} model={model} idx={idx} />
238
+ ))
236
239
  : empty !== undefined
237
240
  ? empty
238
241
  : typeof renderEmpty === "function"
239
242
  ? renderEmpty()
240
243
  : null}
241
244
  </ContainerWrapper>
242
- {showLoading ? (loading ?? <Loading.Area />) : null}
245
+ {showLoading ? loading : null}
243
246
  </>
244
247
  );
245
248
  }
@@ -286,6 +289,13 @@ export default function Units<RefName extends string, Light extends { id: string
286
289
  );
287
290
  }
288
291
 
292
+ interface RenderItemProps<Light> {
293
+ renderItem: (item: Light, idx: number) => ReactNode;
294
+ model: Light;
295
+ idx: number;
296
+ }
297
+ const RenderItem = <Light,>({ renderItem, model, idx }: RenderItemProps<Light>) => renderItem(model, idx);
298
+
289
299
  interface MoreProps {
290
300
  total: number;
291
301
  itemsPerPage: number;
package/ui/Load/View.tsx CHANGED
@@ -11,7 +11,7 @@ import { Empty } from "../Empty";
11
11
  import { Loading } from "../Loading";
12
12
  import Stream from "./Stream";
13
13
 
14
- interface DefaultProps<T extends string, M> {
14
+ interface DefaultProps<_T extends string, M> {
15
15
  className?: string;
16
16
  /** Renders the model without the default wrapper div. */
17
17
  noDiv?: boolean;
@@ -86,7 +86,7 @@ function Render<T extends string, Full extends { id: string }>({
86
86
  });
87
87
 
88
88
  return noDiv && renderModel ? (
89
- <>{renderView(renderModel)}</>
89
+ renderView(renderModel)
90
90
  ) : renderModel ? (
91
91
  <div className={cn("w-full", className)} data-agent-scope={scopePath}>
92
92
  {renderView(renderModel)}
package/ui/Model/Edit.tsx CHANGED
@@ -24,7 +24,7 @@ export default function Edit({ trigger, children, slice, modelId, modal, renderT
24
24
  <>
25
25
  <EditWrapper className="contents" slice={slice} modelId={modelId} modal={modal} draft={draft}>
26
26
  {trigger ?? (
27
- <button className={buttonRecipe({ variant: "primary" })}>
27
+ <button type="button" className={buttonRecipe({ variant: "primary" })}>
28
28
  <AiOutlineEdit /> {l("base.edit")}
29
29
  </button>
30
30
  )}
@@ -56,7 +56,7 @@ const EditModel = <Full,>({
56
56
  loadingWrapper,
57
57
  cancelEdit,
58
58
  }: OpenEditorProps<Full>) => {
59
- const storeUse = st.use as { [key: string]: () => unknown };
59
+ const storeUse = st.use as { [key: string]: (option?: { agent?: boolean }) => unknown };
60
60
  const storeDo = st.do as unknown as { [key: string]: (...args: any[]) => void };
61
61
  const { refName } = slice;
62
62
  const [modelName, ModelName] = useMemo(() => [lowerlize(refName), capitalize(refName)], []);
@@ -66,6 +66,7 @@ const EditModel = <Full,>({
66
66
  Model: ModelName,
67
67
  modelForm: `${modelName}Form`,
68
68
  modelFormLoading: `${modelName}FormLoading`,
69
+ modelFormUploading: `${modelName}FormUploading`,
69
70
  modelModal: `${modelName}Modal`,
70
71
  checkModelSubmitable: `check${ModelName}Submitable`,
71
72
  }),
@@ -73,6 +74,8 @@ const EditModel = <Full,>({
73
74
  );
74
75
  const modelModal = storeUse[names.modelModal]() as string | null;
75
76
  const modelForm = storeUse[names.modelForm]() as { id: string | null; [key: string]: any };
77
+
78
+ const modelFormUploading = storeUse[names.modelFormUploading]({ agent: false });
76
79
 
77
80
  st.tool(cancelEdit ? `cancelEditOf${ModelName}` : null)
78
81
  .desc(`Close the ${modelName} form without saving.`)
@@ -84,7 +87,7 @@ const EditModel = <Full,>({
84
87
 
85
88
  useEffect(() => {
86
89
  if (checkSubmit) checkSubmitable();
87
- }, [modelModal, modelForm]);
90
+ }, [modelModal, modelForm, modelFormUploading]);
88
91
 
89
92
  const LoadingWrapper = useMemo(() => {
90
93
  return loadingWrapper === false
@@ -167,6 +170,7 @@ export default function EditModal<Full extends { id: string }>({
167
170
  modelFormLoading: `${modelName}FormLoading`,
168
171
  modelModal: `${modelName}Modal`,
169
172
  modelSubmit: `${modelName}Submit`,
173
+ modelFormUploading: `${modelName}FormUploading`,
170
174
  submitModel: `submit${ModelName}`,
171
175
  resetModel: `reset${ModelName}`,
172
176
  setModelModal: `set${ModelName}Modal`,
@@ -301,6 +305,9 @@ export default function EditModal<Full extends { id: string }>({
301
305
  ? () => renderSubmit(storeUse[names.modelForm]() as Full)
302
306
  : () => {
303
307
  const modelSubmit = storeUse[names.modelSubmit]() as Submit;
308
+ const isUploading =
309
+ Object.keys(storeUse[names.modelFormUploading]({ agent: false }) as object).length > 0;
310
+ const isBlocked = modelSubmit.disabled || isUploading || !!disabled;
304
311
  const handleSubmit = async ({ onError }: { onError?: (e: string) => void } = {}) => {
305
312
  await storeDo[names.submitModel]({
306
313
  ...submitOption,
@@ -321,8 +328,7 @@ export default function EditModal<Full extends { id: string }>({
321
328
  };
322
329
  const submitModel = st
323
330
  .tool(names.submitModel, {
324
- guard: () =>
325
- modelSubmit.disabled || disabled ? `The ${names.model} form is not ready to submit.` : true,
331
+ guard: () => (isBlocked ? `The ${names.model} form is not ready to submit.` : true),
326
332
  })
327
333
  .desc(`Save the ${names.model} the open form holds.`)
328
334
  .exec(() => handleSubmit());
@@ -330,7 +336,7 @@ export default function EditModal<Full extends { id: string }>({
330
336
  <Button
331
337
  {...agentAttrs(submitModel)}
332
338
  className={cn("mt-4 w-full gap-2", submitClassName)}
333
- disabled={modelSubmit.disabled || !!disabled}
339
+ disabled={isBlocked}
334
340
  onClick={async (e, { onError }) => {
335
341
  await handleSubmit({ onError });
336
342
  }}
package/ui/Model/New.tsx CHANGED
@@ -45,7 +45,7 @@ export default function New({
45
45
  draft={draft}
46
46
  >
47
47
  {trigger ?? (
48
- <button className={buttonRecipe({ variant: "primary" })}>
48
+ <button type="button" className={buttonRecipe({ variant: "primary" })}>
49
49
  <AiOutlinePlus /> {l("base.new")}
50
50
  </button>
51
51
  )}
@@ -89,6 +89,7 @@ export default function SureToRemove({
89
89
  bodyClassName="border-destructive"
90
90
  action={
91
91
  <button
92
+ type="button"
92
93
  className={buttonRecipe({ variant: "destructive" }, "w-full")}
93
94
  disabled={typeNameToRemove && repeatName !== name}
94
95
  onClick={async () => {